diff --git a/addons/fleet/data/fleet_cars_data.xml b/addons/fleet/data/fleet_cars_data.xml index c2f4c011ddc..a3ca54750df 100644 --- a/addons/fleet/data/fleet_cars_data.xml +++ b/addons/fleet/data/fleet_cars_data.xml @@ -2,267 +2,267 @@ Abarth - + Acura - + Alfa - + Audi - + Austin - + Bentley - + Bmw - + Bugatti - + Buick - + Byd - + Cadillac - + Chevrolet - + Chrysler - + Citroen - + Corre La Licorne - + Daewoo - + Dodge - + Ferrari - + Fiat - + Ford - + Holden - + Honda - + Hyundai - + Infiniti - + Isuzu - + Jaguar - + Jeep - + Kia - + Koenigsegg - + Lagonda - + Lamborghini - + Lancia - + Land Rover - + Lexus - + Lincoln - + Lotus - + Maserati - + Maybach - + Mazda - + Mercedes - + Mg - + Mini - + Mitsubishi - + Morgan - + Nissan - + Oldsmobile - + Opel - + Peugeot - + Pontiac - + Porsche - + Rambler - + Renault - + Rolls-Royce - + Saab - + Scion - + Skoda - + Smart - + Steyr - + Subaru - + Tesla Motors - + Toyota - + Trabant - + Volkswagen - + Volvo - + Willys - + Suzuki - + Corsa diff --git a/addons/fleet/models/fleet_vehicle.py b/addons/fleet/models/fleet_vehicle.py index bc977182d20..ce22e580d7c 100644 --- a/addons/fleet/models/fleet_vehicle.py +++ b/addons/fleet/models/fleet_vehicle.py @@ -72,9 +72,7 @@ class FleetVehicle(models.Model): horsepower_tax = fields.Float('Horsepower Taxation') power = fields.Integer('Power', help='Power in kW of the vehicle') co2 = fields.Float('CO2 Emissions', help='CO2 emissions of the vehicle') - image = fields.Binary(related='model_id.image', string="Logo", readonly=False) - image_128 = fields.Binary(related='model_id.image_128', string="Logo (medium)", readonly=False) - image_64 = fields.Binary(related='model_id.image_64', string="Logo (small)", readonly=False) + image_128 = fields.Image(related='model_id.image_128', readonly=False) contract_renewal_due_soon = fields.Boolean(compute='_compute_contract_reminder', search='_search_contract_renewal_due_soon', string='Has Contracts to renew', multi='contract_info') contract_renewal_overdue = fields.Boolean(compute='_compute_contract_reminder', search='_search_get_overdue_contract_reminder', @@ -203,13 +201,6 @@ class FleetVehicle(models.Model): res.append(('id', search_operator, res_ids)) return res - @api.onchange('model_id') - def _onchange_model(self): - if self.model_id: - self.image_128 = self.model_id.image - else: - self.image_128 = False - @api.model def create(self, vals): res = super(FleetVehicle, self).create(vals) diff --git a/addons/fleet/models/fleet_vehicle_model.py b/addons/fleet/models/fleet_vehicle_model.py index 596945c27ce..ab6981c7600 100644 --- a/addons/fleet/models/fleet_vehicle_model.py +++ b/addons/fleet/models/fleet_vehicle_model.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models, tools +from odoo import api, fields, models class FleetVehicleModel(models.Model): @@ -14,9 +14,7 @@ class FleetVehicleModel(models.Model): vendors = fields.Many2many('res.partner', 'fleet_vehicle_model_vendors', 'model_id', 'partner_id', string='Vendors') manager_id = fields.Many2one('res.users', 'Fleet Manager', default=lambda self: self.env.uid, domain=lambda self: [('groups_id', 'in', self.env.ref('fleet.fleet_group_manager').id)]) - image = fields.Binary(related='brand_id.image', string="Logo", readonly=False) - image_128 = fields.Binary(related='brand_id.image_128', string="Logo (medium)", readonly=False) - image_64 = fields.Binary(related='brand_id.image_64', string="Logo (small)", readonly=False) + image_128 = fields.Image(related='brand_id.image_128', readonly=False) @api.depends('name', 'brand_id') def name_get(self): @@ -28,13 +26,6 @@ class FleetVehicleModel(models.Model): res.append((record.id, name)) return res - @api.onchange('brand_id') - def _onchange_brand(self): - if self.brand_id: - self.image_128 = self.brand_id.image - else: - self.image_128 = False - class FleetVehicleModelBrand(models.Model): _name = 'fleet.vehicle.model.brand' @@ -42,23 +33,4 @@ class FleetVehicleModelBrand(models.Model): _order = 'name asc' name = fields.Char('Make', required=True) - image = fields.Binary("Logo", - help="This field holds the image used as logo for the brand, limited to 1024x1024px.") - image_128 = fields.Binary("Medium-sized image", - help="Medium-sized logo of the brand. It is automatically " - "resized as a 128x128px image, with aspect ratio preserved. " - "Use this field in form views or some kanban views.") - image_64 = fields.Binary("Small-sized image", - help="Small-sized logo of the brand. It is automatically " - "resized as a 64x64px image, with aspect ratio preserved. " - "Use this field anywhere a small image is required.") - - @api.model_create_multi - def create(self, vals_list): - for vals in vals_list: - tools.image_resize_images(vals) - return super(FleetVehicleModelBrand, self).create(vals_list) - - def write(self, vals): - tools.image_resize_images(vals) - return super(FleetVehicleModelBrand, self).write(vals) + image_128 = fields.Image("Logo", max_width=128, max_height=128) diff --git a/addons/fleet/views/fleet_vehicle_model_views.xml b/addons/fleet/views/fleet_vehicle_model_views.xml index 85bdb4650a9..862d8eb111f 100644 --- a/addons/fleet/views/fleet_vehicle_model_views.xml +++ b/addons/fleet/views/fleet_vehicle_model_views.xml @@ -125,12 +125,11 @@ -
- Open + Open

diff --git a/addons/fleet/views/fleet_vehicle_views.xml b/addons/fleet/views/fleet_vehicle_views.xml index f1df6315e7e..68616c60855 100644 --- a/addons/fleet/views/fleet_vehicle_views.xml +++ b/addons/fleet/views/fleet_vehicle_views.xml @@ -210,7 +210,6 @@ - @@ -225,7 +224,7 @@
- Vehicle + Vehicle
@@ -279,7 +278,7 @@
- +
:
diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py index 1f51b65e1d0..ed7a6a73252 100644 --- a/addons/im_livechat/models/im_livechat_channel.py +++ b/addons/im_livechat/models/im_livechat_channel.py @@ -4,7 +4,7 @@ import base64 import random import re -from odoo import api, fields, models, modules, tools +from odoo import api, fields, models, modules class ImLivechatChannel(models.Model): @@ -21,7 +21,7 @@ class ImLivechatChannel(models.Model): def _default_image(self): image_path = modules.get_module_resource('im_livechat', 'static/src/img', 'default.png') - return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=(1024, 1024)) + return base64.b64encode(open(image_path, 'rb').read()) def _default_user_ids(self): return [(6, 0, [self._uid])] @@ -42,17 +42,7 @@ class ImLivechatChannel(models.Model): script_external = fields.Text('Script (external)', compute='_compute_script_external', store=False, readonly=True) nbr_channel = fields.Integer('Number of conversation', compute='_compute_nbr_channel', store=False, readonly=True) - # images fields - image = fields.Binary('Image', default=_default_image, - help="This field holds the image used as photo for the group, limited to 1024x1024px.") - image_128 = fields.Binary('Medium', - help="Medium-sized photo of the group. It is automatically "\ - "resized as a 128x128px image, with aspect ratio preserved. "\ - "Use this field in form views or some kanban views.") - image_64 = fields.Binary('Thumbnail', - help="Small-sized photo of the group. It is automatically "\ - "resized as a 64x64px image, with aspect ratio preserved. "\ - "Use this field anywhere a small image is required.") + image_128 = fields.Image("Image", max_width=128, max_height=128, default=_default_image) # relationnal fields user_ids = fields.Many2many('res.users', 'im_livechat_channel_im_user', 'channel_id', 'user_id', string='Operators', default=_default_user_ids) @@ -83,15 +73,6 @@ class ImLivechatChannel(models.Model): for record in self: record.nbr_channel = len(record.channel_ids) - @api.model - def create(self, vals): - tools.image_resize_images(vals) - return super(ImLivechatChannel, self).create(vals) - - def write(self, vals): - tools.image_resize_images(vals) - return super(ImLivechatChannel, self).write(vals) - # -------------------------- # Action Methods # -------------------------- diff --git a/addons/im_livechat/views/im_livechat_channel_views.xml b/addons/im_livechat/views/im_livechat_channel_views.xml index fd85c4e5dc0..3a331f6e762 100644 --- a/addons/im_livechat/views/im_livechat_channel_views.xml +++ b/addons/im_livechat/views/im_livechat_channel_views.xml @@ -87,7 +87,7 @@
- +
- +

@@ -157,7 +157,7 @@
- Acquirer + Acquirer

diff --git a/addons/payment_adyen/data/payment_acquirer_data.xml b/addons/payment_adyen/data/payment_acquirer_data.xml index a0b6488663d..18e3bb8afde 100644 --- a/addons/payment_adyen/data/payment_acquirer_data.xml +++ b/addons/payment_adyen/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Adyen - + adyen diff --git a/addons/payment_authorize/data/payment_acquirer_data.xml b/addons/payment_authorize/data/payment_acquirer_data.xml index da0e438c41d..293bcbad9e0 100644 --- a/addons/payment_authorize/data/payment_acquirer_data.xml +++ b/addons/payment_authorize/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Authorize.Net - + authorize diff --git a/addons/payment_buckaroo/data/payment_acquirer_data.xml b/addons/payment_buckaroo/data/payment_acquirer_data.xml index db69ed5fa7c..7b11d688844 100644 --- a/addons/payment_buckaroo/data/payment_acquirer_data.xml +++ b/addons/payment_buckaroo/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Buckaroo - + buckaroo diff --git a/addons/payment_ogone/data/payment_acquirer_data.xml b/addons/payment_ogone/data/payment_acquirer_data.xml index 49743cc2a62..8f121d164d5 100644 --- a/addons/payment_ogone/data/payment_acquirer_data.xml +++ b/addons/payment_ogone/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Ingenico - + ogone diff --git a/addons/payment_paypal/data/payment_acquirer_data.xml b/addons/payment_paypal/data/payment_acquirer_data.xml index 62bac1466ff..893feb51b6e 100644 --- a/addons/payment_paypal/data/payment_acquirer_data.xml +++ b/addons/payment_paypal/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Paypal - + paypal diff --git a/addons/payment_payumoney/data/payment_acquirer_data.xml b/addons/payment_payumoney/data/payment_acquirer_data.xml index f8c9dd97139..dab5726f043 100644 --- a/addons/payment_payumoney/data/payment_acquirer_data.xml +++ b/addons/payment_payumoney/data/payment_acquirer_data.xml @@ -3,7 +3,7 @@ PayUmoney - + payumoney diff --git a/addons/payment_sips/data/payment_acquirer_data.xml b/addons/payment_sips/data/payment_acquirer_data.xml index c6082d6f6fc..666c0271ad6 100644 --- a/addons/payment_sips/data/payment_acquirer_data.xml +++ b/addons/payment_sips/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Sips - + sips diff --git a/addons/payment_stripe/data/payment_acquirer_data.xml b/addons/payment_stripe/data/payment_acquirer_data.xml index a82caaa3704..2d30e4c6a72 100644 --- a/addons/payment_stripe/data/payment_acquirer_data.xml +++ b/addons/payment_stripe/data/payment_acquirer_data.xml @@ -3,7 +3,7 @@ Stripe - + stripe diff --git a/addons/payment_transfer/data/payment_acquirer_data.xml b/addons/payment_transfer/data/payment_acquirer_data.xml index 4cd7c7811e5..ba2964e13d8 100644 --- a/addons/payment_transfer/data/payment_acquirer_data.xml +++ b/addons/payment_transfer/data/payment_acquirer_data.xml @@ -4,7 +4,7 @@ Wire Transfer - + transfer diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py index 5a27ee7cf9e..c3f40d94478 100644 --- a/addons/point_of_sale/models/pos_category.py +++ b/addons/point_of_sale/models/pos_category.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- # Part of Odoo. See LICENSE file for full copyright and licensing details. -from odoo import api, fields, models, tools, _ +from odoo import api, fields, models, _ + class PosCategory(models.Model): _name = "pos.category" @@ -16,29 +17,7 @@ class PosCategory(models.Model): parent_id = fields.Many2one('pos.category', string='Parent Category', index=True) child_id = fields.One2many('pos.category', 'parent_id', string='Children Categories') sequence = fields.Integer(help="Gives the sequence order when displaying a list of product categories.") - # NOTE: there is no 'default image', because by default we don't show - # thumbnails for categories. However if we have a thumbnail for at least one - # category, then we display a default image on the other, so that the - # buttons have consistent styling. - image = fields.Binary( - help="This field holds the image used as image for the cateogry, limited to 1024x1024px.") - image_128 = fields.Binary(string="Medium-sized image", - help="Medium-sized image of the category. It is automatically " - "resized as a 128x128px image, with aspect ratio preserved. " - "Use this field in form views or some kanban views.") - image_64 = fields.Binary(string="Small-sized image", - help="Small-sized image of the category. It is automatically " - "resized as a 64x64px image, with aspect ratio preserved. " - "Use this field anywhere a small image is required.") - - @api.model - def create(self, vals): - tools.image_resize_images(vals) - return super(PosCategory, self).create(vals) - - def write(self, vals): - tools.image_resize_images(vals) - return super(PosCategory, self).write(vals) + image_128 = fields.Image("Image", max_width=128, max_height=128) def name_get(self): def get_names(cat): diff --git a/addons/point_of_sale/views/pos_category_view.xml b/addons/point_of_sale/views/pos_category_view.xml index c9936bcbf26..fa2b716cf5b 100644 --- a/addons/point_of_sale/views/pos_category_view.xml +++ b/addons/point_of_sale/views/pos_category_view.xml @@ -6,7 +6,7 @@ - +