summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--addons/account/views/account_move_views.xml2
-rw-r--r--addons/account_analytic_default/views/account_analytic_default_view.xml2
-rw-r--r--addons/calendar/views/calendar_views.xml2
-rw-r--r--addons/crm/views/crm_lead_views.xml6
-rw-r--r--addons/event_sale/models/event.py4
-rw-r--r--addons/fleet/models/fleet_vehicle.py8
-rw-r--r--addons/fleet/models/fleet_vehicle_model.py12
-rw-r--r--addons/fleet/views/fleet_vehicle_cost_views.xml2
-rw-r--r--addons/fleet/views/fleet_vehicle_model_views.xml6
-rw-r--r--addons/fleet/views/fleet_vehicle_views.xml6
-rw-r--r--addons/gamification/data/goal_base.xml2
-rw-r--r--addons/gamification/models/badge.py4
-rw-r--r--addons/gamification/models/gamification_karma_rank.py4
-rw-r--r--addons/gamification/views/badge.xml2
-rw-r--r--addons/gamification/views/challenge.xml2
-rw-r--r--addons/gamification/views/goal.xml2
-rw-r--r--addons/gamification/views/mail_templates.xml2
-rw-r--r--addons/hr/models/hr_employee.py6
-rw-r--r--addons/hr/models/hr_employee_public.py8
-rw-r--r--addons/hr/views/hr_employee_public_views.xml4
-rw-r--r--addons/hr/views/hr_employee_views.xml6
-rw-r--r--addons/hr/views/res_users.xml2
-rw-r--r--addons/hr_attendance/static/src/xml/attendance.xml6
-rw-r--r--addons/hr_attendance/views/hr_attendance_view.xml2
-rw-r--r--addons/hr_attendance/views/hr_employee_view.xml2
-rw-r--r--addons/hr_contract/views/hr_contract_views.xml4
-rw-r--r--addons/hr_expense/data/hr_expense_demo.xml4
-rw-r--r--addons/hr_expense/views/hr_expense_views.xml6
-rw-r--r--addons/hr_holidays/report/hr_leave_reports.xml2
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml4
-rw-r--r--addons/hr_holidays/views/hr_leave_views.xml4
-rw-r--r--addons/hr_maintenance/views/maintenance_views.xml2
-rw-r--r--addons/hr_recruitment/data/hr_recruitment_data.xml4
-rw-r--r--addons/hr_recruitment/views/hr_recruitment_views.xml2
-rw-r--r--addons/hr_timesheet/views/hr_timesheet_views.xml2
-rw-r--r--addons/hr_work_entry/views/hr_work_entry_views.xml2
-rw-r--r--addons/im_livechat/models/im_livechat_channel.py6
-rw-r--r--addons/im_livechat/views/im_livechat_channel_views.xml4
-rw-r--r--addons/lunch/controllers/main.py2
-rw-r--r--addons/lunch/models/lunch_product.py4
-rw-r--r--addons/lunch/report/lunch_cashmove_report_views.xml2
-rw-r--r--addons/lunch/views/lunch_cashmove_views.xml2
-rw-r--r--addons/lunch/views/lunch_orders_views.xml2
-rw-r--r--addons/lunch/views/lunch_product_views.xml6
-rw-r--r--addons/lunch/wizard/lunch_line_wizard.py4
-rw-r--r--addons/lunch/wizard/lunch_line_wizard_views.xml2
-rw-r--r--addons/mail/controllers/main.py2
-rw-r--r--addons/mail/models/mail_channel.py6
-rw-r--r--addons/mail/models/mail_message.py2
-rw-r--r--addons/mail/static/src/js/composers/basic_composer.js2
-rw-r--r--addons/mail/static/src/js/followers.js4
-rw-r--r--addons/mail/static/src/js/models/messages/message.js2
-rw-r--r--addons/mail/static/src/js/models/threads/channel.js2
-rw-r--r--addons/mail/static/src/js/models/threads/dm_chat.js2
-rw-r--r--addons/mail/static/src/xml/activity.xml6
-rw-r--r--addons/mail/views/mail_channel_views.xml4
-rw-r--r--addons/mail/views/mail_message_views.xml2
-rw-r--r--addons/mail/views/res_partner_views.xml2
-rw-r--r--addons/maintenance/views/maintenance_views.xml6
-rw-r--r--addons/mrp/data/mrp_demo.xml26
-rw-r--r--addons/mrp/views/ir_attachment_view.xml2
-rw-r--r--addons/mrp/views/mrp_workorder_views.xml2
-rw-r--r--addons/note/views/note_views.xml2
-rw-r--r--addons/payment/models/payment_acquirer.py4
-rw-r--r--addons/payment/views/payment_portal_templates.xml2
-rw-r--r--addons/payment/views/payment_views.xml4
-rw-r--r--addons/point_of_sale/data/point_of_sale_data.xml2
-rw-r--r--addons/point_of_sale/data/point_of_sale_demo.xml22
-rw-r--r--addons/point_of_sale/models/pos_category.py4
-rw-r--r--addons/point_of_sale/static/src/js/models.js2
-rw-r--r--addons/point_of_sale/static/src/js/screens.js6
-rw-r--r--addons/point_of_sale/views/pos_category_view.xml4
-rw-r--r--addons/point_of_sale/views/pos_session_view.xml2
-rw-r--r--addons/portal/static/src/xml/portal_chatter.xml2
-rw-r--r--addons/pos_restaurant/data/pos_restaurant_demo.xml36
-rw-r--r--addons/product/data/product_demo.xml52
-rw-r--r--addons/product/models/product.py93
-rw-r--r--addons/product/models/product_template.py10
-rw-r--r--addons/product/tests/test_variants.py24
-rw-r--r--addons/product/views/product_template_views.xml6
-rw-r--r--addons/product/views/product_views.xml10
-rw-r--r--addons/project/views/project_views.xml6
-rw-r--r--addons/purchase/views/portal_templates.xml2
-rw-r--r--addons/purchase_requisition/views/purchase_requisition_views.xml2
-rw-r--r--addons/sale/data/mail_data.xml2
-rw-r--r--addons/sale/data/sale_demo.xml2
-rw-r--r--addons/sale/models/product_template.py4
-rw-r--r--addons/sale/static/src/js/variant_mixin.js2
-rw-r--r--addons/sale_product_configurator/data/sale_demo.xml2
-rw-r--r--addons/sale_product_configurator/static/src/js/product_configurator_modal.js4
-rw-r--r--addons/sale_product_configurator/views/templates.xml12
-rw-r--r--addons/sales_team/views/crm_team_views.xml2
-rw-r--r--addons/stock/data/stock_demo2.xml2
-rw-r--r--addons/stock_landed_costs/views/stock_landed_cost_views.xml2
-rw-r--r--addons/stock_picking_batch/views/stock_picking_batch_views.xml2
-rw-r--r--addons/survey/views/survey_templates.xml2
-rw-r--r--addons/web/controllers/main.py2
-rw-r--r--addons/web/static/src/js/chrome/user_menu.js2
-rw-r--r--addons/web/static/src/js/fields/basic_fields.js2
-rw-r--r--addons/web/static/src/js/views/calendar/calendar_view.js2
-rw-r--r--addons/web/tests/test_image.py6
-rw-r--r--addons/website_blog/models/website_blog.py2
-rw-r--r--addons/website_blog/views/website_blog_views.xml2
-rw-r--r--addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml4
-rw-r--r--addons/website_customer/views/website_customer_templates.xml6
-rw-r--r--addons/website_event_track/models/event_track.py4
-rw-r--r--addons/website_event_track/views/event_track_templates.xml6
-rw-r--r--addons/website_event_track/views/event_track_views.xml2
-rw-r--r--addons/website_forum/views/forum.xml2
-rw-r--r--addons/website_forum/views/website_forum.xml12
-rw-r--r--addons/website_hr_recruitment/views/website_hr_recruitment_templates.xml2
-rw-r--r--addons/website_livechat/views/website_livechat.xml8
-rw-r--r--addons/website_mail_channel/views/website_mail_channel_templates.xml2
-rw-r--r--addons/website_membership/views/website_membership_templates.xml2
-rw-r--r--addons/website_profile/controllers/main.py4
-rw-r--r--addons/website_profile/views/website_profile.xml12
-rw-r--r--addons/website_sale/data/mail_template_data.xml2
-rw-r--r--addons/website_sale/models/product.py8
-rw-r--r--addons/website_sale/models/product_image.py2
-rw-r--r--addons/website_sale/static/src/js/website_sale.js4
-rw-r--r--addons/website_sale/static/src/scss/website_sale_frontend.scss2
-rw-r--r--addons/website_sale/static/src/xml/website_sale_utils.xml2
-rw-r--r--addons/website_sale/tests/test_website_sale_image.py92
-rw-r--r--addons/website_sale/views/product_views.xml14
-rw-r--r--addons/website_sale/views/templates.xml20
-rw-r--r--addons/website_sale_comparison/views/website_sale_comparison_template.xml4
-rw-r--r--addons/website_sale_digital/data/product_demo.xml2
-rw-r--r--addons/website_sale_slides/data/website_sale_slides_demo.xml8
-rw-r--r--addons/website_sale_wishlist/views/website_sale_wishlist_template.xml2
-rw-r--r--addons/website_slides/controllers/main.py6
-rw-r--r--addons/website_slides/data/mail_data.xml4
-rw-r--r--addons/website_slides/data/slide_channel_demo.xml14
-rw-r--r--addons/website_slides/data/slide_slide_demo.xml30
-rw-r--r--addons/website_slides/models/slide_slide.py16
-rw-r--r--addons/website_slides/static/src/js/slides_course_fullscreen_player.js2
-rw-r--r--addons/website_slides/static/src/xml/website_slides_fullscreen.xml2
-rw-r--r--addons/website_slides/views/slide_channel_views.xml2
-rw-r--r--addons/website_slides/views/slide_slide_views.xml2
-rw-r--r--addons/website_slides/views/website_slides_templates_course.xml8
-rw-r--r--addons/website_slides/views/website_slides_templates_homepage.xml12
-rw-r--r--addons/website_slides/views/website_slides_templates_lesson.xml6
-rw-r--r--addons/website_slides/views/website_slides_templates_lesson_embed.xml6
-rw-r--r--addons/website_slides/views/website_slides_templates_profile.xml2
-rw-r--r--addons/website_slides_survey/data/slide_slide_demo.xml4
-rw-r--r--addons/website_slides_survey/views/website_profile.xml2
-rw-r--r--doc/reference/javascript_reference.rst2
-rw-r--r--odoo/addons/base/models/image_mixin.py30
-rw-r--r--odoo/addons/base/models/res_partner.py6
-rw-r--r--odoo/addons/base/models/res_users.py4
-rw-r--r--odoo/addons/base/tests/test_ir_http.py2
-rw-r--r--odoo/addons/base/views/res_partner_views.xml28
-rw-r--r--odoo/addons/base/views/res_users_views.xml8
-rw-r--r--odoo/tools/image.py38
153 files changed, 525 insertions, 538 deletions
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index a59a00f0e8d..11e539aa60b 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -103,7 +103,7 @@
<span t-esc="record.name.value"/>
</div>
<div class="col-2 text-right">
- <img t-att-src="kanban_image('res.partner', 'image_small', record.partner_id.raw_value)" t-att-title="record.partner_id.value" t-att-alt="record.partner_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.partner', 'image_64', record.partner_id.raw_value)" t-att-title="record.partner_id.value" t-att-alt="record.partner_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/account_analytic_default/views/account_analytic_default_view.xml b/addons/account_analytic_default/views/account_analytic_default_view.xml
index f86ba13a513..ab568e3cd96 100644
--- a/addons/account_analytic_default/views/account_analytic_default_view.xml
+++ b/addons/account_analytic_default/views/account_analytic_default_view.xml
@@ -59,7 +59,7 @@
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div>
<strong><span><field name="analytic_id"/></span></strong>
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
<div t-if="record.date_start.value"><i class="fa fa-calendar"></i> From <field name="date_start"/> <t t-if="record.date_stop.value">to <field name="date_stop"/></t></div>
<div t-if="record.product_id.value"><strong>Product</strong> <field name="product_id"/> </div>
diff --git a/addons/calendar/views/calendar_views.xml b/addons/calendar/views/calendar_views.xml
index ff19273d798..e6845169f79 100644
--- a/addons/calendar/views/calendar_views.xml
+++ b/addons/calendar/views/calendar_views.xml
@@ -275,7 +275,7 @@
event_limit="3"
color="partner_id">
<field name="name"/>
- <field name="partner_ids" write_model="calendar.contacts" write_field="partner_id" avatar_field="image_small"/>
+ <field name="partner_ids" write_model="calendar.contacts" write_field="partner_id" avatar_field="image_64"/>
<field name="is_highlighted" invisible="1"/>
</calendar>
</field>
diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml
index a10ba85000f..56822dfe6c3 100644
--- a/addons/crm/views/crm_lead_views.xml
+++ b/addons/crm/views/crm_lead_views.xml
@@ -247,7 +247,7 @@
</div>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
@@ -355,7 +355,7 @@
<field name="company_currency"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value"/>
+ <img t-att-src="activity_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value"/>
<div>
<field name="name" display="full"/>
<field name="planned_revenue" widget="monetary" display="full" muted="1"/>
@@ -424,7 +424,7 @@
<field name="activity_ids" widget="kanban_activity"/>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/event_sale/models/event.py b/addons/event_sale/models/event.py
index ba407dc8f60..98485e5dd1d 100644
--- a/addons/event_sale/models/event.py
+++ b/addons/event_sale/models/event.py
@@ -239,8 +239,8 @@ class EventRegistration(models.Model):
def summary(self):
res = super(EventRegistration, self).summary()
- if self.event_ticket_id.product_id.image_medium:
- res['image'] = '/web/image/product.product/%s/image_medium' % self.event_ticket_id.product_id.id
+ if self.event_ticket_id.product_id.image_128:
+ res['image'] = '/web/image/product.product/%s/image_128' % self.event_ticket_id.product_id.id
information = res.setdefault('information', {})
information.append((_('Name'), self.name))
information.append((_('Ticket'), self.event_ticket_id.name or _('None')))
diff --git a/addons/fleet/models/fleet_vehicle.py b/addons/fleet/models/fleet_vehicle.py
index 3a713a0140e..bc977182d20 100644
--- a/addons/fleet/models/fleet_vehicle.py
+++ b/addons/fleet/models/fleet_vehicle.py
@@ -73,8 +73,8 @@ class FleetVehicle(models.Model):
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_medium = fields.Binary(related='model_id.image_medium', string="Logo (medium)", readonly=False)
- image_small = fields.Binary(related='model_id.image_small', string="Logo (small)", 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)
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',
@@ -206,9 +206,9 @@ class FleetVehicle(models.Model):
@api.onchange('model_id')
def _onchange_model(self):
if self.model_id:
- self.image_medium = self.model_id.image
+ self.image_128 = self.model_id.image
else:
- self.image_medium = False
+ self.image_128 = False
@api.model
def create(self, vals):
diff --git a/addons/fleet/models/fleet_vehicle_model.py b/addons/fleet/models/fleet_vehicle_model.py
index e945da2ac71..596945c27ce 100644
--- a/addons/fleet/models/fleet_vehicle_model.py
+++ b/addons/fleet/models/fleet_vehicle_model.py
@@ -15,8 +15,8 @@ class FleetVehicleModel(models.Model):
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_medium = fields.Binary(related='brand_id.image_medium', string="Logo (medium)", readonly=False)
- image_small = fields.Binary(related='brand_id.image_small', string="Logo (small)", 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)
@api.depends('name', 'brand_id')
def name_get(self):
@@ -31,9 +31,9 @@ class FleetVehicleModel(models.Model):
@api.onchange('brand_id')
def _onchange_brand(self):
if self.brand_id:
- self.image_medium = self.brand_id.image
+ self.image_128 = self.brand_id.image
else:
- self.image_medium = False
+ self.image_128 = False
class FleetVehicleModelBrand(models.Model):
@@ -44,11 +44,11 @@ class FleetVehicleModelBrand(models.Model):
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_medium = fields.Binary("Medium-sized image",
+ 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_small = fields.Binary("Small-sized image",
+ 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.")
diff --git a/addons/fleet/views/fleet_vehicle_cost_views.xml b/addons/fleet/views/fleet_vehicle_cost_views.xml
index a21159c3611..211c1910020 100644
--- a/addons/fleet/views/fleet_vehicle_cost_views.xml
+++ b/addons/fleet/views/fleet_vehicle_cost_views.xml
@@ -365,7 +365,7 @@
<field name="purchaser_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('res.partner', 'image_small', record.purchaser_id.raw_value)" t-att-title="record.purchaser_id.value" t-att-alt="record.purchaser_id.value"/>
+ <img t-att-src="activity_image('res.partner', 'image_64', record.purchaser_id.raw_value)" t-att-title="record.purchaser_id.value" t-att-alt="record.purchaser_id.value"/>
<div>
<field name="vehicle_id" display="full"/>
<field name="cost_subtype_id" muted="1" display="full"/>
diff --git a/addons/fleet/views/fleet_vehicle_model_views.xml b/addons/fleet/views/fleet_vehicle_model_views.xml
index ecb8741ec98..85bdb4650a9 100644
--- a/addons/fleet/views/fleet_vehicle_model_views.xml
+++ b/addons/fleet/views/fleet_vehicle_model_views.xml
@@ -6,7 +6,7 @@
<field name="arch" type="xml">
<form string="Model">
<sheet>
- <field name="image_medium" widget='image' class="oe_avatar"/>
+ <field name="image_128" widget='image' class="oe_avatar"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
@@ -106,7 +106,7 @@
<sheet>
<group>
<div>
- <field name="image_medium" widget="image" class="oe_avatar"/>
+ <field name="image_128" widget="image" class="oe_avatar"/>
<label for="name" class="oe_edit_only"/>
<h1>
<field name="name"/>
@@ -130,7 +130,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_vignette oe_semantic_html_override">
<a type="open" href="#" class="o_kanban_image oe_kanban_action">
- <img alt="Open" t-att-src="kanban_image('fleet.vehicle.model.brand', 'image_small', record.id.raw_value)" class="img-fluid" style="width:100px;"/>
+ <img alt="Open" t-att-src="kanban_image('fleet.vehicle.model.brand', 'image_64', record.id.raw_value)" class="img-fluid" style="width:100px;"/>
</a>
<div class="oe_kanban_details">
<h4 class="oe_partner_heading">
diff --git a/addons/fleet/views/fleet_vehicle_views.xml b/addons/fleet/views/fleet_vehicle_views.xml
index 8c3c6090340..f1df6315e7e 100644
--- a/addons/fleet/views/fleet_vehicle_views.xml
+++ b/addons/fleet/views/fleet_vehicle_views.xml
@@ -60,7 +60,7 @@
<field name="odometer_count" widget="statinfo" string="Odometer"/>
</button>
</div>
- <field name="image_medium" widget='image' class="oe_avatar"/>
+ <field name="image_128" widget='image' class="oe_avatar"/>
<div class="oe_title">
<label for="model_id" class="oe_edit_only"/>
<h1>
@@ -225,7 +225,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img t-att-src="kanban_image('fleet.vehicle', 'image_small', record.id.raw_value)" alt="Vehicle"/>
+ <img t-att-src="kanban_image('fleet.vehicle', 'image_64', record.id.raw_value)" alt="Vehicle"/>
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title">
@@ -279,7 +279,7 @@
<field name="id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('fleet.vehicle', 'image_small', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
+ <img t-att-src="activity_image('fleet.vehicle', 'image_64', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
<div>
<field name="license_plate"/> : <field name="model_id"/>
</div>
diff --git a/addons/gamification/data/goal_base.xml b/addons/gamification/data/goal_base.xml
index bb43e81b8f2..a09b588e237 100644
--- a/addons/gamification/data/goal_base.xml
+++ b/addons/gamification/data/goal_base.xml
@@ -145,7 +145,7 @@ Thank you,
<div style="height:${heightA}px;">
${extra_div | safe}
<div style="height:55px;">
- <img style="margin-bottom:5px;width:50px;height:50px;border-radius:50%;" t-att-src="image_data_uri(object.env['res.users'].browse(goal['user_id']).partner_id.image_small)" alt="${goal['name']}"/>
+ <img style="margin-bottom:5px;width:50px;height:50px;border-radius:50%;" t-att-src="image_data_uri(object.env['res.users'].browse(goal['user_id']).partner_id.image_64)" alt="${goal['name']}"/>
</div>
<div align="center" style ="color:${bgColor};height:20px">
${goal['name']}
diff --git a/addons/gamification/models/badge.py b/addons/gamification/models/badge.py
index fc93ffb8041..afece1a34ce 100644
--- a/addons/gamification/models/badge.py
+++ b/addons/gamification/models/badge.py
@@ -71,12 +71,12 @@ class GamificationBadge(models.Model):
active = fields.Boolean('Active', default=True)
description = fields.Text('Description', translate=True)
image = fields.Binary("Image", help="This field holds the image used for the badge.")
- image_medium = fields.Binary(
+ image_128 = fields.Binary(
"Medium-sized badge image",
help="Medium-sized image of the badge. It is automatically "
"resized as a 128x128px image, with aspect ratio preserved. "
"Use this field in form views or some kanban views.")
- image_small = fields.Binary(
+ image_64 = fields.Binary(
"Small-sized badge image",
help="Small-sized image of the badge. It is automatically "
"resized as a 64x64px image, with aspect ratio preserved. "
diff --git a/addons/gamification/models/gamification_karma_rank.py b/addons/gamification/models/gamification_karma_rank.py
index f88712f3c44..5958dd3424f 100644
--- a/addons/gamification/models/gamification_karma_rank.py
+++ b/addons/gamification/models/gamification_karma_rank.py
@@ -34,12 +34,12 @@ class KarmaRank(models.Model):
karma_min = fields.Integer(string='Required Karma', help='Minimum karma needed to reach this rank')
user_ids = fields.One2many('res.users', 'rank_id', string='Users', help="Users having this rank")
image = fields.Binary('Rank Icon')
- image_medium = fields.Binary(
+ image_128 = fields.Binary(
"Medium-sized rank icon",
help="Medium-sized icon of the rank. It is automatically "
"resized as a 128x128px image, with aspect ratio preserved. "
"Use this field in form views or some kanban views.")
- image_small = fields.Binary(
+ image_64 = fields.Binary(
"Small-sized rank icon",
help="Small-sized icon of the rank. It is automatically "
"resized as a 64x64px image, with aspect ratio preserved. "
diff --git a/addons/gamification/views/badge.xml b/addons/gamification/views/badge.xml
index 674f64208aa..9676faff953 100644
--- a/addons/gamification/views/badge.xml
+++ b/addons/gamification/views/badge.xml
@@ -135,7 +135,7 @@
<em><field name="description"/></em>
<div>
<t t-foreach="record.unique_owner_ids.raw_value.slice(0,11)" t-as="owner">
- <img width="24" height="24" class="oe_kanban_avatar" t-att-src="kanban_image('res.users', 'image_small', owner)" t-att-data-member_id="owner" alt="Owner"/>
+ <img width="24" height="24" class="oe_kanban_avatar" t-att-src="kanban_image('res.users', 'image_64', owner)" t-att-data-member_id="owner" alt="Owner"/>
</t>
</div>
</div>
diff --git a/addons/gamification/views/challenge.xml b/addons/gamification/views/challenge.xml
index a5f9f4fe2ee..745a9b5204c 100644
--- a/addons/gamification/views/challenge.xml
+++ b/addons/gamification/views/challenge.xml
@@ -158,7 +158,7 @@
</div>
</strong>
<t t-foreach="record.user_ids.raw_value.slice(0,11)" t-as="member">
- <img class="o_kanban_badge_avatars" t-att-src="kanban_image('res.users', 'image_small', member)" t-att-data-member_id="member" alt="Member"/>
+ <img class="o_kanban_badge_avatars" t-att-src="kanban_image('res.users', 'image_64', member)" t-att-data-member_id="member" alt="Member"/>
</t>
</div>
</div>
diff --git a/addons/gamification/views/goal.xml b/addons/gamification/views/goal.xml
index 9af36db1948..f571e28a4ec 100644
--- a/addons/gamification/views/goal.xml
+++ b/addons/gamification/views/goal.xml
@@ -150,7 +150,7 @@
<div class="o_kanban_content">
<p><strong><h4 class="oe_goal_name text-center" tooltip="kanban-tooltip"><field name="definition_id" /></h4></strong></p>
<div class="float-left">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" />
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" />
</div>
<field name="user_id" />
<div class="o_goal_state_block">
diff --git a/addons/gamification/views/mail_templates.xml b/addons/gamification/views/mail_templates.xml
index fda8a66f9a4..4f589833bf1 100644
--- a/addons/gamification/views/mail_templates.xml
+++ b/addons/gamification/views/mail_templates.xml
@@ -32,7 +32,7 @@
</td>
<td style="padding:15px 20px 10px 20px;">
<p style="text-align: center;">
- <img src="/web/image/gamification.karma.rank/${object.rank_id.id}/image_medium"/>
+ <img src="/web/image/gamification.karma.rank/${object.rank_id.id}/image_128"/>
</p>
</td>
</tr>
diff --git a/addons/hr/models/hr_employee.py b/addons/hr/models/hr_employee.py
index a9252dac860..b30e8bfd3bf 100644
--- a/addons/hr/models/hr_employee.py
+++ b/addons/hr/models/hr_employee.py
@@ -31,7 +31,7 @@ class HrEmployeePrivate(models.Model):
@api.model
def _default_image(self):
image_path = get_module_resource('hr', 'static/src/img', 'default_image.png')
- return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=tools.IMAGE_BIG_SIZE)
+ return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=(1024, 1024))
# resource and user
# required on the resource, make sure required="True" set in the view
@@ -96,9 +96,9 @@ class HrEmployeePrivate(models.Model):
# image: all image fields are base64 encoded and PIL-supported
image = fields.Binary(
"Photo", default=_default_image)
- image_medium = fields.Binary(
+ image_128 = fields.Binary(
"Medium-sized photo")
- image_small = fields.Binary(
+ image_64 = fields.Binary(
"Small-sized photo")
phone = fields.Char(related='address_home_id.phone', related_sudo=False, string="Private Phone", groups="hr.group_hr_user")
# employee in company
diff --git a/addons/hr/models/hr_employee_public.py b/addons/hr/models/hr_employee_public.py
index 8a80a23c939..75e72f704db 100644
--- a/addons/hr/models/hr_employee_public.py
+++ b/addons/hr/models/hr_employee_public.py
@@ -33,8 +33,8 @@ class HrEmployeePublic(models.Model):
# hr.employee.public specific fields
child_ids = fields.One2many('hr.employee.public', 'parent_id', string='Direct subordinates', readonly=True)
image = fields.Binary("Photo", compute='_compute_image', readonly=True, compute_sudo=True)
- image_medium = fields.Binary("Medium-sized photo", compute='_compute_image', readonly=True, compute_sudo=True)
- image_small = fields.Binary("Small-sized photo", compute='_compute_image', readonly=True, compute_sudo=True)
+ image_128 = fields.Binary("Medium-sized photo", compute='_compute_image', readonly=True, compute_sudo=True)
+ image_64 = fields.Binary("Small-sized photo", compute='_compute_image', readonly=True, compute_sudo=True)
parent_id = fields.Many2one('hr.employee.public', 'Manager', readonly=True)
coach_id = fields.Many2one('hr.employee.public', 'Coach', readonly=True)
@@ -43,8 +43,8 @@ class HrEmployeePublic(models.Model):
# We have to be in sudo to have access to the images
employee_id = self.sudo().env['hr.employee'].browse(employee.id)
employee.image = employee_id.image
- employee.image_medium = employee_id.image_medium
- employee.image_small = employee_id.image_small
+ employee.image_128 = employee_id.image_128
+ employee.image_64 = employee_id.image_64
@api.model
def _get_fields(self):
diff --git a/addons/hr/views/hr_employee_public_views.xml b/addons/hr/views/hr_employee_public_views.xml
index 0c8ddecb6b9..2fa227dd80a 100644
--- a/addons/hr/views/hr_employee_public_views.xml
+++ b/addons/hr/views/hr_employee_public_views.xml
@@ -36,7 +36,7 @@
<div class="oe_button_box" name="button_box">
<!-- Used by other modules-->
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
@@ -114,7 +114,7 @@
<!-- Medium employee's picture -->
<field name="image" widget="image" class="o_kanban_image_fill_left d-none d-md-block" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
<!-- Employee's picture optimized for mobile -->
- <field name="image_small" widget="image" class="o_kanban_image d-md-none rounded-circle" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
+ <field name="image_64" widget="image" class="o_kanban_image d-md-none rounded-circle" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
diff --git a/addons/hr/views/hr_employee_views.xml b/addons/hr/views/hr_employee_views.xml
index 71df38b5d6e..7ea3a15ec90 100644
--- a/addons/hr/views/hr_employee_views.xml
+++ b/addons/hr/views/hr_employee_views.xml
@@ -74,7 +74,7 @@
</div>
</button>
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
@@ -229,7 +229,7 @@
<!-- Medium employee's picture -->
<field name="image" widget="image" class="o_kanban_image_fill_left d-none d-md-block" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
<!-- Employee's picture optimized for mobile -->
- <field name="image_small" widget="image" class="o_kanban_image d-md-none rounded-circle" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
+ <field name="image_64" widget="image" class="o_kanban_image d-md-none rounded-circle" options="{'zoom': true, 'background': true, 'preventClicks': false}"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
@@ -271,7 +271,7 @@
<field name="id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_small', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
+ <img t-att-src="activity_image('hr.employee', 'image_64', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
<div>
<field name="name" display="full"/>
<field name="job_id" muted="1" display="full"/>
diff --git a/addons/hr/views/res_users.xml b/addons/hr/views/res_users.xml
index f6259a0e650..e14aec0890c 100644
--- a/addons/hr/views/res_users.xml
+++ b/addons/hr/views/res_users.xml
@@ -75,7 +75,7 @@
</div>
</button>
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image":"image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
diff --git a/addons/hr_attendance/static/src/xml/attendance.xml b/addons/hr_attendance/static/src/xml/attendance.xml
index f38dd7cfa7c..f0be4eddb6c 100644
--- a/addons/hr_attendance/static/src/xml/attendance.xml
+++ b/addons/hr_attendance/static/src/xml/attendance.xml
@@ -38,7 +38,7 @@
<t t-set="checked_in" t-value="widget.employee.attendance_state=='checked_in'"/>
<t t-if="widget.employee">
<div class="o_hr_attendance_user_badge o_home_menu_background">
- <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_medium&amp;id=#{widget.employee.id}" t-att-title="widget.employee.name" t-att-alt="widget.employee.name"/>
+ <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_128&amp;id=#{widget.employee.id}" t-att-title="widget.employee.name" t-att-alt="widget.employee.name"/>
</div>
<h1 class="mb8"><t t-esc="widget.employee.name"/></h1>
<h3 class="mt8 mb24"><t t-if="!checked_in">Welcome!</t><t t-else="">Want to check out?</t></h3>
@@ -66,7 +66,7 @@
</div>
<t t-if="widget.employee_id">
<div class="o_hr_attendance_user_badge o_home_menu_background">
- <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_medium&amp;id=#{widget.employee_id}" t-att-title="widget.employee_name" t-att-alt="widget.employee_name"/>
+ <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_128&amp;id=#{widget.employee_id}" t-att-title="widget.employee_name" t-att-alt="widget.employee_name"/>
</div>
<h1 class="mb8"><t t-esc="widget.employee_name"/></h1>
<h3 class="mt8 mb24"><t t-if="!checked_in">Welcome!</t><t t-else="">Want to check out?</t></h3>
@@ -109,7 +109,7 @@
<div class="o_hr_attendance_kiosk_mode">
<t t-if="widget.attendance">
<div class="o_hr_attendance_user_badge o_home_menu_background">
- <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_medium&amp;id=#{widget.attendance.employee_id[0]}" t-att-title="widget.employee_name" t-att-alt="widget.employee_name"/>
+ <img class="img rounded-circle" t-attf-src="/web/image?model=hr.employee&amp;field=image_128&amp;id=#{widget.attendance.employee_id[0]}" t-att-title="widget.employee_name" t-att-alt="widget.employee_name"/>
</div>
<t t-if="widget.attendance.check_out">
<h1 class="mb0">Goodbye <t t-esc="widget.employee_name"/>!</h1>
diff --git a/addons/hr_attendance/views/hr_attendance_view.xml b/addons/hr_attendance/views/hr_attendance_view.xml
index 9f12d4d6487..bd416202f2f 100644
--- a/addons/hr_attendance/views/hr_attendance_view.xml
+++ b/addons/hr_attendance/views/hr_attendance_view.xml
@@ -27,7 +27,7 @@
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div>
- <img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="24" height="24" class="oe_kanban_avatar mr4"/>
+ <img t-att-src="kanban_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="24" height="24" class="oe_kanban_avatar mr4"/>
<span class="o_kanban_record_title">
<strong><t t-esc="record.employee_id.value"/></strong>
</span>
diff --git a/addons/hr_attendance/views/hr_employee_view.xml b/addons/hr_attendance/views/hr_employee_view.xml
index c13e8848b61..ac2abad8010 100644
--- a/addons/hr_attendance/views/hr_employee_view.xml
+++ b/addons/hr_attendance/views/hr_employee_view.xml
@@ -137,7 +137,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img t-att-src="kanban_image('hr.employee', 'image_medium', record.id.raw_value)" alt="Employee"/>
+ <img t-att-src="kanban_image('hr.employee', 'image_128', record.id.raw_value)" alt="Employee"/>
</div>
<div class="oe_kanban_details">
<div id="textbox">
diff --git a/addons/hr_contract/views/hr_contract_views.xml b/addons/hr_contract/views/hr_contract_views.xml
index 920501167ce..467b856f6f0 100644
--- a/addons/hr_contract/views/hr_contract_views.xml
+++ b/addons/hr_contract/views/hr_contract_views.xml
@@ -261,7 +261,7 @@
<field name="job_id"/>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('hr.employee', 'image_medium', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
<div class="oe_clear"></div>
@@ -280,7 +280,7 @@
<field name="employee_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_medium', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
+ <img t-att-src="activity_image('hr.employee', 'image_128', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="name" display="full"/>
<field name="job_id" muted="1" display="full"/>
diff --git a/addons/hr_expense/data/hr_expense_demo.xml b/addons/hr_expense/data/hr_expense_demo.xml
index 57ec21bda80..a933f86d43e 100644
--- a/addons/hr_expense/data/hr_expense_demo.xml
+++ b/addons/hr_expense/data/hr_expense_demo.xml
@@ -50,7 +50,7 @@
<field name="uom_po_id" ref="uom.product_uom_km"/>
<field name="categ_id" ref="product.cat_expense"/>
<field name="can_be_expensed" eval="True" />
- <field name="image" type="base64" file="hr_expense/static/img/car_travel-image.jpg"/>
+ <field name="image_1920" type="base64" file="hr_expense/static/img/car_travel-image.jpg"/>
</record>
<record id="air_ticket" model="product.product">
@@ -61,7 +61,7 @@
<field name="default_code">EXP_AF</field>
<field name="categ_id" ref="product.cat_expense"/>
<field name="can_be_expensed" eval="True" />
- <field name="image" type="base64" file="hr_expense/static/img/air_ticket-image.jpg"/>
+ <field name="image_1920" type="base64" file="hr_expense/static/img/air_ticket-image.jpg"/>
</record>
<record id="product.expense_hotel" model="product.product">
diff --git a/addons/hr_expense/views/hr_expense_views.xml b/addons/hr_expense/views/hr_expense_views.xml
index 98f99b605e5..a8e2508c5d0 100644
--- a/addons/hr_expense/views/hr_expense_views.xml
+++ b/addons/hr_expense/views/hr_expense_views.xml
@@ -251,7 +251,7 @@
<field name="currency_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
+ <img t-att-src="activity_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="name" display="full"/>
<field name="total_amount" widget="monetary" muted="1" display="full"/>
@@ -310,7 +310,7 @@
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<field name='product_variant_count' invisible='1'/>
<field name="id" invisible="True"/>
- <field name="image_medium" widget="image" class="oe_avatar"/>
+ <field name="image_128" widget="image" class="oe_avatar"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="e.g. Lunch"/></h1>
@@ -662,7 +662,7 @@
<field name="currency_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
+ <img t-att-src="activity_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="name" display="full"/>
<field name="total_amount" widget="monetary" muted="1" display="full"/>
diff --git a/addons/hr_holidays/report/hr_leave_reports.xml b/addons/hr_holidays/report/hr_leave_reports.xml
index 69bb21a0f9a..20bc19d8451 100644
--- a/addons/hr_holidays/report/hr_leave_reports.xml
+++ b/addons/hr_holidays/report/hr_leave_reports.xml
@@ -71,7 +71,7 @@
<div t-attf-class="oe_kanban_global_click">
<div>
<span>
- <img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="40" height="40" class="oe_kanban_avatar float-left mr4"/>
+ <img t-att-src="kanban_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="40" height="40" class="oe_kanban_avatar float-left mr4"/>
</span>
<span>
<div>
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
index c48b31c7970..9bf45b801a0 100644
--- a/addons/hr_holidays/views/hr_leave_allocation_views.xml
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -253,7 +253,7 @@
<div class="oe_kanban_global_click container">
<div class="row no-gutters">
<div class="col-2">
- <img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)"
+ <img t-att-src="kanban_image('hr.employee', 'image_64', record.employee_id.raw_value)"
t-att-title="record.employee_id.value"
t-att-alt="record.employee_id.value"
width="40" height="40"
@@ -306,7 +306,7 @@
<field name="employee_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
+ <img t-att-src="activity_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value"/>
<div>
<field name="employee_id"/>
<span class="ml-3 text-muted">
diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml
index fa3c2e5c85b..8dcc4dc63f4 100644
--- a/addons/hr_holidays/views/hr_leave_views.xml
+++ b/addons/hr_holidays/views/hr_leave_views.xml
@@ -113,7 +113,7 @@
<div class="oe_kanban_global_click container">
<div class="row no-gutters">
<div class="col-2">
- <img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)"
+ <img t-att-src="kanban_image('hr.employee', 'image_64', record.employee_id.raw_value)"
t-att-title="record.employee_id.value"
t-att-alt="record.employee_id.value"
width="40" height="40"
@@ -178,7 +178,7 @@
<field name="number_of_days"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="50" height="50"/>
+ <img t-att-src="activity_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="50" height="50"/>
<div>
<field name="name"/>
<span class="ml-3 text-muted">
diff --git a/addons/hr_maintenance/views/maintenance_views.xml b/addons/hr_maintenance/views/maintenance_views.xml
index 0ede973b408..97be6402b91 100644
--- a/addons/hr_maintenance/views/maintenance_views.xml
+++ b/addons/hr_maintenance/views/maintenance_views.xml
@@ -99,7 +99,7 @@
<field name="department_id"/>
</xpath>
<xpath expr="//img[@t-att-title='record.owner_user_id.value']" position='replace'>
- <img t-att-src="kanban_image('hr.employee', 'image_small', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="27" height="27" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('hr.employee', 'image_64', record.employee_id.raw_value)" t-att-title="record.employee_id.value" t-att-alt="record.employee_id.value" width="27" height="27" class="oe_kanban_avatar"/>
</xpath>
<div t-if="record.serial_no.raw_value" position='after'>
<div t-if="!record.employee_id.raw_value">Unassigned</div>
diff --git a/addons/hr_recruitment/data/hr_recruitment_data.xml b/addons/hr_recruitment/data/hr_recruitment_data.xml
index c0ddf96d334..b4be4c7da54 100644
--- a/addons/hr_recruitment/data/hr_recruitment_data.xml
+++ b/addons/hr_recruitment/data/hr_recruitment_data.xml
@@ -95,7 +95,7 @@
<table>
<tr>
<td width="75">
- <img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
+ <img src="/web/image/res.users/${object.user_id.id}/image_64" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td>
<td>
<strong>${object.user_id.name}</strong><br/>
@@ -203,7 +203,7 @@
<table>
<tr>
<td width="75">
- <img src="/web/image/res.users/${object.user_id.id}/image_small" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
+ <img src="/web/image/res.users/${object.user_id.id}/image_64" alt="Avatar" style="vertical-align:baseline;max-width:64px;" />
</td>
<td>
<strong>${object.user_id.name}</strong><br/>
diff --git a/addons/hr_recruitment/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml
index 3b49ef198b7..2cc46130e01 100644
--- a/addons/hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/hr_recruitment/views/hr_recruitment_views.xml
@@ -339,7 +339,7 @@
<field name="legend_blocked" invisible="1"/>
<field name="legend_done" invisible="1"/>
</div>
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="30" height="30" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="30" height="30" class="oe_kanban_avatar"/>
</div>
</div>
diff --git a/addons/hr_timesheet/views/hr_timesheet_views.xml b/addons/hr_timesheet/views/hr_timesheet_views.xml
index 9aef1401601..131a8dbe565 100644
--- a/addons/hr_timesheet/views/hr_timesheet_views.xml
+++ b/addons/hr_timesheet/views/hr_timesheet_views.xml
@@ -148,7 +148,7 @@
<div t-attf-class="oe_kanban_global_click">
<div class="row">
<div class="col-2">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="40" height="40" class="oe_kanban_avatar float-left"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="40" height="40" class="oe_kanban_avatar float-left"/>
</div>
<div class="col-10">
<div>
diff --git a/addons/hr_work_entry/views/hr_work_entry_views.xml b/addons/hr_work_entry/views/hr_work_entry_views.xml
index d8bd3acb375..dc8209ad3e4 100644
--- a/addons/hr_work_entry/views/hr_work_entry_views.xml
+++ b/addons/hr_work_entry/views/hr_work_entry_views.xml
@@ -29,7 +29,7 @@
event_limit="5">
<field name="state" invisible="1"/>
<!-- Sidebar favorites filters -->
- <field name="employee_id" write_model="hr.user.work.entry.employee" write_field="employee_id" avatar_field="image_small"/>
+ <field name="employee_id" write_model="hr.user.work.entry.employee" write_field="employee_id" avatar_field="image_64"/>
<templates>
<t t-name="calendar-box">
<t t-set="color" t-value="widget.getColor(event.color_index)"/>
diff --git a/addons/im_livechat/models/im_livechat_channel.py b/addons/im_livechat/models/im_livechat_channel.py
index 920ad6ecb90..1f51b65e1d0 100644
--- a/addons/im_livechat/models/im_livechat_channel.py
+++ b/addons/im_livechat/models/im_livechat_channel.py
@@ -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=tools.IMAGE_BIG_SIZE)
+ return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=(1024, 1024))
def _default_user_ids(self):
return [(6, 0, [self._uid])]
@@ -45,11 +45,11 @@ class ImLivechatChannel(models.Model):
# 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_medium = fields.Binary('Medium',
+ 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_small = fields.Binary('Thumbnail',
+ 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.")
diff --git a/addons/im_livechat/views/im_livechat_channel_views.xml b/addons/im_livechat/views/im_livechat_channel_views.xml
index eb5503dca1c..fd85c4e5dc0 100644
--- a/addons/im_livechat/views/im_livechat_channel_views.xml
+++ b/addons/im_livechat/views/im_livechat_channel_views.xml
@@ -33,7 +33,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img t-att-src="kanban_image('im_livechat.channel', 'image_medium', record.id.raw_value)" class="img-fluid" alt="Channel"/>
+ <img t-att-src="kanban_image('im_livechat.channel', 'image_128', record.id.raw_value)" class="img-fluid" alt="Channel"/>
</div>
<div class="oe_kanban_details">
<div class="float-right">
@@ -87,7 +87,7 @@
<field string="% Happy" name="rating_percentage_satisfaction" widget="statinfo"/>
</button>
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
diff --git a/addons/lunch/controllers/main.py b/addons/lunch/controllers/main.py
index 3a94df70669..690c37ce14d 100644
--- a/addons/lunch/controllers/main.py
+++ b/addons/lunch/controllers/main.py
@@ -86,7 +86,7 @@ class LunchController(http.Controller):
res.update({
'username': user.sudo().name,
- 'userimage': '/web/image?model=res.users&id=%s&field=image_small' % user.id,
+ 'userimage': '/web/image?model=res.users&id=%s&field=image_64' % user.id,
'wallet': request.env['lunch.cashmove'].get_wallet_balance(user, False),
'is_manager': is_manager,
'locations': request.env['lunch.location'].search_read([], ['name']),
diff --git a/addons/lunch/models/lunch_product.py b/addons/lunch/models/lunch_product.py
index b46d212adf8..d091b19ea79 100644
--- a/addons/lunch/models/lunch_product.py
+++ b/addons/lunch/models/lunch_product.py
@@ -101,12 +101,12 @@ class LunchProduct(models.Model):
image = fields.Binary(
"Image",
help="This field holds the image used as image for the product, limited to 1024x1024px.")
- image_medium = fields.Binary(
+ image_128 = fields.Binary(
"Medium-sized image",
help="Medium-sized image of the product. It is automatically "
"resized as a 128x128px image, with aspect ratio preserved, "
"only when the image exceeds one of those sizes. Use this field in form views or some kanban views.")
- image_small = fields.Binary(
+ image_64 = fields.Binary(
"Small-sized image",
help="Small-sized image of the product. It is automatically "
"resized as a 64x64px image, with aspect ratio preserved. "
diff --git a/addons/lunch/report/lunch_cashmove_report_views.xml b/addons/lunch/report/lunch_cashmove_report_views.xml
index 73f091ccb92..64dba141ea4 100644
--- a/addons/lunch/report/lunch_cashmove_report_views.xml
+++ b/addons/lunch/report/lunch_cashmove_report_views.xml
@@ -106,7 +106,7 @@
<t t-esc="record.date.value"/>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
diff --git a/addons/lunch/views/lunch_cashmove_views.xml b/addons/lunch/views/lunch_cashmove_views.xml
index dec3bbf9e50..d1cafa0e47b 100644
--- a/addons/lunch/views/lunch_cashmove_views.xml
+++ b/addons/lunch/views/lunch_cashmove_views.xml
@@ -77,7 +77,7 @@
<t t-esc="record.date.value"/>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
diff --git a/addons/lunch/views/lunch_orders_views.xml b/addons/lunch/views/lunch_orders_views.xml
index 0995e6cf484..ef79c6c7b24 100644
--- a/addons/lunch/views/lunch_orders_views.xml
+++ b/addons/lunch/views/lunch_orders_views.xml
@@ -88,7 +88,7 @@
</a>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
diff --git a/addons/lunch/views/lunch_product_views.xml b/addons/lunch/views/lunch_product_views.xml
index 6c69f416c68..e5132ff5001 100644
--- a/addons/lunch/views/lunch_product_views.xml
+++ b/addons/lunch/views/lunch_product_views.xml
@@ -46,7 +46,7 @@
<field name="currency_id" invisible="1"/>
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
- <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium'}"/>
+ <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe-edit-only"/>
<h1>
@@ -89,7 +89,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<div class="o_kanban_image_fill_left d-none d-md-block"
- t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_medium', record.product_id.raw_value)}')"/>
+ t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.product_id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
@@ -137,7 +137,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click o_kanban_record_has_image_fill o_kanban_record">
<div class="o_kanban_image_fill_left d-none d-md-block"
- t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_medium', record.id.raw_value)}')"/>
+ t-attf-style="background-image:url('#{kanban_image('lunch.product', 'image_128', record.id.raw_value)}')"/>
<div class="oe_kanban_details">
<div class="o_kanban_record_top">
<div class="o_kanban_record_headings">
diff --git a/addons/lunch/wizard/lunch_line_wizard.py b/addons/lunch/wizard/lunch_line_wizard.py
index 3678449a615..39ef5041648 100644
--- a/addons/lunch/wizard/lunch_line_wizard.py
+++ b/addons/lunch/wizard/lunch_line_wizard.py
@@ -48,8 +48,8 @@ class LunchOrderWizard(models.TransientModel):
available_toppings_3 = fields.Boolean(help='Are extras available for this product', compute='_compute_available_toppings')
image = fields.Binary(related='product_id.image')
- image_medium = fields.Binary(related='product_id.image_medium')
- image_small = fields.Binary(related='product_id.image_small')
+ image_128 = fields.Binary(related='product_id.image_128')
+ image_64 = fields.Binary(related='product_id.image_64')
quantity = fields.Float('Quantity', default=1)
price_total = fields.Float('Total Price', compute='_compute_price_total')
diff --git a/addons/lunch/wizard/lunch_line_wizard_views.xml b/addons/lunch/wizard/lunch_line_wizard_views.xml
index 94afac2e5f4..b6f4a57f5a2 100644
--- a/addons/lunch/wizard/lunch_line_wizard_views.xml
+++ b/addons/lunch/wizard/lunch_line_wizard_views.xml
@@ -16,7 +16,7 @@
<field name="edit" invisible="1"/>
<div class="d-flex">
<div class="flex-grow-0 pr-5">
- <field name="image_medium" widget="image" class="o_lunch_image" />
+ <field name="image_128" widget="image" class="o_lunch_image" />
</div>
<div class="flex-grow-1 pr-5">
<h2><field name="product_name"/></h2>
diff --git a/addons/mail/controllers/main.py b/addons/mail/controllers/main.py
index b540d428ba0..bc20f0caac5 100644
--- a/addons/mail/controllers/main.py
+++ b/addons/mail/controllers/main.py
@@ -241,7 +241,7 @@ class MailController(http.Controller):
request.env[res_model].browse(res_id).check_access_rule('read')
if partner_id in request.env[res_model].browse(res_id).sudo().exists().message_ids.mapped('author_id').ids:
status, headers, _content = request.env['ir.http'].sudo().binary_content(
- model='res.partner', id=partner_id, field='image_medium', default_mimetype='image/png')
+ model='res.partner', id=partner_id, field='image_128', default_mimetype='image/png')
# binary content return an empty string and not a placeholder if obj[field] is False
if _content != '':
content = _content
diff --git a/addons/mail/models/mail_channel.py b/addons/mail/models/mail_channel.py
index 2b56951fb4f..83a418a44e4 100644
--- a/addons/mail/models/mail_channel.py
+++ b/addons/mail/models/mail_channel.py
@@ -64,7 +64,7 @@ class Channel(models.Model):
def _get_default_image(self):
image_path = modules.get_module_resource('mail', 'static/src/img', 'groupdefault.png')
- return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=tools.IMAGE_BIG_SIZE)
+ return tools.image_process(base64.b64encode(open(image_path, 'rb').read()), size=(1024, 1024))
@api.model
def default_get(self, fields):
@@ -104,11 +104,11 @@ class Channel(models.Model):
# image: all image fields are base64 encoded and PIL-supported
image = fields.Binary("Photo", default=_get_default_image,
help="This field holds the image used as photo for the group, limited to 1024x1024px.")
- image_medium = fields.Binary('Medium-sized photo',
+ image_128 = fields.Binary('Medium-sized photo',
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_small = fields.Binary('Small-sized photo',
+ image_64 = fields.Binary('Small-sized photo',
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.")
diff --git a/addons/mail/models/mail_message.py b/addons/mail/models/mail_message.py
index 229fdb943eb..38426d629bd 100644
--- a/addons/mail/models/mail_message.py
+++ b/addons/mail/models/mail_message.py
@@ -79,7 +79,7 @@ class Message(models.Model):
'res.partner', 'Author', index=True,
ondelete='set null', default=_get_default_author,
help="Author of the message. If not set, email_from may hold an email address that did not match any partner.")
- author_avatar = fields.Binary("Author's avatar", related='author_id.image_small', readonly=False)
+ author_avatar = fields.Binary("Author's avatar", related='author_id.image_64', readonly=False)
# recipients: include inactive partners (they may have been archived after
# the message was sent, but they should remain visible in the relation)
partner_ids = fields.Many2many('res.partner', string='Recipients', context={'active_test': False})
diff --git a/addons/mail/static/src/js/composers/basic_composer.js b/addons/mail/static/src/js/composers/basic_composer.js
index 2a496faf86d..d79a7c93028 100644
--- a/addons/mail/static/src/js/composers/basic_composer.js
+++ b/addons/mail/static/src/js/composers/basic_composer.js
@@ -100,7 +100,7 @@ var BasicComposer = Widget.extend({
this.avatarURL = session.uid > 0 ? session.url('/web/image', {
model: 'res.users',
- field: 'image_small',
+ field: 'image_64',
id: session.uid,
}) : '/web/static/src/img/user_menu_avatar.png';
},
diff --git a/addons/mail/static/src/js/followers.js b/addons/mail/static/src/js/followers.js
index 751187608ae..b6dc5ff6996 100644
--- a/addons/mail/static/src/js/followers.js
+++ b/addons/mail/static/src/js/followers.js
@@ -36,7 +36,7 @@ var Followers = AbstractField.extend({
init: function (parent, name, record, options) {
this._super.apply(this, arguments);
- this.image = this.attrs.image || 'image_small';
+ this.image = this.attrs.image || 'image_64';
this.comment = this.attrs.help || false;
this.followers = [];
@@ -120,7 +120,7 @@ var Followers = AbstractField.extend({
}
$follower_li = $(QWeb.render('mail.Followers.partner', {
- 'record': _.extend(record, {'avatar_url': '/web/image/' + record.res_model + '/' + record.res_id + '/image_small'}),
+ 'record': _.extend(record, {'avatar_url': '/web/image/' + record.res_model + '/' + record.res_id + '/image_64'}),
'widget': self})
);
$follower_li.appendTo($followers_list);
diff --git a/addons/mail/static/src/js/models/messages/message.js b/addons/mail/static/src/js/models/messages/message.js
index f93209a913f..d22569461e5 100644
--- a/addons/mail/static/src/js/models/messages/message.js
+++ b/addons/mail/static/src/js/models/messages/message.js
@@ -94,7 +94,7 @@ var Message = AbstractMessage.extend(Mixins.EventDispatcherMixin, ServicesMixin
if (this._isOdoobotAuthor()) {
return '/mail/static/src/img/odoobot.png';
} else if (this.hasAuthor()) {
- return '/web/image/res.partner/' + this.getAuthorID() + '/image_small';
+ return '/web/image/res.partner/' + this.getAuthorID() + '/image_64';
} else if (this.getType() === 'email') {
return '/mail/static/src/img/email_icon.png';
}
diff --git a/addons/mail/static/src/js/models/threads/channel.js b/addons/mail/static/src/js/models/threads/channel.js
index 9e9f3ac6a39..17d9453697a 100644
--- a/addons/mail/static/src/js/models/threads/channel.js
+++ b/addons/mail/static/src/js/models/threads/channel.js
@@ -220,7 +220,7 @@ var Channel = SearchableThread.extend(ThreadTypingMixin, {
getPreview: function () {
var result = this._super.apply(this, arguments);
if (!this.isTwoUserThread()) {
- result.imageSRC = '/web/image/mail.channel/' + this.getID() + '/image_small';
+ result.imageSRC = '/web/image/mail.channel/' + this.getID() + '/image_64';
}
var lastMessage = this.getLastMessage();
return _.extend(result, {
diff --git a/addons/mail/static/src/js/models/threads/dm_chat.js b/addons/mail/static/src/js/models/threads/dm_chat.js
index 78cc01a7044..b53637e614b 100644
--- a/addons/mail/static/src/js/models/threads/dm_chat.js
+++ b/addons/mail/static/src/js/models/threads/dm_chat.js
@@ -91,7 +91,7 @@ var DMChat = TwoUserChannel.extend(ChannelSeenMixin, {
*/
getPreview: function () {
var result = this._super.apply(this, arguments);
- result.imageSRC = '/web/image/res.partner/' + this.getDirectPartnerID() + '/image_small';
+ result.imageSRC = '/web/image/res.partner/' + this.getDirectPartnerID() + '/image_64';
return result;
},
/**
diff --git a/addons/mail/static/src/xml/activity.xml b/addons/mail/static/src/xml/activity.xml
index 11b4b0e9022..d399439d79e 100644
--- a/addons/mail/static/src/xml/activity.xml
+++ b/addons/mail/static/src/xml/activity.xml
@@ -17,7 +17,7 @@
<div class="o_thread_message" style="margin-bottom: 10px">
<div class="o_thread_message_sidebar">
<div class="o_avatar_stack">
- <img t-attf-src="/web/image#{activity.user_id[0] >= 0 ? ('/res.users/' + activity.user_id[0] + '/image_small') : ''}" class="o_thread_message_avatar rounded-circle mb8" t-att-title="activity.user_id[1]" t-att-alt="activity.user_id[1]"/>
+ <img t-attf-src="/web/image#{activity.user_id[0] >= 0 ? ('/res.users/' + activity.user_id[0] + '/image_64') : ''}" class="o_thread_message_avatar rounded-circle mb8" t-att-title="activity.user_id[1]" t-att-alt="activity.user_id[1]"/>
<i t-att-class="'o_avatar_icon fa ' + activity.icon + ' bg-' + (activity.state == 'planned'? 'success' : (activity.state == 'today'? 'warning' : 'danger')) + '-full'"
t-att-title="activity.activity_type_id[1]"/>
</div>
@@ -42,7 +42,7 @@
<dd class="mb8">
<t t-esc="activity.create_date.format(datetimeFormat)"/>
by
- <img t-attf-src="/web/image#{activity.create_uid[0] >= 0 ? ('/res.users/' + activity.create_uid[0] + '/image_small') : ''}"
+ <img t-attf-src="/web/image#{activity.create_uid[0] >= 0 ? ('/res.users/' + activity.create_uid[0] + '/image_64') : ''}"
height="18" width="18"
class="rounded-circle mr4"
t-att-title="activity.create_uid[1]"
@@ -51,7 +51,7 @@
</dd>
<dt>Assigned to</dt>
<dd class="mb8">
- <img t-attf-src="/web/image#{activity.user_id[0] >= 0 ? ('/res.users/' + activity.user_id[0] + '/image_small') : ''}" height="18" width="18" class="rounded-circle mr4" t-att-title="activity.user_id[1]" t-att-alt="activity.user_id[1]"/>
+ <img t-attf-src="/web/image#{activity.user_id[0] >= 0 ? ('/res.users/' + activity.user_id[0] + '/image_64') : ''}" height="18" width="18" class="rounded-circle mr4" t-att-title="activity.user_id[1]" t-att-alt="activity.user_id[1]"/>
<b><t t-esc="activity.user_id[1]"/></b>
<em>, due on </em><span t-attf-class="o_activity_color_#{activity.state}"><t t-esc="activity.date_deadline.format(dateFormat)"/></span>
</dd>
diff --git a/addons/mail/views/mail_channel_views.xml b/addons/mail/views/mail_channel_views.xml
index 40911a053ff..1fcd1c3ab58 100644
--- a/addons/mail/views/mail_channel_views.xml
+++ b/addons/mail/views/mail_channel_views.xml
@@ -61,7 +61,7 @@
</t>
<t t-name="kanban-box">
<div class="oe_module_vignette oe_kanban_global_click">
- <img t-att-src="kanban_image('mail.channel', 'image_medium', record.id.raw_value)" class="oe_module_icon" alt="Channel"/>
+ <img t-att-src="kanban_image('mail.channel', 'image_128', record.id.raw_value)" class="oe_module_icon" alt="Channel"/>
<div class="oe_module_desc">
<h4 class="o_kanban_record_title">#<field name="name"/></h4>
<p class="oe_module_name">
@@ -94,7 +94,7 @@
</button>
</div>
<div class="oe_button_box" name="button_box"/>
- <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium', 'size': [90, 90]}"/>
+ <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_128', 'size': [90, 90]}"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name"/>
diff --git a/addons/mail/views/mail_message_views.xml b/addons/mail/views/mail_message_views.xml
index 6839b357611..4581e3efb41 100644
--- a/addons/mail/views/mail_message_views.xml
+++ b/addons/mail/views/mail_message_views.xml
@@ -183,7 +183,7 @@
<field name="create_date" widget="date"/>
</time>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.create_uid.raw_value)" t-att-data-member_id="record.create_uid.raw_value" t-att-alt="record.create_uid.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.create_uid.raw_value)" t-att-data-member_id="record.create_uid.raw_value" t-att-alt="record.create_uid.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/mail/views/res_partner_views.xml b/addons/mail/views/res_partner_views.xml
index a620c261b44..3bc62e5c9a3 100644
--- a/addons/mail/views/res_partner_views.xml
+++ b/addons/mail/views/res_partner_views.xml
@@ -57,7 +57,7 @@
<field name="id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('res.partner', 'image_small', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
+ <img t-att-src="activity_image('res.partner', 'image_64', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
<div>
<field name="name" display="full"/>
<field name="parent_id" muted="1" display="full"/>
diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml
index 400607c118a..e651b315a22 100644
--- a/addons/maintenance/views/maintenance_views.xml
+++ b/addons/maintenance/views/maintenance_views.xml
@@ -166,7 +166,7 @@
</div>
<div class="oe_kanban_bottom_right">
<field name="kanban_state" widget="state_selection"/>
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
@@ -466,7 +466,7 @@
<div class="o_kanban_inline_block">
<field name="activity_ids" widget="kanban_activity" />
</div>
- <img t-att-src="kanban_image('res.users', 'image_small', record.owner_user_id.raw_value)" t-att-title="record.owner_user_id.value" t-att-alt="record.owner_user_id.value" width="27" height="27" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.owner_user_id.raw_value)" t-att-title="record.owner_user_id.value" t-att-alt="record.owner_user_id.value" width="27" height="27" class="oe_kanban_avatar"/>
</div>
</div>
</div>
@@ -660,7 +660,7 @@
<div t-attf-class="oe_kanban_global_click">
<div class="mb4">
<strong><field name="name"/></strong>
- <img t-att-src="kanban_image('res.users', 'image_small', record.technician_user_id.raw_value)" t-att-title="record.technician_user_id.value" t-att-alt="record.technician_user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.technician_user_id.raw_value)" t-att-title="record.technician_user_id.value" t-att-alt="record.technician_user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
<div class="row mt4">
<div class="col-6">
diff --git a/addons/mrp/data/mrp_demo.xml b/addons/mrp/data/mrp_demo.xml
index 6f6c7db8e07..5c9311f332e 100644
--- a/addons/mrp/data/mrp_demo.xml
+++ b/addons/mrp/data/mrp_demo.xml
@@ -175,7 +175,7 @@
<field name="description">Solid wood table.</field>
<field name="default_code">FURN_9666</field>
<field name="tracking">serial</field>
- <field name="image" type="base64" file="mrp/static/img/table.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/table.png"/>
</record>
<record id="product_product_computer_desk_head" model="product.product">
<field name="name">Table Top</field>
@@ -189,7 +189,7 @@
<field name="description">Solid wood is a durable natural material.</field>
<field name="default_code">FURN_8522</field>
<field name="tracking">serial</field>
- <field name="image" type="base64" file="mrp/static/img/table_top.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/table_top.png"/>
</record>
<record id="product_product_computer_desk_leg" model="product.product">
<field name="name">Table Leg</field>
@@ -203,7 +203,7 @@
<field name="description">18″ x 2½″ Square Leg</field>
<field name="default_code">FURN_2333</field>
<field name="tracking">lot</field>
- <field name="image" type="base64" file="mrp/static/img/table_leg.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/table_leg.png"/>
</record>
<record id="product_product_computer_desk_bolt" model="product.product">
<field name="name">Bolt</field>
@@ -216,7 +216,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Stainless steel screw full (dia - 5mm, Length - 10mm)</field>
<field name="default_code">CONS_89957</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_computer_desk_bolt.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_computer_desk_bolt.png"/>
</record>
<record id="product_product_computer_desk_screw" model="product.product">
<field name="name">Screw</field>
@@ -229,7 +229,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Stainless steel screw</field>
<field name="default_code">CONS_25630</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_computer_desk_screw.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_computer_desk_screw.png"/>
</record>
<record id="product_product_wood_ply" model="product.product">
@@ -243,7 +243,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Layers that are stick together to assemble wood panels.</field>
<field name="default_code">FURN_7111</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_wood_ply.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_wood_ply.png"/>
</record>
<record id="product_product_wood_wear" model="product.product">
<field name="name">Wear Layer</field>
@@ -256,7 +256,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Top layer of a wood panel.</field>
<field name="default_code">FURN_8111</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_wood_wear.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_wood_wear.png"/>
</record>
<record id="product_product_ply_veneer" model="product.product">
<field name="name">Ply Veneer</field>
@@ -268,7 +268,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_9111</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_ply_veneer.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_ply_veneer.png"/>
</record>
<record id="product_product_wood_panel" model="product.product">
@@ -281,7 +281,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_7023</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_wood_panel.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_wood_panel.png"/>
</record>
<record id="product_product_plastic_laminate" model="product.product">
<field name="name">Plastic Laminate</field>
@@ -293,7 +293,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_8621</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_plastic_laminate.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_plastic_laminate.png"/>
</record>
<record id="product_product_computer_desk_product_template" model="product.template">
@@ -423,7 +423,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Table kit</field>
<field name="default_code">FURN_78236</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_table_kit.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_table_kit.png"/>
</record>
<record id="product_product_table_kit_product_template" model="product.template">
@@ -467,7 +467,7 @@
<field name="description">Drawer on casters for great usability.</field>
<field name="default_code">FURN_2100</field>
<field name="barcode">601647855646</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_drawer_black.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_drawer_black.png"/>
</record>
<record id="product_product_drawer_case" model="product.product">
@@ -482,7 +482,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_5623</field>
<field name="barcode">601647855647</field>
- <field name="image" type="base64" file="mrp/static/img/product_product_drawer_case_black.png"/>
+ <field name="image_1920" type="base64" file="mrp/static/img/product_product_drawer_case_black.png"/>
</record>
<record id="product.product_product_27" model="product.product">
diff --git a/addons/mrp/views/ir_attachment_view.xml b/addons/mrp/views/ir_attachment_view.xml
index 415ae3a5233..98104a35446 100644
--- a/addons/mrp/views/ir_attachment_view.xml
+++ b/addons/mrp/views/ir_attachment_view.xml
@@ -37,7 +37,7 @@
<field name="priority" widget="priority"/>
</span>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.create_uid.raw_value)" t-att-data-member_id="record.create_uid.raw_value" t-att-alt="record.create_uid.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.create_uid.raw_value)" t-att-data-member_id="record.create_uid.raw_value" t-att-alt="record.create_uid.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/mrp/views/mrp_workorder_views.xml b/addons/mrp/views/mrp_workorder_views.xml
index 21f08de5eda..9c7538b15cf 100644
--- a/addons/mrp/views/mrp_workorder_views.xml
+++ b/addons/mrp/views/mrp_workorder_views.xml
@@ -389,7 +389,7 @@
<span t-if="record.working_state.raw_value != 'blocked' and record.working_user_ids.raw_value.length == 0 and record.last_working_user_id.raw_value"><i class="fa fa-pause" role="img" aria-label="Pause" title="Pause"/></span>
<span t-if="record.working_state.raw_value == 'blocked' and (record.working_user_ids.raw_value.length == 0 or record.last_working_user_id.raw_value)"><i class="fa fa-stop" role="img" aria-label="Stop" title="Stop"/></span>
<t t-if="record.last_working_user_id.raw_value">
- <img t-att-src="kanban_image('res.users', 'image_small', record.last_working_user_id.raw_value)" width="24" height="24" class="oe_kanban_avatar" alt="Avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.last_working_user_id.raw_value)" width="24" height="24" class="oe_kanban_avatar" alt="Avatar"/>
</t>
</div>
</div>
diff --git a/addons/note/views/note_views.xml b/addons/note/views/note_views.xml
index 72cf447c597..f27497b43d7 100644
--- a/addons/note/views/note_views.xml
+++ b/addons/note/views/note_views.xml
@@ -122,7 +122,7 @@
<t t-if="record.message_partner_ids.raw_value.length &gt; 1">
<div class="clearfix"></div>
<t t-foreach="record.message_partner_ids.raw_value" t-as="follower">
- <img t-att-src="kanban_image('res.partner', 'image_small', follower)" width="24" height="24" class="oe_kanban_avatar float-right" t-att-data-member_id="follower" alt="Follower"/>
+ <img t-att-src="kanban_image('res.partner', 'image_64', follower)" width="24" height="24" class="oe_kanban_avatar float-right" t-att-data-member_id="follower" alt="Follower"/>
</t>
<div class="clearfix"></div>
</t>
diff --git a/addons/payment/models/payment_acquirer.py b/addons/payment/models/payment_acquirer.py
index 6595a40399f..6d50d8133cb 100644
--- a/addons/payment/models/payment_acquirer.py
+++ b/addons/payment/models/payment_acquirer.py
@@ -154,12 +154,12 @@ class PaymentAcquirer(models.Model):
image = fields.Binary(
"Image", help="This field holds the image used for this provider, limited to 1024x1024px")
- image_medium = fields.Binary(
+ image_128 = fields.Binary(
"Medium-sized image",
help="Medium-sized image of this provider. It is automatically "
"resized as a 128x128px image, with aspect ratio preserved. "
"Use this field in form views or some kanban views.")
- image_small = fields.Binary(
+ image_64 = fields.Binary(
"Small-sized image",
help="Small-sized image of this provider. It is automatically "
"resized as a 64x64px image, with aspect ratio preserved. "
diff --git a/addons/payment/views/payment_portal_templates.xml b/addons/payment/views/payment_portal_templates.xml
index 9eea5737022..fa33821b13c 100644
--- a/addons/payment/views/payment_portal_templates.xml
+++ b/addons/payment/views/payment_portal_templates.xml
@@ -112,7 +112,7 @@
<a role="button" t-attf-class="btn btn-#{status} float-right" href="/my/home"><i class="fa fa-arrow-circle-right"/> Back to My Account</a>
</div>
<div class="col-md-6 offset-md-6 text-muted mt16"><!-- FIXME should be in a row... -->
- <span t-field="tx.acquirer_id.image_small" t-att-title="tx.acquirer_id.name" role="img" t-att-aria-label="tx.acquirer_id.name" t-options='{"widget": "image", "style":"max-width: 60px; display: inline-block"}'/>
+ <span t-field="tx.acquirer_id.image_64" t-att-title="tx.acquirer_id.name" role="img" t-att-aria-label="tx.acquirer_id.name" t-options='{"widget": "image", "style":"max-width: 60px; display: inline-block"}'/>
<span>Processed by <t t-esc="tx.acquirer_id.name"/>.</span>
</div>
</div>
diff --git a/addons/payment/views/payment_views.xml b/addons/payment/views/payment_views.xml
index ff335bc56e2..2b3a9548fb8 100644
--- a/addons/payment/views/payment_views.xml
+++ b/addons/payment/views/payment_views.xml
@@ -61,7 +61,7 @@
</div>
</button>
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<h1><field name="name" placeholder="Name"/></h1>
</div>
@@ -157,7 +157,7 @@
<t t-set="installed" t-value="!record.module_id.value || (record.module_id.value &amp;&amp; record.module_state.raw_value === 'installed')"/>
<div t-attf-class="oe_kanban_global_click #{installed and record.website_published.raw_value ? 'oe_kanban_color_5' : 'oe_kanban_color_white'}">
<div class="o_kanban_image">
- <img type="open" t-att-src="kanban_image('payment.acquirer', 'image_small', record.id.raw_value)" alt="Acquirer"/>
+ <img type="open" t-att-src="kanban_image('payment.acquirer', 'image_64', record.id.raw_value)" alt="Acquirer"/>
</div>
<div class="o_payment_acquirer_desc">
<h3 class="mt4"><t t-esc="record.name.value"/></h3>
diff --git a/addons/point_of_sale/data/point_of_sale_data.xml b/addons/point_of_sale/data/point_of_sale_data.xml
index 0dfa33f862a..48ca0eb669b 100644
--- a/addons/point_of_sale/data/point_of_sale_data.xml
+++ b/addons/point_of_sale/data/point_of_sale_data.xml
@@ -39,7 +39,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">MISC</field>
- <field name="image" type="base64" file="point_of_sale/static/img/product_product_49-image.jpg"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/product_product_49-image.jpg"/>
</record>
<record id="uom.product_uom_categ_unit" model="uom.category">
diff --git a/addons/point_of_sale/data/point_of_sale_demo.xml b/addons/point_of_sale/data/point_of_sale_demo.xml
index 7bb512a4dd6..d564078cc29 100644
--- a/addons/point_of_sale/data/point_of_sale_demo.xml
+++ b/addons/point_of_sale/data/point_of_sale_demo.xml
@@ -54,7 +54,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/wall_shelf_unit.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/wall_shelf_unit.png"/>
</record>
<record id="small_shelf" model="product.product">
<field name="available_in_pos">True</field>
@@ -69,7 +69,7 @@
<field name="to_weight">True</field>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/small_shelf.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/small_shelf.png"/>
</record>
<record id="letter_tray" model="product.product">
@@ -84,7 +84,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/letter_tray.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/letter_tray.png"/>
</record>
<record id="desk_organizer" model="product.product">
<field name="available_in_pos">True</field>
@@ -99,7 +99,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/desk_organizer.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/desk_organizer.png"/>
<field name="taxes_id" eval='[(5,)]'/> <!-- no taxes -->
</record>
@@ -116,7 +116,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/magnetic_board.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/magnetic_board.png"/>
</record>
<record id="monitor_stand" model="product.product">
<field name="available_in_pos">True</field>
@@ -130,7 +130,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/monitor_stand.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/monitor_stand.png"/>
</record>
<record id="desk_pad" model="product.product">
<field name="available_in_pos">True</field>
@@ -144,7 +144,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/desk_pad.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/desk_pad.png"/>
</record>
<record id="whiteboard" model="product.product">
@@ -157,7 +157,7 @@
<field name="categ_id" ref="product.product_category_5"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/whiteboard.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/whiteboard.png"/>
</record>
<record id="led_lamp" model="product.product">
@@ -172,7 +172,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/led_lamp.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/led_lamp.png"/>
</record>
<record id="newspaper_rack" model="product.product">
@@ -188,7 +188,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/newspaper_stand.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/newspaper_stand.png"/>
</record>
<record id="whiteboard_pen" model="product.product">
@@ -202,7 +202,7 @@
<field name="pos_categ_id" ref="pos_category_miscellaneous"/>
<field name="uom_id" ref="uom.product_uom_unit" />
<field name="uom_po_id" ref="uom.product_uom_unit" />
- <field name="image" type="base64" file="point_of_sale/static/img/whiteboard_pen.png"/>
+ <field name="image_1920" type="base64" file="point_of_sale/static/img/whiteboard_pen.png"/>
</record>
<record id="product.product_product_1" model="product.product">
diff --git a/addons/point_of_sale/models/pos_category.py b/addons/point_of_sale/models/pos_category.py
index a8e01c2ae4f..5a27ee7cf9e 100644
--- a/addons/point_of_sale/models/pos_category.py
+++ b/addons/point_of_sale/models/pos_category.py
@@ -22,11 +22,11 @@ class PosCategory(models.Model):
# buttons have consistent styling.
image = fields.Binary(
help="This field holds the image used as image for the cateogry, limited to 1024x1024px.")
- image_medium = fields.Binary(string="Medium-sized image",
+ 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_small = fields.Binary(string="Small-sized image",
+ 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.")
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index e24a5d7841b..1cea3a6c9ce 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -778,7 +778,7 @@ exports.PosModel = Backbone.Model.extend({
if (order) {
order.get_orderlines().forEach(function (orderline) {
var product = orderline.product;
- var image_url = window.location.origin + '/web/image?model=product.product&field=image_medium&id=' + product.id;
+ var image_url = window.location.origin + '/web/image?model=product.product&field=image_128&id=' + product.id;
// only download and convert image if we haven't done it before
if (! product.image_base64) {
diff --git a/addons/point_of_sale/static/src/js/screens.js b/addons/point_of_sale/static/src/js/screens.js
index 279d66b65ea..ae1c62a535a 100644
--- a/addons/point_of_sale/static/src/js/screens.js
+++ b/addons/point_of_sale/static/src/js/screens.js
@@ -732,7 +732,7 @@ var ProductCategoriesWidget = PosBaseWidget.extend({
},
get_image_url: function(category){
- return window.location.origin + '/web/image?model=pos.category&field=image_medium&id='+category.id;
+ return window.location.origin + '/web/image?model=pos.category&field=image_128&id='+category.id;
},
render_category: function( category, with_image ){
@@ -899,7 +899,7 @@ var ProductListWidget = PosBaseWidget.extend({
this.renderElement();
},
get_product_image_url: function(product){
- return window.location.origin + '/web/image?model=product.product&field=image_medium&id='+product.id;
+ return window.location.origin + '/web/image?model=product.product&field=image_128&id='+product.id;
},
replace: function($target){
this.renderElement();
@@ -1308,7 +1308,7 @@ var ClientListScreenWidget = ScreenWidget.extend({
}
},
partner_icon_url: function(id){
- return '/web/image?model=res.partner&id='+id+'&field=image_small';
+ return '/web/image?model=res.partner&id='+id+'&field=image_64';
},
// ui handle for the 'edit selected customer' action
diff --git a/addons/point_of_sale/views/pos_category_view.xml b/addons/point_of_sale/views/pos_category_view.xml
index 96d05ff9321..c9936bcbf26 100644
--- a/addons/point_of_sale/views/pos_category_view.xml
+++ b/addons/point_of_sale/views/pos_category_view.xml
@@ -41,14 +41,14 @@
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="name"/>
- <field name="image_medium"/>
+ <field name="image_128"/>
<field name="id"/>
<templates>
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="row">
<div class="col-4">
- <img height="100" width="100" t-att-src="kanban_image('pos.category', 'image_medium', record.id.raw_value)" alt="Category"/>
+ <img height="100" width="100" t-att-src="kanban_image('pos.category', 'image_128', record.id.raw_value)" alt="Category"/>
</div>
<div class="col-8">
<strong class="o_kanban_record_title"><field name="name"/></strong>
diff --git a/addons/point_of_sale/views/pos_session_view.xml b/addons/point_of_sale/views/pos_session_view.xml
index d2641930c6d..9ba67a2f1ae 100644
--- a/addons/point_of_sale/views/pos_session_view.xml
+++ b/addons/point_of_sale/views/pos_session_view.xml
@@ -155,7 +155,7 @@
<span><field name="start_at" /></span>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
diff --git a/addons/portal/static/src/xml/portal_chatter.xml b/addons/portal/static/src/xml/portal_chatter.xml
index 339477b3715..e8e740692f8 100644
--- a/addons/portal/static/src/xml/portal_chatter.xml
+++ b/addons/portal/static/src/xml/portal_chatter.xml
@@ -29,7 +29,7 @@
</t>
<t t-if="widget.options['display_composer']">
<div class="media">
- <img alt="Avatar" class="o_portal_chatter_avatar" t-attf-src="/web/image/res.partner/#{widget.options['partner_id']}/image_small/50x50"/>
+ <img alt="Avatar" class="o_portal_chatter_avatar" t-attf-src="/web/image/res.partner/#{widget.options['partner_id']}/image_64/50x50"/>
<div class="media-body">
<form class="o_portal_chatter_composer_form" t-attf-action="/mail/chatter_post" method="POST">
<input type="hidden" name="csrf_token" t-att-value="widget.options['csrf_token']"/>
diff --git a/addons/pos_restaurant/data/pos_restaurant_demo.xml b/addons/pos_restaurant/data/pos_restaurant_demo.xml
index 4f71aa2c841..8f8c2d463b1 100644
--- a/addons/pos_restaurant/data/pos_restaurant_demo.xml
+++ b/addons/pos_restaurant/data/pos_restaurant_demo.xml
@@ -32,7 +32,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
</record>
<record id="pos_food_funghi" model="product.product">
<field name="available_in_pos">True</field>
@@ -41,7 +41,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
</record>
<record id="pos_food_vege" model="product.product">
<field name="available_in_pos">True</field>
@@ -50,7 +50,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-pizza.png"/>
</record>
<record id="pos_food_bolo" model="product.product">
<field name="available_in_pos">True</field>
@@ -59,7 +59,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-pasta.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-pasta.jpg"/>
</record>
<record id="pos_food_4formaggi" model="product.product">
<field name="available_in_pos">True</field>
@@ -68,7 +68,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-pasta-4f.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-pasta-4f.jpg"/>
</record>
<record id="pos_food_bacon" model="product.product">
<field name="available_in_pos">True</field>
@@ -77,7 +77,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-burger.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-burger.jpg"/>
</record>
<record id="pos_food_cheeseburger" model="product.product">
<field name="available_in_pos">True</field>
@@ -86,7 +86,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-cheeseburger.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-cheeseburger.jpg"/>
</record>
<record id="pos_food_chicken" model="product.product">
<field name="available_in_pos">True</field>
@@ -95,7 +95,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-sandwich.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-sandwich.jpg"/>
</record>
<record id="pos_food_tuna" model="product.product">
<field name="available_in_pos">True</field>
@@ -104,7 +104,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-tuna.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-tuna.jpg"/>
</record>
<record id="pos_food_mozza" model="product.product">
<field name="available_in_pos">True</field>
@@ -113,7 +113,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-mozza.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-mozza.jpg"/>
</record>
<record id="pos_food_club" model="product.product">
<field name="available_in_pos">True</field>
@@ -122,7 +122,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-club.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-club.jpg"/>
</record>
<record id="pos_food_maki" model="product.product">
<field name="available_in_pos">True</field>
@@ -131,7 +131,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-maki.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-maki.jpg"/>
</record>
<record id="pos_food_salmon" model="product.product">
<field name="available_in_pos">True</field>
@@ -140,7 +140,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-salmon.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-salmon.jpg"/>
</record>
<record id="pos_food_temaki" model="product.product">
<field name="available_in_pos">True</field>
@@ -149,7 +149,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-temaki.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-temaki.jpg"/>
</record>
<record id="pos_food_chirashi" model="product.product">
<field name="available_in_pos">True</field>
@@ -158,7 +158,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="food"/>
<field name="categ_id" ref="pos_restaurant.product_category_pos_food"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-salmon-avocado.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-salmon-avocado.jpg"/>
</record>
<!-- Drinks -->
@@ -169,7 +169,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="drinks"/>
<field name="categ_id" ref="point_of_sale.product_category_pos"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-coke.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-coke.jpg"/>
</record>
<record id="water" model="product.product">
@@ -179,7 +179,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="drinks"/>
<field name="categ_id" ref="point_of_sale.product_category_pos"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-water.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-water.jpg"/>
</record>
<record id="minute_maid" model="product.product">
@@ -189,7 +189,7 @@
<field name="weight">0.01</field>
<field name="pos_categ_id" ref="drinks"/>
<field name="categ_id" ref="point_of_sale.product_category_pos"/>
- <field name="image" type="base64" file="pos_restaurant/static/img/th-minute_maid.jpg"/>
+ <field name="image_1920" type="base64" file="pos_restaurant/static/img/th-minute_maid.jpg"/>
</record>
<!-- Pos Config -->
diff --git a/addons/product/data/product_demo.xml b/addons/product/data/product_demo.xml
index a46ab878d1a..229e87b652a 100644
--- a/addons/product/data/product_demo.xml
+++ b/addons/product/data/product_demo.xml
@@ -85,7 +85,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_7777</field>
- <field name="image" type="base64" file="product/static/img/product_chair.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_chair.png"/>
</record>
<record id="product_delivery_02" model="product.product">
@@ -98,7 +98,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_8888</field>
- <field name="image" type="base64" file="product/static/img/product_lamp.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_lamp.png"/>
</record>
<record id="product_order_01" model="product.product">
@@ -111,7 +111,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_9999</field>
- <field name="image" type="base64" file="product/static/img/product_product_43-image.jpg"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_43-image.jpg"/>
</record>
<record id="product_product_3" model="product.product">
@@ -125,7 +125,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description_sale">Desk combination, black-brown: chair + desk + drawer.</field>
<field name="default_code">FURN_7800</field>
- <field name="image" type="base64" file="product/static/img/product_product_3-image.jpg"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_3-image.jpg"/>
</record>
<!-- Variants -->
@@ -202,7 +202,7 @@
<field name="weight">0.01</field>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_3')])]"/>
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
- <field name="image" type="base64" file="product/static/img/table02.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/table02.png"/>
</record>
<record id="product_product_4b" model="product.product">
<field name="default_code">FURN_0097</field>
@@ -210,7 +210,7 @@
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="standard_price">500.0</field>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_1'), ref('product.product_attribute_value_4')])]"/>
- <field name="image" type="base64" file="product/static/img/table04.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/table04.png"/>
</record>
<record id="product_product_4c" model="product.product">
<field name="default_code">FURN_0098</field>
@@ -218,7 +218,7 @@
<field name="standard_price">500.0</field>
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_2'), ref('product.product_attribute_value_3')])]"/>
- <field name="image" type="base64" file="product/static/img/table03.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/table03.png"/>
</record>
<record id="product_product_4d" model="product.product">
<field name="default_code">DESK0004</field>
@@ -226,7 +226,7 @@
<field name="product_tmpl_id" ref="product_product_4_product_template"/>
<field name="standard_price">500.0</field>
<field name="attribute_value_ids" eval="[(6,0,[ref('product.product_attribute_value_2'), ref('product.product_attribute_value_4')])]"/>
- <field name="image" type="base64" file="product/static/img/table01.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/table01.png"/>
</record>
<record id="product_product_5" model="product.product">
@@ -239,7 +239,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM06</field>
- <field name="image" type="base64" file="product/static/img/product_product_5-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_5-image.png"/>
</record>
<record id="product_product_6" model="product.product">
@@ -253,7 +253,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM07</field>
<field name='weight'>0.330</field>
- <field name="image" type="base64" file="product/static/img/product_product_6-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_6-image.png"/>
</record>
<record id="product_product_7" model="product.product">
@@ -266,7 +266,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM08</field>
- <field name="image" type="base64" file="product/static/img/product_product_7-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_7-image.png"/>
</record>
<record id="product_product_8" model="product.product">
@@ -280,7 +280,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM09</field>
<field name='weight'>9.54</field>
- <field name="image" type="base64" file="product/static/img/product_product_8-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_8-image.png"/>
</record>
<record id="product_product_9" model="product.product">
@@ -293,7 +293,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM10</field>
- <field name="image" type="base64" file="product/static/img/product_product_9-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_9-image.png"/>
</record>
<record id="product_product_10" model="product.product">
@@ -306,7 +306,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">E-COM11</field>
- <field name="image" type="base64" file="product/static/img/product_product_10-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_10-image.png"/>
</record>
<record id="product_product_11_product_template" model="product.template">
@@ -317,7 +317,7 @@
<field name="type">consu</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
- <field name="image" type="base64" file="product/static/img/product_product_11-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_11-image.png"/>
</record>
<!-- the product template attribute lines have to be defined before creating the variants -->
@@ -378,7 +378,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_0269</field>
- <field name="image" type="base64" file="product/static/img/product_product_12-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_12-image.png"/>
</record>
<record id="product_product_13" model="product.product">
@@ -391,7 +391,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_1118</field>
- <field name="image" type="base64" file="product/static/img/product_product_13-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_13-image.png"/>
</record>
<record id="product_product_16" model="product.product">
@@ -404,7 +404,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_8900</field>
- <field name="image" type="base64" file="product/static/img/product_product_16-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_16-image.png"/>
</record>
<record id="product_product_20" model="product.product">
@@ -417,7 +417,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_9001</field>
- <field name="image" type="base64" file="product/static/img/product_product_20-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_20-image.png"/>
</record>
<record id="product_product_22" model="product.product">
<field name="name">Desk Stand with Screen</field>
@@ -429,7 +429,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_7888</field>
- <field name="image" type="base64" file="product/static/img/product_product_22-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_22-image.png"/>
</record>
<record id="product_product_24" model="product.product">
@@ -442,7 +442,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_0789</field>
- <field name="image" type="base64" file="product/static/img/product_product_24-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_24-image.png"/>
</record>
<record id="product_product_25" model="product.product">
@@ -455,7 +455,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="default_code">FURN_6666</field>
- <field name="image" type="base64" file="product/static/img/product_product_25-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_25-image.png"/>
</record>
<record id="product_product_27" model="product.product">
@@ -469,7 +469,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description">Drawer with two routing possiblities.</field>
<field name="default_code">FURN_8855</field>
- <field name="image" type="base64" file="product/static/img/product_product_27-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_27-image.png"/>
</record>
<record id="consu_delivery_03" model="product.product">
@@ -483,7 +483,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description_sale">Four person modern office workstation</field>
<field name="default_code">FURN_8220</field>
- <field name="image" type="base64" file="product/static/img/product_product_d03-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_d03-image.png"/>
</record>
<record id="consu_delivery_02" model="product.product">
@@ -497,7 +497,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description_sale">Conference room table</field>
<field name="default_code">FURN_6741</field>
- <field name="image" type="base64" file="product/static/img/product_product_46-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_46-image.png"/>
</record>
<record id="consu_delivery_01" model="product.product">
@@ -511,7 +511,7 @@
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description_sale">Three Seater Sofa with Lounger in Steel Grey Colour</field>
<field name="default_code">FURN_8999</field>
- <field name="image" type="base64" file="product/static/img/product_product_d01-image.png"/>
+ <field name="image_1920" type="base64" file="product/static/img/product_product_d01-image.png"/>
</record>
<!--
diff --git a/addons/product/models/product.py b/addons/product/models/product.py
index 250cc578c74..ccefd82c3f3 100644
--- a/addons/product/models/product.py
+++ b/addons/product/models/product.py
@@ -122,96 +122,87 @@ class ProductProduct(models.Model):
# all image fields are base64 encoded and PIL-supported
- # all image_raw fields are technical and should not be displayed to the user
- image_raw_original = fields.Image("Raw Original Image")
+ # all image_variant fields are technical and should not be displayed to the user
+ image_variant_max = fields.Image("Variant Image", max_width=1920, max_height=1920)
# resized fields stored (as attachment) for performance
- image_raw_big = fields.Image("Raw Big-sized Image", related="image_raw_original", max_width=1024, max_height=1024, store=True)
- image_raw_large = fields.Image("Raw Large-sized Image", related="image_raw_original", max_width=256, max_height=256, store=True)
- image_raw_medium = fields.Image("Raw Medium-sized Image", related="image_raw_original", max_width=128, max_height=128, store=True)
- image_raw_small = fields.Image("Raw Small-sized Image", related="image_raw_original", max_width=64, max_height=64, store=True)
-
- can_image_raw_be_zoomed = fields.Boolean("Can image raw be zoomed", compute='_compute_images', store=True)
+ image_variant_1024 = fields.Image("Variant Image 1204", related="image_variant_max", max_width=1024, max_height=1024, store=True)
+ image_variant_512 = fields.Image("Variant Image 512", related="image_variant_max", max_width=512, max_height=512, store=True)
+ image_variant_256 = fields.Image("Variant Image 256", related="image_variant_max", max_width=256, max_height=256, store=True)
+ image_variant_128 = fields.Image("Variant Image 128", related="image_variant_max", max_width=128, max_height=128, store=True)
+ image_variant_64 = fields.Image("Variant Image 64", related="image_variant_max", max_width=64, max_height=64, store=True)
+ can_image_variant_be_zoomed = fields.Boolean("Can image variant be zoomed", compute='_compute_images', store=True)
# Computed fields that are used to create a fallback to the template if
# necessary, it's recommended to display those fields to the user.
- image_original = fields.Image("Original Image", compute='_compute_image_original', inverse='_set_image_original', help="Image in its original size, as it was uploaded.")
- image_big = fields.Image("Big-sized Image", compute='_compute_image_big', help="1024px * 1024px")
- image_large = fields.Image("Large-sized Image", compute='_compute_image_large', help="256px * 256px")
- image_medium = fields.Image("Medium-sized Image", compute='_compute_image_medium', help="128px * 128px")
- image_small = fields.Image("Small-sized Image", compute='_compute_image_small', help="64px * 64px")
- can_image_be_zoomed = fields.Boolean("Can image be zoomed", compute='_compute_can_image_be_zoomed')
-
- image = fields.Image("Image", compute='_compute_image', inverse='_set_image')
-
- @api.depends('image_raw_original')
+ image_1920 = fields.Image("Image", compute='_compute_image_1920', inverse='_set_image_1920')
+ image_1024 = fields.Image("Image 1024", compute='_compute_image_1024')
+ image_512 = fields.Image("Image 512", compute='_compute_image_512')
+ image_256 = fields.Image("Image 256", compute='_compute_image_256')
+ image_128 = fields.Image("Image 128", compute='_compute_image_128')
+ image_64 = fields.Image("Image 64", compute='_compute_image_64')
+ can_image_1024_be_zoomed = fields.Boolean("Can image be zoomed", compute='_compute_can_image_1024_be_zoomed')
+
+ @api.depends('image_variant_max')
def _compute_images(self):
for record in self:
- image = record.image_raw_original
- record.can_image_raw_be_zoomed = image and tools.is_image_size_above(image)
+ image = record.image_variant_max
+ record.can_image_variant_be_zoomed = image and tools.is_image_size_above(image)
- def _compute_image_original(self):
+ def _compute_image_1920(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_original = record.image_raw_original or record.product_tmpl_id.image_original
+ record.image_1920 = record.image_variant_max or record.product_tmpl_id.image_1920
- def _set_image_original(self):
+ def _set_image_1920(self):
for record in self:
if (
# We are trying to remove an image even though it is already
# not set, remove it from the template instead.
- not record.image_original and not record.image_raw_original or
+ not record.image_1920 and not record.image_variant_max or
# We are trying to add an image, but the template image is
# not set, write on the template instead.
- record.image_original and not record.product_tmpl_id.image_original or
+ record.image_1920 and not record.product_tmpl_id.image_1920 or
# There is only one variant, always write on the template.
self.search_count([
('product_tmpl_id', '=', record.product_tmpl_id.id),
('active', '=', True),
]) <= 1
):
- record.image_raw_original = False
- record.product_tmpl_id.image_original = record.image_original
+ record.image_variant_max = False
+ record.product_tmpl_id.image_1920 = record.image_1920
else:
- record.image_raw_original = record.image_original
+ record.image_variant_max = record.image_1920
- def _compute_image_big(self):
+ def _compute_image_1024(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_big = record.image_raw_big or record.product_tmpl_id.image_big
+ record.image_1024 = record.image_variant_1024 or record.product_tmpl_id.image_1024
- def _compute_image_large(self):
+ def _compute_image_512(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_large = record.image_raw_large or record.product_tmpl_id.image_large
+ record.image_512 = record.image_variant_512 or record.product_tmpl_id.image_512
- def _compute_image_medium(self):
+ def _compute_image_256(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_medium = record.image_raw_medium or record.product_tmpl_id.image_medium
+ record.image_256 = record.image_variant_256 or record.product_tmpl_id.image_256
- def _compute_image_small(self):
+ def _compute_image_128(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_small = record.image_raw_small or record.product_tmpl_id.image_small
+ record.image_128 = record.image_variant_128 or record.product_tmpl_id.image_128
- def _compute_can_image_be_zoomed(self):
+ def _compute_image_64(self):
"""Get the image from the template if no image is set on the variant."""
for record in self:
- record.can_image_be_zoomed = record.can_image_raw_be_zoomed if record.image_raw_original else record.product_tmpl_id.can_image_be_zoomed
+ record.image_64 = record.image_variant_64 or record.product_tmpl_id.image_64
- @api.depends('image_big')
- def _compute_image(self):
- for record in self:
- record.image = record.image_big
-
- def _set_image(self):
+ def _compute_can_image_1024_be_zoomed(self):
+ """Get the image from the template if no image is set on the variant."""
for record in self:
- record.image_original = record.image
- # We want the image field to be recomputed to have a correct size.
- # Without this `invalidate_cache`, the image field will keep holding the
- # image_original instead of the big-sized image.
- self.invalidate_cache()
+ record.can_image_1024_be_zoomed = record.can_image_variant_1024_be_zoomed if record.image_variant_max else record.product_tmpl_id.can_image_1024_be_zoomed
_sql_constraints = [
('barcode_uniq', 'unique(barcode)', "A barcode can only be assigned to one product !"),
@@ -384,8 +375,8 @@ class ProductProduct(models.Model):
for product in self:
# If there is an image set on the variant and no image set on the
# template, move the image to the template.
- if product.image_raw_original and not product.product_tmpl_id.image_original:
- product.product_tmpl_id.image_original = product.image_raw_original
+ if product.image_variant_max and not product.product_tmpl_id.image_1920:
+ product.product_tmpl_id.image_1920 = product.image_variant_max
# Check if product still exists, in case it has been unlinked by unlinking its template
if not product.exists():
continue
diff --git a/addons/product/models/product_template.py b/addons/product/models/product_template.py
index a9530f1f01f..1741c7ebe7f 100644
--- a/addons/product/models/product_template.py
+++ b/addons/product/models/product_template.py
@@ -371,6 +371,16 @@ class ProductTemplate(models.Model):
self.create_variant_ids()
if 'active' in vals and not vals.get('active'):
self.with_context(active_test=False).mapped('product_variant_ids').write({'active': vals.get('active')})
+ if 'image_1920' in vals:
+ self.env['product.product'].invalidate_cache(fnames=[
+ 'image_1920',
+ 'image_1024',
+ 'image_512',
+ 'image_256',
+ 'image_128',
+ 'image_64',
+ 'can_image_be_zoomed',
+ ])
return res
@api.returns('self', lambda value: value.id)
diff --git a/addons/product/tests/test_variants.py b/addons/product/tests/test_variants.py
index ccddf89c662..f07553a9141 100644
--- a/addons/product/tests/test_variants.py
+++ b/addons/product/tests/test_variants.py
@@ -501,7 +501,7 @@ class TestVariantsImages(common.TestProductCommon):
self.images.update({color: base64.b64encode(f.read())})
self.env['product.product'].create({
- 'image_raw_original': self.images[color],
+ 'image_variant_max': self.images[color],
'attribute_value_ids': [(6, 0, [color_value.id])],
'product_tmpl_id': self.template.id,
})
@@ -511,7 +511,7 @@ class TestVariantsImages(common.TestProductCommon):
return res
def test_variant_images(self):
- """Check that on variant, the image used is the image_raw_original if set,
+ """Check that on variant, the image used is the image_variant_max if set,
and defaults to the template image otherwise.
"""
f = io.BytesIO()
@@ -519,29 +519,29 @@ class TestVariantsImages(common.TestProductCommon):
f.seek(0)
image_black = base64.b64encode(f.read())
- images = self.variants.mapped('image_original')
+ images = self.variants.mapped('image_1920')
self.assertEqual(len(set(images)), 4)
variant_no_image = self.variants[0]
- self.assertFalse(variant_no_image.image)
- self.template.image = image_black
+ self.assertFalse(variant_no_image.image_1920)
+ self.template.image_1920 = image_black
# the first has no image variant, all the others do
- self.assertFalse(variant_no_image.image_raw_original)
+ self.assertFalse(variant_no_image.image_variant_max)
self.assertTrue(all(images[1:]))
# template image is the same as this one, since it has no image variant
- self.assertEqual(variant_no_image.image, self.template.image)
+ self.assertEqual(variant_no_image.image_1920, self.template.image_1920)
# having changed the template image should not have changed these
- self.assertEqual(images[1:], self.variants.mapped('image')[1:])
+ self.assertEqual(images[1:], self.variants.mapped('image_1920')[1:])
def test_update_images_with_archived_variants(self):
"""Update images after variants have been archived"""
self.variants[1:].write({'active': False})
- self.variants[0].image = self.images['red']
- self.assertEqual(self.template.image, self.images['red'])
- self.assertEqual(self.variants[0].image_raw_original, False)
- self.assertEqual(self.variants[0].image, self.images['red'])
+ self.variants[0].image_1920 = self.images['red']
+ self.assertEqual(self.template.image_1920, self.images['red'])
+ self.assertEqual(self.variants[0].image_variant_max, False)
+ self.assertEqual(self.variants[0].image_1920, self.images['red'])
class TestVariantsArchive(common.TestProductCommon):
diff --git a/addons/product/views/product_template_views.xml b/addons/product/views/product_template_views.xml
index 1540b133fe2..f17b7b2a966 100644
--- a/addons/product/views/product_template_views.xml
+++ b/addons/product/views/product_template_views.xml
@@ -68,7 +68,7 @@
<field name="arch" type="xml">
<kanban>
<field name="id"/>
- <field name="image_small"/>
+ <field name="image_64"/>
<field name="lst_price"/>
<field name="product_variant_count"/>
<field name="currency_id"/>
@@ -78,7 +78,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img t-att-src="kanban_image('product.template', 'image_small', record.id.raw_value)" alt="Product"/>
+ <img t-att-src="kanban_image('product.template', 'image_64', record.id.raw_value)" alt="Product"/>
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title">
@@ -111,7 +111,7 @@
<field name="id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('product.template', 'image_small', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
+ <img t-att-src="activity_image('product.template', 'image_64', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
<div>
<field name="name" display="full"/>
<div t-if="record.default_code.value" class="text-muted">
diff --git a/addons/product/views/product_views.xml b/addons/product/views/product_views.xml
index b495635b7cd..9539ca36ef9 100644
--- a/addons/product/views/product_views.xml
+++ b/addons/product/views/product_views.xml
@@ -21,7 +21,7 @@
<field name='is_product_variant' invisible='1'/>
<field name='attribute_line_ids' invisible='1'/>
<field name="id" invisible="True"/>
- <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium'}"/>
+ <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" placeholder="Product Name"/></h1>
@@ -268,7 +268,7 @@
<div class="oe_button_box" name="button_box"/>
<field name="active" invisible="1"/>
<field name="id" invisible="1"/>
- <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium'}"/>
+ <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label class="oe_edit_only" for="name" string="Product Name"/>
<h1><field name="name" readonly="1" placeholder="e.g. Odoo Enterprise Subscription"/></h1>
@@ -418,7 +418,7 @@
<field name="arch" type="xml">
<kanban>
<field name="id"/>
- <field name="image_small"/>
+ <field name="image_64"/>
<field name="lst_price"/>
<field name="activity_state"/>
<progressbar field="activity_state" colors='{"planned": "success", "today": "warning", "overdue": "danger"}'/>
@@ -426,7 +426,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img t-att-src="kanban_image('product.product', 'image_small', record.id.raw_value)" alt="Product"/>
+ <img t-att-src="kanban_image('product.product', 'image_64', record.id.raw_value)" alt="Product"/>
</div>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title">
@@ -457,7 +457,7 @@
<field name="default_code"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('product.product', 'image_small', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
+ <img t-att-src="activity_image('product.product', 'image_64', record.id.raw_value)" role="img" t-att-title="record.id.value" t-att-alt="record.id.value"/>
<div>
<field name="name" display="full"/>
<div t-if="record.default_code.value" class="text-muted">
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 6bdc873c97c..43734fc16aa 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -238,7 +238,7 @@
</div>
<div class="col-4">
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
@@ -610,7 +610,7 @@
</div>
<div class="oe_kanban_bottom_right">
<field name="kanban_state" widget="state_selection" groups="base.group_user"/>
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
</div>
@@ -698,7 +698,7 @@
<field name="user_id"/>
<templates>
<div t-name="activity-box">
- <img t-att-src="activity_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value"/>
+ <img t-att-src="activity_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value"/>
<div>
<field name="name" display="full"/>
<field name="project_id" muted="1" display="full" invisible="context.get('default_project_id', False)"/>
diff --git a/addons/purchase/views/portal_templates.xml b/addons/purchase/views/portal_templates.xml
index 6d723766665..58bcee1741f 100644
--- a/addons/purchase/views/portal_templates.xml
+++ b/addons/purchase/views/portal_templates.xml
@@ -103,7 +103,7 @@
<t t-set="current_subtotal" t-value="current_subtotal + ol.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<div t-if="not ol.display_type" class="row purchases_vertical_align">
<div class="col-lg-1 text-center">
- <img t-att-src="image_data_uri(resize_to_48(ol.product_id.image))" alt="Product"/>
+ <img t-att-src="image_data_uri(resize_to_48(ol.product_id.image_64))" alt="Product"/>
</div>
<div id='product_name' class="col-lg-5">
<span t-esc="ol.product_id.name"/>
diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml
index 8ef7677c1ce..6d031aa317b 100644
--- a/addons/purchase_requisition/views/purchase_requisition_views.xml
+++ b/addons/purchase_requisition/views/purchase_requisition_views.xml
@@ -243,7 +243,7 @@
<field name="vendor_id"/>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar float-right"/>
</div>
</div>
</div>
diff --git a/addons/sale/data/mail_data.xml b/addons/sale/data/mail_data.xml
index c149738db3a..05ef93eaaa4 100644
--- a/addons/sale/data/mail_data.xml
+++ b/addons/sale/data/mail_data.xml
@@ -154,7 +154,7 @@
<td colspan="4"><i>${line.name}</i></td>
% else:
<td style="width: 150px;">
- <img src="/web/image/product.product/${line.product_id.id}/image_small" width="64" alt="Product image"></img>
+ <img src="/web/image/product.product/${line.product_id.id}/image_64" width="64" alt="Product image"></img>
</td>
<td align="left">${line.product_id.name}</td>
<td>${line.product_uom_qty}</td>
diff --git a/addons/sale/data/sale_demo.xml b/addons/sale/data/sale_demo.xml
index ecdd2681779..ee66c68efd4 100644
--- a/addons/sale/data/sale_demo.xml
+++ b/addons/sale/data/sale_demo.xml
@@ -690,7 +690,7 @@ Thanks!</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="company_id" eval="[]"/>
- <field name="image" type="base64" file="sale/static/img/advance_product_0-image.jpg"/>
+ <field name="image_1920" type="base64" file="sale/static/img/advance_product_0-image.jpg"/>
<field name="taxes_id" eval="[]"/>
<field name="supplier_taxes_id" eval="[]"/>
</record>
diff --git a/addons/sale/models/product_template.py b/addons/sale/models/product_template.py
index 1db9daaa627..257f9fa595e 100644
--- a/addons/sale/models/product_template.py
+++ b/addons/sale/models/product_template.py
@@ -252,12 +252,12 @@ class ProductTemplate(models.Model):
)
list_price = product.price_compute('list_price')[product.id]
price = product.price if pricelist else list_price
- display_image = bool(product.image)
+ display_image = bool(product.image_1920)
else:
product_template = product_template.with_context(current_attributes_price_extra=[v.price_extra or 0.0 for v in combination])
list_price = product_template.price_compute('list_price')[product_template.id]
price = product_template.price if pricelist else list_price
- display_image = bool(product_template.image)
+ display_image = bool(product_template.image_1920)
filtered_combination = combination._without_no_variant_attributes()
if filtered_combination:
diff --git a/addons/sale/static/src/js/variant_mixin.js b/addons/sale/static/src/js/variant_mixin.js
index 219cd1ea817..36577e8dedd 100644
--- a/addons/sale/static/src/js/variant_mixin.js
+++ b/addons/sale/static/src/js/variant_mixin.js
@@ -611,7 +611,7 @@ var VariantMixin = {
_updateProductImage: function ($productContainer, displayImage, productId, productTemplateId) {
var model = productId ? 'product.product' : 'product.template';
var modelId = productId || productTemplateId;
- var imageUrl = '/web/image/{0}/{1}/' + (this._productImageField ? this._productImageField : 'image');
+ var imageUrl = '/web/image/{0}/{1}/' + (this._productImageField ? this._productImageField : 'image_1024');
var imageSrc = imageUrl
.replace("{0}", model)
.replace("{1}", modelId);
diff --git a/addons/sale_product_configurator/data/sale_demo.xml b/addons/sale_product_configurator/data/sale_demo.xml
index 00683af8855..117ebd6acc0 100644
--- a/addons/sale_product_configurator/data/sale_demo.xml
+++ b/addons/sale_product_configurator/data/sale_demo.xml
@@ -9,7 +9,7 @@
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
<field name="description_sale">Office chairs can harm your floor: protect it.</field>
- <field name="image" type="base64" file="sale/static/img/floor_protection-image.png"/>
+ <field name="image_1920" type="base64" file="sale/static/img/floor_protection-image.png"/>
</record>
<record id="product.product_product_4_product_template" model="product.template">
diff --git a/addons/sale_product_configurator/static/src/js/product_configurator_modal.js b/addons/sale_product_configurator/static/src/js/product_configurator_modal.js
index 7d52b07b76d..c2687e79d0d 100644
--- a/addons/sale_product_configurator/static/src/js/product_configurator_modal.js
+++ b/addons/sale_product_configurator/static/src/js/product_configurator_modal.js
@@ -60,7 +60,7 @@ var OptionalProductsModal = Dialog.extend(ServicesMixin, VariantMixin, {
this.pricelistId = params.pricelistId;
this.previousModalHeight = params.previousModalHeight;
this.dialogClass = 'oe_optional_products_modal';
- this._productImageField = 'image_medium';
+ this._productImageField = 'image_128';
// reset any previously populated properties maps
optionalProductsMap = {};
@@ -209,7 +209,7 @@ var OptionalProductsModal = Dialog.extend(ServicesMixin, VariantMixin, {
var productId = this.rootProduct.product_id;
$modalContent
.find('img:first')
- .attr("src", "/web/image/product.product/" + productId + "/image_medium");
+ .attr("src", "/web/image/product.product/" + productId + "/image_128");
if (this.rootProduct &&
(this.rootProduct.product_custom_attribute_values ||
diff --git a/addons/sale_product_configurator/views/templates.xml b/addons/sale_product_configurator/views/templates.xml
index ba03bbb30d1..4a849dc7846 100644
--- a/addons/sale_product_configurator/views/templates.xml
+++ b/addons/sale_product_configurator/views/templates.xml
@@ -54,8 +54,8 @@
</div>
<div class="col-lg-1 d-inline-block"></div>
<div class="col-lg-5 d-inline-block align-top text-left">
- <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image' % product_variant.id" class="d-block product_detail_img" alt="Product Image"/>
- <img t-else="" t-att-src="'/web/image/product.template/%s/image' % product.id" class="d-block product_detail_img" alt="Product Image"/>
+ <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image_1024' % product_variant.id" class="d-block product_detail_img" alt="Product Image"/>
+ <img t-else="" t-att-src="'/web/image/product.template/%s/image_1024' % product.id" class="d-block product_detail_img" alt="Product Image"/>
</div>
</t>
<t t-else="">
@@ -87,8 +87,8 @@
<input type="hidden" class="product_template_id" t-att-value="product.product_tmpl_id.id"/>
<input type="hidden" class="product_id" t-att-value="product_variant.id"/>
<td class='td-img'>
- <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image_medium' % product_variant.id" alt="Product Image"/>
- <img t-else="" t-att-src="'/web/image/product.template/%s/image_medium' % product.id" alt="Product Image"/>
+ <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image_128' % product_variant.id" alt="Product Image"/>
+ <img t-else="" t-att-src="'/web/image/product.template/%s/image_128' % product.id" alt="Product Image"/>
</td>
<td class='td-product_name'>
<strong t-esc="combination_info['display_name']"/>
@@ -165,8 +165,8 @@
<td class="td-img">
<input type="hidden" class="product_template_id" t-att-value="product.id"/>
<input type="hidden" class="product_id" t-attf-name="optional-product-#{product.id}" t-att-value="product_variant.id"/>
- <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image_medium' % product_variant.id" class="variant_image" alt="Product Image"/>
- <img t-else="" t-att-src="'/web/image/product.template/%s/image_medium' % product.id" class="variant_image" alt="Product Image"/>
+ <img t-if="product_variant" t-att-src="'/web/image/product.product/%s/image_128' % product_variant.id" class="variant_image" alt="Product Image"/>
+ <img t-else="" t-att-src="'/web/image/product.template/%s/image_128' % product.id" class="variant_image" alt="Product Image"/>
</td>
<td class='td-product_name' colspan="2">
<div class="float-left">
diff --git a/addons/sales_team/views/crm_team_views.xml b/addons/sales_team/views/crm_team_views.xml
index 7d60b8f3e26..a31b0e7ab2f 100644
--- a/addons/sales_team/views/crm_team_views.xml
+++ b/addons/sales_team/views/crm_team_views.xml
@@ -87,7 +87,7 @@
<t t-name="kanban-box">
<div class="oe_kanban_global_click" style="max-width: 200px">
<div class="o_kanban_record_top">
- <img t-att-src="kanban_image('res.users', 'image_small', record.id.raw_value)" height="40" width="40" class="oe_avatar oe_kanban_avatar_smallbox mb0" alt="Avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.id.raw_value)" height="40" width="40" class="oe_avatar oe_kanban_avatar_smallbox mb0" alt="Avatar"/>
<div class="o_kanban_record_headings ml8">
<strong class="o_kanban_record_title"><field name="name"/></strong>
</div>
diff --git a/addons/stock/data/stock_demo2.xml b/addons/stock/data/stock_demo2.xml
index 3ed916236e0..198d41714be 100644
--- a/addons/stock/data/stock_demo2.xml
+++ b/addons/stock/data/stock_demo2.xml
@@ -35,7 +35,7 @@
<field name="tracking">lot</field>
<field name="uom_id" ref="uom.product_uom_unit"/>
<field name="uom_po_id" ref="uom.product_uom_unit"/>
- <field name="image" type="base64" file="stock/static/img/cable_management.png"/>
+ <field name="image_1920" type="base64" file="stock/static/img/cable_management.png"/>
</record>
<record id="lot_product_cable_management" model="stock.production.lot">
diff --git a/addons/stock_landed_costs/views/stock_landed_cost_views.xml b/addons/stock_landed_costs/views/stock_landed_cost_views.xml
index fde86dfccdf..d30a98cd2b9 100644
--- a/addons/stock_landed_costs/views/stock_landed_cost_views.xml
+++ b/addons/stock_landed_costs/views/stock_landed_cost_views.xml
@@ -205,7 +205,7 @@
<form string="Landed Costs">
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
- <field name="image_medium" widget="image" class="oe_avatar"/>
+ <field name="image_128" widget="image" class="oe_avatar"/>
<div class="oe_title">
<div class="oe_edit_only">
<label for="name" name='label_name' string="Product Name"/>
diff --git a/addons/stock_picking_batch/views/stock_picking_batch_views.xml b/addons/stock_picking_batch/views/stock_picking_batch_views.xml
index 12d9c7a3fea..0c677a986f8 100644
--- a/addons/stock_picking_batch/views/stock_picking_batch_views.xml
+++ b/addons/stock_picking_batch/views/stock_picking_batch_views.xml
@@ -75,7 +75,7 @@
<div class="o_kanban_record_bottom">
<div class="oe_kanban_bottom_left"/>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_small', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.users', 'image_64', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/survey/views/survey_templates.xml b/addons/survey/views/survey_templates.xml
index 605fd56ef60..569da41c1c5 100644
--- a/addons/survey/views/survey_templates.xml
+++ b/addons/survey/views/survey_templates.xml
@@ -51,7 +51,7 @@
</div>
</div>
<div class="col-6 text-center" t-if="survey.certification_give_badge and answer.quizz_passed">
- <img t-att-src="'/web/image/gamification.badge/%s/image_medium' % survey.certification_badge_id.id"/>
+ <img t-att-src="'/web/image/gamification.badge/%s/image_128' % survey.certification_badge_id.id"/>
<div>You received the badge <span class="font-weight-bold" t-esc="survey.certification_badge_id.name"/>!</div>
</div>
</div>
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py
index 85f01e3c83d..11996d46ecc 100644
--- a/addons/web/controllers/main.py
+++ b/addons/web/controllers/main.py
@@ -1186,7 +1186,7 @@ class Binary(http.Controller):
'/web/partner_image/<int:rec_id>',
'/web/partner_image/<int:rec_id>/<string:field>',
'/web/partner_image/<int:rec_id>/<string:field>/<string:model>/'], type='http', auth="public")
- def content_image_partner(self, rec_id, field='image_small', model='res.partner', **kwargs):
+ def content_image_partner(self, rec_id, field='image_64', model='res.partner', **kwargs):
# other kwargs are ignored on purpose
return self._content_image(id=rec_id, model='res.partner', field=field,
placeholder='user_placeholder.jpg')
diff --git a/addons/web/static/src/js/chrome/user_menu.js b/addons/web/static/src/js/chrome/user_menu.js
index c2d19b7a879..3b93bbd9c3b 100644
--- a/addons/web/static/src/js/chrome/user_menu.js
+++ b/addons/web/static/src/js/chrome/user_menu.js
@@ -46,7 +46,7 @@ var UserMenu = Widget.extend({
self.$('.oe_topbar_name').text(topbar_name);
var avatar_src = session.url('/web/image', {
model:'res.users',
- field: 'image_small',
+ field: 'image_64',
id: session.uid,
});
$avatar.attr('src', avatar_src);
diff --git a/addons/web/static/src/js/fields/basic_fields.js b/addons/web/static/src/js/fields/basic_fields.js
index 322168a7241..dbafc45e592 100644
--- a/addons/web/static/src/js/fields/basic_fields.js
+++ b/addons/web/static/src/js/fields/basic_fields.js
@@ -1833,7 +1833,7 @@ var FieldBinaryImage = AbstractFieldBinary.extend({
this.$el.addClass(this.attrs.class);
}
- var urlThumb = this._getImageUrl(this.model, this.res_id, 'image_medium', unique);
+ var urlThumb = this._getImageUrl(this.model, this.res_id, 'image_128', unique);
this.$el.empty();
$img = this.$el;
diff --git a/addons/web/static/src/js/views/calendar/calendar_view.js b/addons/web/static/src/js/views/calendar/calendar_view.js
index 2ee927a4af0..af4a0baa2ec 100644
--- a/addons/web/static/src/js/views/calendar/calendar_view.js
+++ b/addons/web/static/src/js/views/calendar/calendar_view.js
@@ -103,7 +103,7 @@ var CalendarView = AbstractView.extend({
};
if (fields[fieldName].relation) {
if (['res.users', 'res.partner'].indexOf(fields[fieldName].relation) !== -1) {
- filters[fieldName].avatar_field = 'image_small';
+ filters[fieldName].avatar_field = 'image_64';
}
filters[fieldName].avatar_model = fields[fieldName].relation;
}
diff --git a/addons/web/tests/test_image.py b/addons/web/tests/test_image.py
index bf1bb06f8e6..454f237ce1d 100644
--- a/addons/web/tests/test_image.py
+++ b/addons/web/tests/test_image.py
@@ -20,17 +20,17 @@ class TestImage(HttpCase):
self.assertEqual(image.size, (150, 150))
# CASE: resize placeholder to small
- response = self.url_open('/web/image/fake/0/image_small')
+ response = self.url_open('/web/image/fake/0/image_64')
image = Image.open(io.BytesIO(response.content))
self.assertEqual(image.size, (64, 64))
# CASE: resize placeholder to medium
- response = self.url_open('/web/image/fake/0/image_medium')
+ response = self.url_open('/web/image/fake/0/image_128')
image = Image.open(io.BytesIO(response.content))
self.assertEqual(image.size, (128, 128))
# CASE: resize placeholder to large
- response = self.url_open('/web/image/fake/0/image_large')
+ response = self.url_open('/web/image/fake/0/image_256')
image = Image.open(io.BytesIO(response.content))
self.assertEqual(image.size, (256, 256))
diff --git a/addons/website_blog/models/website_blog.py b/addons/website_blog/models/website_blog.py
index 57a731e444b..6bf40b32f63 100644
--- a/addons/website_blog/models/website_blog.py
+++ b/addons/website_blog/models/website_blog.py
@@ -160,7 +160,7 @@ class BlogPost(models.Model):
create_uid = fields.Many2one('res.users', 'Created by', index=True, readonly=True)
write_date = fields.Datetime('Last Updated on', index=True, readonly=True)
write_uid = fields.Many2one('res.users', 'Last Contributor', index=True, readonly=True)
- author_avatar = fields.Binary(related='author_id.image_small', string="Avatar", readonly=False)
+ author_avatar = fields.Binary(related='author_id.image_64', string="Avatar", readonly=False)
visits = fields.Integer('No of Views', copy=False)
ranking = fields.Float(compute='_compute_ranking', string='Ranking')
diff --git a/addons/website_blog/views/website_blog_views.xml b/addons/website_blog/views/website_blog_views.xml
index 91c317c8f0b..7152b2c299b 100644
--- a/addons/website_blog/views/website_blog_views.xml
+++ b/addons/website_blog/views/website_blog_views.xml
@@ -143,7 +143,7 @@
<i class="fa fa-clock-o" role="img" aria-label="Post date" title="Post date"/><span t-esc="record.post_date.value"/>
</div>
<div class="col-4 text-right">
- <img t-att-src="kanban_image('res.partner', 'image_small', record.author_id.raw_value)" t-att-title="record.author_id.value" t-att-alt="record.author_id.value" width="24" height="24" class="oe_kanban_avatar"/>
+ <img t-att-src="kanban_image('res.partner', 'image_64', record.author_id.raw_value)" t-att-title="record.author_id.value" t-att-alt="record.author_id.value" width="24" height="24" class="oe_kanban_avatar"/>
</div>
</div>
</div>
diff --git a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
index 822678fa8d7..013944362fa 100644
--- a/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
+++ b/addons/website_crm_partner_assign/views/website_crm_partner_assign_templates.xml
@@ -82,7 +82,7 @@
</t>
<div class="media mt-3">
<a t-attf-href="/partners/#{slug(partner)}?#{current_grade and 'grade_id=%s&amp;' % current_grade.id}#{current_country and 'country_id=%s' % current_country.id}"
- t-field="partner.image_medium"
+ t-field="partner.image_128"
t-options='{"widget": "image", "class": "mr-3"}'
></a>
<div class="media-body o_partner_body" style="min-height: 64px;">
@@ -164,7 +164,7 @@
<t t-if="any([p.website_published for p in partner.implemented_partner_ids])">
<h3 id="references">References</h3>
<div t-foreach="partner.implemented_partner_ids" t-if="reference.website_published" t-as="reference" class="media mt-3">
- <span t-field="reference.image_medium" t-options='{"widget": "image", "class": "d-block mr-3"}'/>
+ <span t-field="reference.image_128" t-options='{"widget": "image", "class": "d-block mr-3"}'/>
<div class="media-body" style="min-height: 64px;">
<span t-field="reference.self"/>
<div t-field='reference.website_short_description'/>
diff --git a/addons/website_customer/views/website_customer_templates.xml b/addons/website_customer/views/website_customer_templates.xml
index 9cd668d901d..8a5c917c1d1 100644
--- a/addons/website_customer/views/website_customer_templates.xml
+++ b/addons/website_customer/views/website_customer_templates.xml
@@ -36,7 +36,7 @@
<t t-foreach="partners" t-as="partner">
<div class="media mt-3">
<a t-attf-href="/customers/#{slug(partner)}"
- t-field="partner.image_medium"
+ t-field="partner.image_128"
t-options='{"widget": "image", "class": "mr-3"}'
></a>
<div class="media-body" style="min-height: 64px;">
@@ -197,7 +197,7 @@
</a>
</h4>
<div><a t-attf-href="/partners/#{slug(partner.assigned_partner_id)}"
- t-field="partner.assigned_partner_id.image_medium"
+ t-field="partner.assigned_partner_id.image_128"
t-options='{"widget": "image", "class": "d-block mx-auto"}'
/>
</div>
@@ -218,7 +218,7 @@
<div t-foreach="partner.implemented_partner_ids" t-as="reference" class="media mt-3">
<t t-if="reference.website_published">
<a t-attf-href="/customers/#{slug(reference)}">
- <span t-field="reference.image_medium" t-options='{"widget": "image", "class": "d-block mr-3"}'/>
+ <span t-field="reference.image_128" t-options='{"widget": "image", "class": "d-block mr-3"}'/>
</a>
<div class="media-body" style="min-height: 64px;">
<a t-attf-href="/customers/#{slug(reference)}">
diff --git a/addons/website_event_track/models/event_track.py b/addons/website_event_track/models/event_track.py
index 6f0a72d31c6..b347d6ffb53 100644
--- a/addons/website_event_track/models/event_track.py
+++ b/addons/website_event_track/models/event_track.py
@@ -88,7 +88,7 @@ class Track(models.Model):
('0', 'Low'), ('1', 'Medium'),
('2', 'High'), ('3', 'Highest')],
'Priority', required=True, default='1')
- image = fields.Binary('Image', related='partner_id.image_medium', store=True, readonly=False)
+ image = fields.Binary('Image', related='partner_id.image_128', store=True, readonly=False)
@api.depends('name')
def _compute_website_url(self):
@@ -202,4 +202,4 @@ class Sponsor(models.Model):
partner_id = fields.Many2one('res.partner', 'Sponsor/Customer', required=True)
url = fields.Char('Sponsor Website')
sequence = fields.Integer('Sequence', store=True, related='sponsor_type_id.sequence', readonly=False)
- image_medium = fields.Binary(string='Logo', related='partner_id.image_medium', store=True, readonly=False)
+ image_128 = fields.Binary(string='Logo', related='partner_id.image_128', store=True, readonly=False)
diff --git a/addons/website_event_track/views/event_track_templates.xml b/addons/website_event_track/views/event_track_templates.xml
index 6e55bb1c0b2..cf924566f1f 100644
--- a/addons/website_event_track/views/event_track_templates.xml
+++ b/addons/website_event_track/views/event_track_templates.xml
@@ -18,7 +18,7 @@
<div t-attf-class="col-sm-6 col-lg-#{(len(event.sponsor_ids) > 6) and 2 or (12 // len(event.sponsor_ids))} text-center mb16 oe_sponsor" t-foreach="event.sponsor_ids" t-as="sponsor">
<t t-if="sponsor.url">
<a t-att-href="sponsor.url" style="position: relative; display: inline-block;" class="bg-white">
- <span t-field="sponsor.image_medium"
+ <span t-field="sponsor.image_128"
t-options='{"widget": "image", "class": "shadow"}'/>
<div class="ribbon-wrapper">
<div t-field="sponsor.sponsor_type_id" t-attf-class="ribbon ribbon_#{sponsor.sponsor_type_id.name}"/>
@@ -27,7 +27,7 @@
</t>
<t t-if="not sponsor.url">
<span style="position: relative; display: inline-block;" class="bg-white">
- <span t-field="sponsor.image_medium"
+ <span t-field="sponsor.image_128"
t-options='{"widget": "image", "class": "shadow"}'/>
<div class="ribbon-wrapper">
<div t-field="sponsor.sponsor_type_id" t-attf-class="ribbon ribbon_#{sponsor.sponsor_type_id.name}"/>
@@ -242,7 +242,7 @@
<div t-if="track.partner_id" class="mt32">
<div class="row">
<div class="col-md-2">
- <span t-field="track.partner_id.sudo().image_medium"
+ <span t-field="track.partner_id.sudo().image_128"
t-options='{"widget": "image", "class": "rounded-circle"}'/>
</div><div class="col-md-10">
<h4 t-field="track.partner_id.name" class="mb4"/>
diff --git a/addons/website_event_track/views/event_track_views.xml b/addons/website_event_track/views/event_track_views.xml
index 5ec6624b0c7..599d304d4e6 100644
--- a/addons/website_event_track/views/event_track_views.xml
+++ b/addons/website_event_track/views/event_track_views.xml
@@ -44,7 +44,7 @@
</div>
<div class="oe_kanban_bottom_right">
<field name="kanban_state" widget="state_selection" groups="base.group_user"/>
- <img t-att-src="kanban_image('res.partner', 'image_small', record.partner_id.raw_value)"
+ <img t-att-src="kanban_image('res.partner', 'image_64', record.partner_id.raw_value)"
t-att-title="record.partner_id.value" t-att-alt="record.partner_id.value" width="24" height="24"
class="oe_kanban_avatar"/>
</div>
diff --git a/addons/website_forum/views/forum.xml b/addons/website_forum/views/forum.xml
index ff8ad6c2256..1c46079b518 100644
--- a/addons/website_forum/views/forum.xml
+++ b/addons/website_forum/views/forum.xml
@@ -29,7 +29,7 @@
<form string="Forum">
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
- <field name="image" widget="image" options="{'preview_image': 'image_medium'}" class="oe_avatar"/>
+ <field name="image_1920" widget="image" options="{'preview_image': 'image_128'}" class="oe_avatar"/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1>
diff --git a/addons/website_forum/views/website_forum.xml b/addons/website_forum/views/website_forum.xml
index f971c068f8e..e5737e037d1 100644
--- a/addons/website_forum/views/website_forum.xml
+++ b/addons/website_forum/views/website_forum.xml
@@ -73,7 +73,7 @@
<div class="card bg-secondary" t-if="question">
<h6 class="card-header"><b>Writer</b></h6>
<div class="card-body o_card_people">
- <img class="o_wforum_people_photo_container d-block mx-auto mb-3" t-attf-src="/web/image/res.users/#{question.create_uid.id}/image_medium"/>
+ <img class="o_wforum_people_photo_container d-block mx-auto mb-3" t-attf-src="/web/image/res.users/#{question.create_uid.id}/image_128"/>
<h6 class="text-center">
<b><i class="fa fa-diamond text-secondary"/> <t t-esc="question.create_uid.sudo().karma"/></b>
<b><a t-attf-href="/forum/#{slug(forum)}/user/#{question.create_uid.sudo().id}" t-field="question.create_uid" t-options='{"widget": "contact", "fields": ["name", "country_id"]}'/></b>
@@ -397,9 +397,9 @@
<h1 class="card-header h6 font-weight-bold bg-white"
t-field="forum.name"/>
<div class="card-img-bottom embed-responsive embed-responsive-16by9 o_wforum_forum_card_bg">
- <div t-if="forum.image"
+ <div t-if="forum.image_256"
class="oe_img_bg embed-responsive-item"
- t-attf-style="background-image: url(/web/image/forum.forum/#{forum.id}/image_large); background-position: center;"/>
+ t-attf-style="background-image: url(/web/image/forum.forum/#{forum.id}/image_256); background-position: center;"/>
</div>
</div>
</a>
@@ -913,7 +913,7 @@
<t t-call="website_forum.forum_user_tooltip"/>
</div>
<a t-att-href="user_profile_url" class="o_forum_user_info">
- <img class="float-left o_forum_avatar" t-attf-src="/web/image/res.users/#{answer.create_uid.id}/image_medium" alt="Avatar"/>
+ <img class="float-left o_forum_avatar" t-attf-src="/web/image/res.users/#{answer.create_uid.id}/image_128" alt="Avatar"/>
</a>
<a t-att-href="user_profile_url"
t-field="answer.create_uid"
@@ -969,7 +969,7 @@
<div class="o_forum_user_bio text-left card">
<div class="card-body">
<a t-att-href="user_profile_url">
- <img class="float-left img rounded o_forum_avatar_big" t-attf-src="/web/image/res.users/#{answer.create_uid.id}/image_medium" alt="Avatar"/>
+ <img class="float-left img rounded o_forum_avatar_big" t-attf-src="/web/image/res.users/#{answer.create_uid.id}/image_128" alt="Avatar"/>
</a>
<div class="o_forum_tooltip_header">
<h4 class="o_forum_tooltip_heading"><a t-att-href="user_profile_url"
@@ -1126,7 +1126,7 @@
<input type="checkbox" t-att-value="user.id" class="custom-control-input" t-attf-id="user_#{user.id}"/>
<label class="custom-control-label" t-attf-for="user_#{user.id}">
<div class="col-11 d-inline-flex">
- <img class="d-inline img o_forum_avatar" t-attf-src="/web/image/res.users/#{user.id}/image_medium" alt="Avatar"/>
+ <img class="d-inline img o_forum_avatar" t-attf-src="/web/image/res.users/#{user.id}/image_128" alt="Avatar"/>
<b t-esc="user.name" class="d-inline"></b>
</div>
</label>
diff --git a/addons/website_hr_recruitment/views/website_hr_recruitment_templates.xml b/addons/website_hr_recruitment/views/website_hr_recruitment_templates.xml
index dd2b6504ea7..c25a60b78f8 100644
--- a/addons/website_hr_recruitment/views/website_hr_recruitment_templates.xml
+++ b/addons/website_hr_recruitment/views/website_hr_recruitment_templates.xml
@@ -424,7 +424,7 @@
<h3 class="mb32 text-center">Your application has been sent to:</h3>
</div>
<div class="col-lg-1 offset-lg-4">
- <p t-field="responsible.image_small" t-options="{'widget': 'image', 'class': 'rounded-circle d-block mx-auto'}"/>
+ <p t-field="responsible.image_64" t-options="{'widget': 'image', 'class': 'rounded-circle d-block mx-auto'}"/>
</div>
<div class="col-lg-5 o_responsible_data">
<h4 class="mt0" t-field="responsible.name"/>
diff --git a/addons/website_livechat/views/website_livechat.xml b/addons/website_livechat/views/website_livechat.xml
index 2cc0dc35f6f..75e884bdcf1 100644
--- a/addons/website_livechat/views/website_livechat.xml
+++ b/addons/website_livechat/views/website_livechat.xml
@@ -146,13 +146,13 @@
<h3>The Team</h3>
<t t-foreach="team" t-as="user">
<div class="media mt-3">
- <t t-if="user.image_small">
+ <t t-if="user.image_64">
<t t-if="user.livechat_username">
- <img t-att-src="user.image_small and image_data_uri(user.image_small) or '/web/static/src/img/placeholder.png'"
+ <img t-att-src="user.image_64 and image_data_uri(user.image_64) or '/web/static/src/img/placeholder.png'"
class="rounded o_livechat_operator_avatar" t-att-alt="user.livechat_username"/>
</t>
<t t-else="">
- <img t-att-src="user.image_small and image_data_uri(user.image_small) or '/web/static/src/img/placeholder.png'"
+ <img t-att-src="user.image_64 and image_data_uri(user.image_64) or '/web/static/src/img/placeholder.png'"
class="rounded o_livechat_operator_avatar" t-att-alt="user.name"/>
</t>
</t>
@@ -214,7 +214,7 @@
<t t-foreach="channels" t-as="channel">
<div t-attf-class="media#{' mt-3' if channel_index else ''}">
<a t-attf-href="/livechat/channel/#{ slug(channel)}">
- <img t-att-src="channel.image_small and image_data_uri(channel.image_small) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
+ <img t-att-src="channel.image_64 and image_data_uri(channel.image_64) or '/web/static/src/img/placeholder.png'" t-att-alt="channel.name" />
</a>
<div class="media-body">
<h4><t t-esc="channel.name"/></h4>
diff --git a/addons/website_mail_channel/views/website_mail_channel_templates.xml b/addons/website_mail_channel/views/website_mail_channel_templates.xml
index 7b439bb0b91..d2b6e82a4c9 100644
--- a/addons/website_mail_channel/views/website_mail_channel_templates.xml
+++ b/addons/website_mail_channel/views/website_mail_channel_templates.xml
@@ -33,7 +33,7 @@
</div>
<div class="row mt8" t-foreach="groups" t-as="group">
<div class="col-lg-3">
- <img t-att-src="website.image_url(group, 'image_small')" class="float-left" alt="Group"/>
+ <img t-att-src="website.image_url(group, 'image_64')" class="float-left" alt="Group"/>
<strong><a t-attf-href="/groups/#{ slug(group) }" t-esc="group.name"/></strong><br />
<t t-if="group.alias_id and group.alias_id.alias_name and group.alias_id.alias_domain">
<i class='fa fa-envelope-o' role="img" aria-label="Alias" title="Alias"/>
diff --git a/addons/website_membership/views/website_membership_templates.xml b/addons/website_membership/views/website_membership_templates.xml
index 8939d1adf98..3ff095b3123 100644
--- a/addons/website_membership/views/website_membership_templates.xml
+++ b/addons/website_membership/views/website_membership_templates.xml
@@ -54,7 +54,7 @@
<t t-set="partner" t-value="partners[partner_id]"/>
<div class="media mt-3">
<a t-attf-href="/members/#{slug(partner)}"
- t-field="partner.image_small"
+ t-field="partner.image_64"
t-options='{"widget": "image", "class": "media-object mr-3"}'
></a>
<div class="media-body" style="min-height: 64px;">
diff --git a/addons/website_profile/controllers/main.py b/addons/website_profile/controllers/main.py
index 9dcc345cb0a..e11d68fa835 100644
--- a/addons/website_profile/controllers/main.py
+++ b/addons/website_profile/controllers/main.py
@@ -72,8 +72,8 @@ class WebsiteProfile(http.Controller):
@http.route([
'/profile/avatar/<int:user_id>',
], type='http', auth="public", website=True, sitemap=False)
- def get_user_profile_avatar(self, user_id, field='image_large', width=0, height=0, crop=False, **post):
- if field not in ('image_small', 'image_medium', 'image_large'):
+ def get_user_profile_avatar(self, user_id, field='image_256', width=0, height=0, crop=False, **post):
+ if field not in ('image_64', 'image_128', 'image_256'):
return werkzeug.exceptions.Forbidden()
can_sudo = self._check_avatar_access(user_id, **post)
diff --git a/addons/website_profile/views/website_profile.xml b/addons/website_profile/views/website_profile.xml
index e30e6ee6593..1a06cdee7a9 100644
--- a/addons/website_profile/views/website_profile.xml
+++ b/addons/website_profile/views/website_profile.xml
@@ -104,7 +104,7 @@
<div class="col-3">
<div class="card o_card_people">
<div class="card-body">
- <img class="o_forum_avatar_img w-100 mb-3" t-attf-src="/web/image/res.users/#{user.id}/image_medium"/>
+ <img class="o_forum_avatar_img w-100 mb-3" t-attf-src="/web/image/res.users/#{user.id}/image_128"/>
<div class="text-center">
<a href="#" class="o_forum_profile_pic_edit btn btn-primary" aria-label="Edit">
<i class="fa fa-pencil fa-1g float-sm-none float-md-left" title="Edit"></i>
@@ -252,7 +252,7 @@
<div class="o_wprofile_sidebar_top d-flex justify-content-between">
<div t-if="user.rank_id" class="d-flex align-items-center">
<small class="font-weight-bold mr-2">Current rank:</small>
- <img t-attf-src="/web/image/gamification.karma.rank/#{user.rank_id.id}/image_small" height="16" alt="" class="mr-1"/>
+ <img t-attf-src="/web/image/gamification.karma.rank/#{user.rank_id.id}/image_64" height="16" alt="" class="mr-1"/>
<a href="/profile/ranks_badges" t-field="user.rank_id"/>
</div>
<button class="btn btn-sm d-md-none bg-white border" type="button" data-toggle="collapse" data-target="#o_wprofile_sidebar_collapse" aria-expanded="false" aria-controls="o_wprofile_sidebar_collapse">More info</button>
@@ -341,7 +341,7 @@
</svg>
<div class="o_pc_overlay d-flex flex-column align-items-center justify-content-center">
<img class="img-fluid"
- t-attf-src="/web/image/gamification.karma.rank/#{next_rank_id.id if next_rank_id else user.rank_id.id}/image_medium"
+ t-attf-src="/web/image/gamification.karma.rank/#{next_rank_id.id if next_rank_id else user.rank_id.id}/image_128"
t-att-alt="(next_rank_id.name if next_rank_id else user.rank_id.name) + ' badge'"
t-att-style="'max-width: ' + (img_max_width if img_max_width else '50%;')"/>
<h4 class=" mb-0">
@@ -367,7 +367,7 @@
<div class="card">
<div class="card-body p-2 pr-3">
<div class="media align-items-center">
- <img height="38" t-attf-src="/web/image/gamification.badge/#{badge.badge_id.id}/image_small" class="mr-0"/>
+ <img height="38" t-attf-src="/web/image/gamification.badge/#{badge.badge_id.id}/image_64" class="mr-0"/>
<div class="media-body col-md-10 p-0">
<h6 class="my-0 text-truncate" t-field="badge.badge_id.name"/>
</div>
@@ -512,7 +512,7 @@
<div class="card text-center mb-2 border-bottom-0 o_wprofile_pointer">
<div class="card-body">
<div class="d-inline-block position-relative">
- <img class="rounded-circle img-fluid" t-att-src="'/profile/avatar/%s?field=image_medium%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
+ <img class="rounded-circle img-fluid" t-att-src="'/profile/avatar/%s?field=image_128%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
<img class="position-absolute" t-attf-src="/website_profile/static/src/img/rank_#{user_index + 1}.svg" alt="User rank" style="bottom: 0; right: -10px"/>
</div>
<h3 class="mt-2 mb-0" t-esc="user['name']"></h3>
@@ -531,7 +531,7 @@
<span t-esc="user['position']"/>
</td>
<td class="align-middle d-none d-sm-table-cell">
- <img class="rounded-circle o_wprofile_img_small" height="30" t-att-src="'/profile/avatar/%s?field=image_medium%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
+ <img class="rounded-circle o_wprofile_img_small" height="30" t-att-src="'/profile/avatar/%s?field=image_128%s' % (user['id'], '&amp;res_model=%s&amp;res_id=%s' % (record._name, record.id) if record else '')"/>
</td>
<td class="align-middle w-md-75">
<span class="font-weight-bold" t-esc="user['name']"/><br/>
diff --git a/addons/website_sale/data/mail_template_data.xml b/addons/website_sale/data/mail_template_data.xml
index 18a1bb70a51..32d57e03bba 100644
--- a/addons/website_sale/data/mail_template_data.xml
+++ b/addons/website_sale/data/mail_template_data.xml
@@ -43,7 +43,7 @@
<table width="100%">
<tr>
<td style="padding: 10px; width:150px;">
- <img src="/web/image/product.product/${line.product_id.id}/image_medium" height="100px" width="100px" alt="Product image"></img>
+ <img src="/web/image/product.product/${line.product_id.id}/image_128" height="100px" width="100px" alt="Product image"></img>
</td>
<td>
<strong>${line.product_id.display_name}</strong><br/>${line.name}
diff --git a/addons/website_sale/models/product.py b/addons/website_sale/models/product.py
index 056cbce0541..644457566a7 100644
--- a/addons/website_sale/models/product.py
+++ b/addons/website_sale/models/product.py
@@ -155,11 +155,11 @@ class ProductPublicCategory(models.Model):
# In this case, the default image is set by the js code.
image = fields.Binary(help="This field holds the image used as image for the category, limited to 1024x1024px.")
website_description = fields.Html('Category Description', sanitize_attributes=False, translate=html_translate)
- image_medium = fields.Binary(string='Medium-sized image',
+ 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_small = fields.Binary(string='Small-sized image',
+ 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.")
@@ -383,7 +383,7 @@ class ProductTemplate(models.Model):
res = super(ProductTemplate, self)._default_website_meta()
res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = self.description_sale
res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name
- res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/product.template/%s/image" % (self.id)
+ res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/product.template/%s/image_1024" % (self.id)
res['default_meta_description'] = self.description_sale
return res
@@ -457,7 +457,7 @@ class Product(models.Model):
"""
self.ensure_one()
variant_images = list(self.product_variant_image_ids)
- if self.image_raw_original:
+ if self.image_variant_max:
# if the main variant image is set, display it first
variant_images = [self] + variant_images
else:
diff --git a/addons/website_sale/models/product_image.py b/addons/website_sale/models/product_image.py
index e991343b55d..eafb03b9ace 100644
--- a/addons/website_sale/models/product_image.py
+++ b/addons/website_sale/models/product_image.py
@@ -16,7 +16,7 @@ class ProductImage(models.Model):
name = fields.Char("Name", required=True)
sequence = fields.Integer(default=10, index=True)
- image_original = fields.Binary(required=True)
+ image_1920 = fields.Image(required=True)
product_tmpl_id = fields.Many2one('product.template', "Product Template", index=True, ondelete='cascade')
product_variant_id = fields.Many2one('product.product', "Product Variant", index=True, ondelete='cascade')
diff --git a/addons/website_sale/static/src/js/website_sale.js b/addons/website_sale/static/src/js/website_sale.js
index 85ef87d0e08..08c7f8775cf 100644
--- a/addons/website_sale/static/src/js/website_sale.js
+++ b/addons/website_sale/static/src/js/website_sale.js
@@ -440,7 +440,7 @@ publicWidget.registry.WebsiteSale = publicWidget.Widget.extend(VariantMixin, {
else { // compatibility 12.0
var model = productId ? 'product.product' : 'product.template';
var modelId = productId || productTemplateId;
- var imageSrc = '/web/image/{0}/{1}/image'
+ var imageSrc = '/web/image/{0}/{1}/image_1024'
.replace("{0}", model)
.replace("{1}", modelId);
@@ -451,7 +451,7 @@ publicWidget.registry.WebsiteSale = publicWidget.Widget.extend(VariantMixin, {
var $thumbnail = $productContainer.find('img.js_variant_img_small');
if ($thumbnail.length !== 0) { // if only one, thumbnails are not displayed
- $thumbnail.attr("src", "/web/image/{0}/{1}/image/90x90"
+ $thumbnail.attr("src", "/web/image/{0}/{1}/image_128/90x90"
.replace('{0}', model)
.replace('{1}', modelId));
$('.carousel').carousel(0);
diff --git a/addons/website_sale/static/src/scss/website_sale_frontend.scss b/addons/website_sale/static/src/scss/website_sale_frontend.scss
index 6993c1e2fa8..c0932d95425 100644
--- a/addons/website_sale/static/src/scss/website_sale_frontend.scss
+++ b/addons/website_sale/static/src/scss/website_sale_frontend.scss
@@ -140,6 +140,6 @@ $o-wsale-wizard-label-completed: $success;
}
table.js_cart_lines .td-img img {
- // allows sizing the placeholder image to the "image_small" size of 64px
+ // allows sizing the placeholder image to the "image_64" size of 64px
max-height: 64px;
} \ No newline at end of file
diff --git a/addons/website_sale/static/src/xml/website_sale_utils.xml b/addons/website_sale/static/src/xml/website_sale_utils.xml
index 0c470a0d58d..000f7118519 100644
--- a/addons/website_sale/static/src/xml/website_sale_utils.xml
+++ b/addons/website_sale/static/src/xml/website_sale_utils.xml
@@ -11,7 +11,7 @@
t-att-href="product['website_url']" class="dropdown-item p-2 text-wrap">
<div class="media align-items-center o_search_product_item">
<t t-if="widget.displayImage">
- <img t-attf-src="/web/image/product.template/#{product['id']}/image_small"
+ <img t-attf-src="/web/image/product.template/#{product['id']}/image_64"
class="flex-shrink-0"/>
</t>
<div class="media-body px-3">
diff --git a/addons/website_sale/tests/test_website_sale_image.py b/addons/website_sale/tests/test_website_sale_image.py
index 3577844e90d..8b8b233ea99 100644
--- a/addons/website_sale/tests/test_website_sale_image.py
+++ b/addons/website_sale/tests/test_website_sale_image.py
@@ -89,7 +89,7 @@ class TestWebsiteSaleImage(odoo.tests.HttpCase):
# create the template, without creating the variants
template = self.env['product.template'].with_context(create_product_product=True).create({
'name': 'A Colorful Image',
- 'product_template_image_ids': [(0, 0, {'name': 'image 1', 'image': image_gif}), (0, 0, {'name': 'image 4', 'image': image_svg})],
+ 'product_template_image_ids': [(0, 0, {'name': 'image 1', 'image_1920': image_gif}), (0, 0, {'name': 'image 4', 'image_1920': image_svg})],
})
# set the color attribute and values on the template
@@ -112,26 +112,26 @@ class TestWebsiteSaleImage(odoo.tests.HttpCase):
# because the template image is empty and there is only one variant)
product_red = self.env['product.product'].create({
'product_tmpl_id': template.id,
- 'image': blue_image,
+ 'image_1920': blue_image,
'attribute_value_ids': [(6, 0, attr_values.filtered(lambda l: l.name == name_red).ids)],
- 'product_variant_image_ids': [(0, 0, {'name': 'image 2', 'image': image_bmp})],
+ 'product_variant_image_ids': [(0, 0, {'name': 'image 2', 'image_1920': image_bmp})],
})
- self.assertEqual(template.image_original, blue_image)
+ self.assertEqual(template.image_1920, blue_image)
# create the green variant
product_green = self.env['product.product'].create({
- 'image': green_image,
+ 'image_1920': green_image,
'product_tmpl_id': template.id,
'attribute_value_ids': [(6, 0, attr_values.filtered(lambda l: l.name == name_green).ids)],
- 'product_variant_image_ids': [(0, 0, {'name': 'image 3', 'image': image_png})],
+ 'product_variant_image_ids': [(0, 0, {'name': 'image 3', 'image_1920': image_png})],
})
# now set the red image on the first variant, that works because
# template image is not empty anymore and we have a second variant
- product_red.image = red_image
+ product_red.image_1920 = red_image
- # Verify image_original size > 1024 can be zoomed
+ # Verify image_1920 size > 1024 can be zoomed
self.assertTrue(template.can_image_be_zoomed)
self.assertFalse(template.product_template_image_ids[0].can_image_be_zoomed)
self.assertFalse(template.product_template_image_ids[1].can_image_be_zoomed)
@@ -146,62 +146,68 @@ class TestWebsiteSaleImage(odoo.tests.HttpCase):
jpeg_green = (34, 139, 34)
# Verify original size: keep original
- image = Image.open(io.BytesIO(base64.b64decode(template.image_original)))
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_1920)))
self.assertEqual(image.size, (1920, 1080))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
- image = Image.open(io.BytesIO(base64.b64decode(product_red.image_original)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_1920)))
self.assertEqual(image.size, (800, 500))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
- image = Image.open(io.BytesIO(base64.b64decode(product_green.image_original)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_1920)))
self.assertEqual(image.size, (1920, 1080))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
- # Verify big size: keep aspect ratio
- image = Image.open(io.BytesIO(base64.b64decode(template.image_big)))
+ # Verify 1024 size: keep aspect ratio
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_1024)))
self.assertEqual(image.size, (1024, 576))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
- image = Image.open(io.BytesIO(base64.b64decode(product_red.image_big)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_1024)))
self.assertEqual(image.size, (800, 500))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
- image = Image.open(io.BytesIO(base64.b64decode(product_green.image_big)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_1024)))
self.assertEqual(image.size, (1024, 576))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
- # Verify image == image_big
- self.assertEqual(template.image_big, template.image)
- self.assertEqual(product_red.image_big, product_red.image)
- self.assertEqual(product_green.image_big, product_green.image)
+ # Verify 512 size: keep aspect ratio
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_512)))
+ self.assertEqual(image.size, (512, 288))
+ self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_512)))
+ self.assertEqual(image.size, (512, 320))
+ self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_512)))
+ self.assertEqual(image.size, (512, 288))
+ self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
- # Verify large size: keep aspect ratio
- image = Image.open(io.BytesIO(base64.b64decode(template.image_large)))
+ # Verify 256 size: keep aspect ratio
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_256)))
self.assertEqual(image.size, (256, 144))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
- image = Image.open(io.BytesIO(base64.b64decode(product_red.image_large)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_256)))
self.assertEqual(image.size, (256, 160))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
- image = Image.open(io.BytesIO(base64.b64decode(product_green.image_large)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_256)))
self.assertEqual(image.size, (256, 144))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
- # Verify medium size: keep aspect ratio
- image = Image.open(io.BytesIO(base64.b64decode(template.image_medium)))
+ # Verify 128 size: keep aspect ratio
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_128)))
self.assertEqual(image.size, (128, 72))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
- image = Image.open(io.BytesIO(base64.b64decode(product_red.image_medium)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_128)))
self.assertEqual(image.size, (128, 80))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
- image = Image.open(io.BytesIO(base64.b64decode(product_green.image_medium)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_128)))
self.assertEqual(image.size, (128, 72))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
- # Verify small size: keep aspect ratio
- image = Image.open(io.BytesIO(base64.b64decode(template.image_small)))
+ # Verify 64 size: keep aspect ratio
+ image = Image.open(io.BytesIO(base64.b64decode(template.image_64)))
self.assertEqual(image.size, (64, 36))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_blue, "blue")
- image = Image.open(io.BytesIO(base64.b64decode(product_red.image_small)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_red.image_64)))
self.assertEqual(image.size, (64, 40))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_red, "red")
- image = Image.open(io.BytesIO(base64.b64decode(product_green.image_small)))
+ image = Image.open(io.BytesIO(base64.b64decode(product_green.image_64)))
self.assertEqual(image.size, (64, 36))
self.assertEqual(image.getpixel((image.size[0] / 2, image.size[1] / 2)), jpeg_green, "green")
@@ -210,25 +216,27 @@ class TestWebsiteSaleImage(odoo.tests.HttpCase):
self.start_tour("/", 'shop_zoom', login="admin")
# CASE: unlink move image to fallback if fallback image empty
- template.image = False
+ template.image_1920 = False
product_red.unlink()
- self.assertEqual(template.image_original, red_image)
+ self.assertEqual(template.image_1920, red_image)
# CASE: unlink does nothing special if fallback image already set
self.env['product.product'].create({
'product_tmpl_id': template.id,
- 'image': green_image,
+ 'image_1920': green_image,
}).unlink()
- self.assertEqual(template.image_original, red_image)
+ self.assertEqual(template.image_1920, red_image)
# CASE: display variant image first if set
- self.assertEqual(product_green._get_images()[0].image_original, green_image)
+ self.assertEqual(product_green._get_images()[0].image_1920, green_image)
# CASE: display variant fallback after variant o2m, correct fallback
- # write on the raw field, otherwise it will write on the fallback here
- product_green.image_raw_original = False
+ # write on the variant field, otherwise it will write on the fallback
+ product_green.image_variant_max = False
images = product_green._get_images()
- self.assertEqual(images[0].image_original, image_png)
- self.assertEqual(images[1].image_original, red_image)
- self.assertEqual(images[2].image_original, image_gif)
- self.assertEqual(images[3].image_original, image_svg)
+ # images on fields are resized to max 1920
+ image = Image.open(io.BytesIO(base64.b64decode(images[0].image_1920)))
+ self.assertEqual(image.size, (1268, 1920))
+ self.assertEqual(images[1].image_1920, red_image)
+ self.assertEqual(images[2].image_1920, image_gif)
+ self.assertEqual(images[3].image_1920, image_svg)
diff --git a/addons/website_sale/views/product_views.xml b/addons/website_sale/views/product_views.xml
index 25a1aa61181..373ea27bde5 100644
--- a/addons/website_sale/views/product_views.xml
+++ b/addons/website_sale/views/product_views.xml
@@ -145,7 +145,7 @@
<field name="arch" type="xml">
<form string="Website Public Categories">
<sheet>
- <field name="image_medium" widget='image' class="oe_avatar"/>
+ <field name="image_128" widget='image' class="oe_avatar"/>
<div class="oe_left">
<group>
<field name="name"/>
@@ -227,7 +227,7 @@
<div class="col-md-6 col-xl-7 text-center o_website_sale_image_modal_container">
<div class="row">
<div class="col">
- <field name="image_original" widget="image"/>
+ <field name="image_1920" widget="image"/>
</div>
<div class="col" attrs="{'invisible': [('video_url', 'in', ['', False])]}">
<div class="o_video_container p-2">
@@ -251,13 +251,13 @@
<kanban string="Product Images" default_order="sequence">
<field name="id"/>
<field name="name"/>
- <field name="image_original"/>
+ <field name="image_1920"/>
<field name="sequence" widget="handle"/>
<templates>
<t t-name="kanban-box">
<div class="card oe_kanban_global_click p-0">
<div class="o_squared_image">
- <img class="card-img-top" t-att-src="kanban_image('product.image', 'image_original', record.id.value)" t-att-alt="record.name.value"/>
+ <img class="card-img-top" t-att-src="kanban_image('product.image', 'image_1920', record.id.value)" t-att-alt="record.name.value"/>
</div>
<div class="card-body p-0">
<h4 class="card-title p-2 m-0 bg-200">
@@ -265,12 +265,12 @@
</h4>
</div>
<!-- below 100 Kb: good -->
- <t t-if="record.image_original.raw_value.length &lt; 100*1000">
+ <t t-if="record.image_1920.raw_value.length &lt; 100*1000">
<t t-set="size_status" t-value="'badge-success'"/>
<t t-set="message">Acceptable file size</t>
</t>
<!-- below 1000 Kb: decent -->
- <t t-elif="record.image_original.raw_value.length &lt; 1000*1000">
+ <t t-elif="record.image_1920.raw_value.length &lt; 1000*1000">
<t t-set="size_status" t-value="'badge-warning'" />
<t t-set="message">Huge file size. The image should be optimized/reduced.</t>
</t>
@@ -279,7 +279,7 @@
<t t-set="size_status" t-value="'badge-danger'"/>
<t t-set="message">Optimization required! Reduce the image size or increase your compression settings.</t>
</t>
- <span t-attf-class="badge #{size_status} o_product_image_size" t-esc="record.image_original.value" t-att-title="message"/>
+ <span t-attf-class="badge #{size_status} o_product_image_size" t-esc="record.image_1920.value" t-att-title="message"/>
</div>
</t>
</templates>
diff --git a/addons/website_sale/views/templates.xml b/addons/website_sale/views/templates.xml
index ca4a23d6418..f1fffe54dbe 100644
--- a/addons/website_sale/views/templates.xml
+++ b/addons/website_sale/views/templates.xml
@@ -145,8 +145,8 @@
<a href="#" role="button" class="ribbon btn btn-danger">Sale</a>
</div>
<a t-att-href="product_href" class="d-block h-100" itemprop="url">
- <span t-field="product.image"
- t-options="{'widget': 'image', 'preview_image': 'image' if product_image_big else 'image_large'}"
+ <span t-field="product.image_1920"
+ t-options="{'widget': 'image', 'preview_image': 'image_1024' if product_image_big else 'image_256'}"
class="d-flex h-100 justify-content-center align-items-center"/>
</a>
</div>
@@ -573,8 +573,8 @@
<div class="mt16 text-center" style="height: 100%;">
<t t-set="combination_info" t-value="alt_product._get_combination_info()"/>
<t t-set="product_variant" t-value="alt_product.env['product.product'].browse(combination_info['product_id'])"/>
- <div t-if="product_variant" t-field="product_variant.image_small" t-options="{'widget': 'image', 'class': 'rounded shadow o_alternative_product' }" />
- <div t-else="" t-field="alt_product.image_small" t-options="{'widget': 'image', 'class': 'rounded shadow o_alternative_product' }" />
+ <div t-if="product_variant" t-field="product_variant.image_64" t-options="{'widget': 'image', 'class': 'rounded shadow o_alternative_product' }" />
+ <div t-else="" t-field="alt_product.image_64" t-options="{'widget': 'image', 'class': 'rounded shadow o_alternative_product' }" />
<h6>
<a t-attf-href="/shop/product/#{ slug(alt_product) }" style="display: block">
<span t-att-title="alt_product.name" t-field="alt_product.name" class="o_text_overflow" style="display: block;" />
@@ -837,7 +837,7 @@
<tr t-att-class="'optional_product info' if line.linked_line_id else None">
<td colspan="2" t-if="not line.product_id.product_tmpl_id" class='td-img'></td>
<td align="center" t-if="line.product_id.product_tmpl_id" class='td-img'>
- <span t-field="line.product_id.image_small" t-options="{'widget': 'image', 'class': 'rounded'}" />
+ <span t-field="line.product_id.image_64" t-options="{'widget': 'image', 'class': 'rounded'}" />
</td>
<td t-if="line.product_id.product_tmpl_id" class='td-product_name'>
<div>
@@ -961,7 +961,7 @@
<t t-foreach="website_sale_order.website_order_line" t-as="line">
<div class="row mb8 cart_line">
<div class="col-3 text-center">
- <span t-field="line.product_id.image_small" t-options="{'widget': 'image', 'class': 'rounded'}" />
+ <span t-field="line.product_id.image_64" t-options="{'widget': 'image', 'class': 'rounded'}" />
</div>
<div class="col-9">
<div>
@@ -995,7 +995,7 @@
<t t-set="combination_info" t-value="product._get_combination_info_variant()"/>
<td class='td-img'>
<a t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
- <span t-field="product.image_small" t-options="{'widget': 'image', 'class': 'rounded'}" />
+ <span t-field="product.image_64" t-options="{'widget': 'image', 'class': 'rounded'}" />
</a>
</td>
<td class='td-product_name'>
@@ -1442,7 +1442,7 @@
<tr t-foreach="website_sale_order.website_order_line" t-as="line">
<td class='' colspan="2" t-if="not line.product_id.product_tmpl_id"></td>
<td class='td-img text-center' t-if="line.product_id.product_tmpl_id">
- <span t-field="line.product_id.image_small" t-options="{'widget': 'image', 'class': 'rounded'}" />
+ <span t-field="line.product_id.image_64" t-options="{'widget': 'image', 'class': 'rounded'}" />
</td>
<td class='td-product_name' t-if="line.product_id.product_tmpl_id">
<div>
@@ -1724,7 +1724,7 @@
<div t-if="product_image._name == 'product.image' and product_image.embed_code" class="d-flex align-items-center justify-content-center h-100 embed-responsive embed-responsive-16by9">
<t t-raw="product_image.embed_code"/>
</div>
- <div t-else="" t-field="product_image.image" class="d-flex align-items-center justify-content-center h-100" t-options='{"widget": "image", "preview_image": "image", "class": "product_detail_img mh-100", "alt-field": "name", "zoom": product_image.can_image_be_zoomed and "image_original"}'/>
+ <div t-else="" t-field="product_image.image_1920" class="d-flex align-items-center justify-content-center h-100" t-options='{"widget": "image", "preview_image": "image_1024", "class": "product_detail_img mh-100", "alt-field": "name", "zoom": product_image.can_image_be_zoomed and "image_1920"}'/>
</div>
</t>
</div>
@@ -1740,7 +1740,7 @@
<div t-ignore="True" class="d-none d-md-block text-center">
<ol t-if="len(product_images) > 1" class="carousel-indicators d-inline-block position-static mx-auto my-0 p-1 text-left">
<t t-foreach="product_images" t-as="product_image"><li t-attf-class="d-inline-block m-1 align-top {{'active' if product_image_first else ''}}" data-target="#o-carousel-product" t-att-data-slide-to="str(product_image_index)">
- <div t-field="product_image.image_small" class="d-flex align-items-center justify-content-center h-100" t-options='{"widget": "image", "alt-field": "name"}'/>
+ <div t-field="product_image.image_64" class="d-flex align-items-center justify-content-center h-100" t-options='{"widget": "image", "alt-field": "name"}'/>
<i t-if="product_image._name == 'product.image' and product_image.embed_code" class="fa fa-2x fa-play-circle-o o_product_video_thumb"/>
</li></t>
</ol>
diff --git a/addons/website_sale_comparison/views/website_sale_comparison_template.xml b/addons/website_sale_comparison/views/website_sale_comparison_template.xml
index 06cf34d6b64..9eb1d4da7df 100644
--- a/addons/website_sale_comparison/views/website_sale_comparison_template.xml
+++ b/addons/website_sale_comparison/views/website_sale_comparison_template.xml
@@ -97,7 +97,7 @@
<strong class='float-right'>x</strong>
</a>
<a t-att-href="'/shop/product/%s' % slug(product.product_tmpl_id)">
- <img t-attf-src="/web/image/product.product/#{product.id}/image_large" class="img img-fluid" style="margin:auto;" alt="Product image"/>
+ <img t-attf-src="/web/image/product.product/#{product.id}/image_256" class="img img-fluid" style="margin:auto;" alt="Product image"/>
</a>
<div class='product_summary'>
<a class="o_product_comparison_table" t-attf-href="/shop/product/#{ slug(product.product_tmpl_id) }">
@@ -143,7 +143,7 @@
<t t-set="combination_info" t-value="product._get_combination_info_variant()"/>
<div class="row no-gutters align-items-center mt-2 o_product_row" t-att-data-category_ids="product.public_categ_ids.ids">
<div class="col-3">
- <img class="img img-fluid" t-attf-src="/web/image/product.product/#{product.id}/image_small" style="max-height: 50px;" alt="Product image"/>
+ <img class="img img-fluid" t-attf-src="/web/image/product.product/#{product.id}/image_64" style="max-height: 50px;" alt="Product image"/>
</div>
<div class="col-8 pl-2">
<h6>
diff --git a/addons/website_sale_digital/data/product_demo.xml b/addons/website_sale_digital/data/product_demo.xml
index 2388f15a023..444ea7f5dc0 100644
--- a/addons/website_sale_digital/data/product_demo.xml
+++ b/addons/website_sale_digital/data/product_demo.xml
@@ -7,7 +7,7 @@
<field name="list_price">4.50</field>
<field name="type">service</field>
<field name="website_published" eval="True"/>
- <field name="image" type="base64" file="website_sale_digital/static/digital_product_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_sale_digital/static/digital_product_1.jpg"/>
<field name="categ_id" ref="product.product_category_6"/>
</record>
diff --git a/addons/website_sale_slides/data/website_sale_slides_demo.xml b/addons/website_sale_slides/data/website_sale_slides_demo.xml
index c5f8a3d1b35..f578264c907 100644
--- a/addons/website_sale_slides/data/website_sale_slides_demo.xml
+++ b/addons/website_sale_slides/data/website_sale_slides_demo.xml
@@ -9,7 +9,7 @@
<field name="list_price">100.0</field>
<field name="type">service</field>
<field name="website_published" eval="True"/>
- <field name="image" type="base64" file="website_sale_slides/static/img/product_course.png"/>
+ <field name="image_1920" type="base64" file="website_sale_slides/static/img/product_course.png"/>
</record>
<record id="website_slides.slide_channel_demo_6_furn3" model="slide.channel">
@@ -25,7 +25,7 @@
<field name="list_price">12.0</field>
<field name="type">consu</field>
<field name="website_published" eval="True"/>
- <field name="image" type="base64" file="website_sale_slides/static/img/water_can.jpg"/>
+ <field name="image_1920" type="base64" file="website_sale_slides/static/img/water_can.jpg"/>
</record>
<record id="product_course_channel_1_option_1" model="product.product">
@@ -34,7 +34,7 @@
<field name="list_price">4.5</field>
<field name="type">consu</field>
<field name="website_published" eval="True"/>
- <field name="image" type="base64" file="website_sale_slides/static/img/flower_pot.jpg"/>
+ <field name="image_1920" type="base64" file="website_sale_slides/static/img/flower_pot.jpg"/>
</record>
<record id="product_course_demo_1" model="product.product">
@@ -43,7 +43,7 @@
<field name="list_price">150.0</field>
<field name="type">service</field>
<field name="website_published" eval="True"/>
- <field name="image" type="base64" file="website_sale_slides/static/img/channel_demo_tree_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_sale_slides/static/img/channel_demo_tree_1.jpg"/>
</record>
<record id="product_course_demo_1_product_template" model="product.template">
diff --git a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml
index 77ac50e7823..e6f95956448 100644
--- a/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml
+++ b/addons/website_sale_wishlist/views/website_sale_wishlist_template.xml
@@ -63,7 +63,7 @@
<tr t-att-data-wish-id='wish.id' t-att-data-product-id='wish.product_id.id'>
<td class='td-img'>
<a t-att-href="'/shop/product/%s' % slug(wish.product_id.product_tmpl_id)">
- <img t-attf-src="/web/image/product.product/#{wish.product_id.id}/image_medium" class="img img-fluid" style="margin:auto;" alt="Product image"/>
+ <img t-attf-src="/web/image/product.product/#{wish.product_id.id}/image_128" class="img img-fluid" style="margin:auto;" alt="Product image"/>
</a>
</td>
<td class='text-left'>
diff --git a/addons/website_slides/controllers/main.py b/addons/website_slides/controllers/main.py
index d6e1caceb93..2f12ab72775 100644
--- a/addons/website_slides/controllers/main.py
+++ b/addons/website_slides/controllers/main.py
@@ -557,9 +557,9 @@ class WebsiteSlides(WebsiteProfile):
return response
@http.route('/slides/slide/<int:slide_id>/get_image', type='http', auth="public", website=True, sitemap=False)
- def slide_get_image(self, slide_id, field='image_medium', width=0, height=0, crop=False):
+ def slide_get_image(self, slide_id, field='image_128', width=0, height=0, crop=False):
# Protect infographics by limiting access to 256px (large) images
- if field not in ('image_small', 'image_medium', 'image_large'):
+ if field not in ('image_64', 'image_128', 'image_256', 'image_512', 'image_1024', 'image_1920'):
return werkzeug.exceptions.Forbidden()
slide = request.env['slide.slide'].sudo().browse(slide_id).exists()
@@ -846,7 +846,7 @@ class WebsiteSlides(WebsiteProfile):
def _get_valid_slide_post_values(self):
return ['name', 'url', 'tag_ids', 'slide_type', 'channel_id', 'is_preview',
- 'mime_type', 'datas', 'description', 'image', 'index_content', 'website_published']
+ 'mime_type', 'datas', 'description', 'image_1920', 'index_content', 'website_published']
@http.route(['/slides/tag/search_read'], type='json', auth='user', methods=['POST'], website=True)
def slide_tag_search_read(self, fields, domain):
diff --git a/addons/website_slides/data/mail_data.xml b/addons/website_slides/data/mail_data.xml
index e00ddd2f78b..b14fea317a1 100644
--- a/addons/website_slides/data/mail_data.xml
+++ b/addons/website_slides/data/mail_data.xml
@@ -12,7 +12,7 @@
A new ${object.slide_type} <strong>${object.name}</strong> has been published on ${object.channel_id.name} at ${format_datetime(object.write_date, tz=user.tz)}
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${object.website_url}">
- <img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; margin: 16px;"/>
+ <img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image_1024" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
@@ -39,7 +39,7 @@
${ctx['user'].name} shared the ${object.slide_type} <strong>${object.name}</strong> with you!
<div style="margin: 16px 8px 16px 8px; text-align: center;">
<a href="${(object.website_url + '?fullscreen=1') if ctx['fullscreen'] else object.website_url | safe}">
- <img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image" style="height:auto; width:150px; margin: 16px;"/>
+ <img alt="${object.name}" src="${ctx['base_url']}/web/image/slide.slide/${object.id}/image_1024" style="height:auto; width:150px; margin: 16px;"/>
</a>
</div>
<div style="margin: 16px 8px 16px 8px; text-align: center;">
diff --git a/addons/website_slides/data/slide_channel_demo.xml b/addons/website_slides/data/slide_channel_demo.xml
index 1c6ae501db4..d88c30abe46 100644
--- a/addons/website_slides/data/slide_channel_demo.xml
+++ b/addons/website_slides/data/slide_channel_demo.xml
@@ -11,7 +11,7 @@
(4, ref('website_slides.slide_channel_tag_level_basic')),
(4, ref('website_slides.slide_channel_tag_role_gardener')),
(4, ref('website_slides.slide_channel_tag_other_2'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_gardening.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_gardening.jpg"/>
<field name="description">Learn the basics of gardening !</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=8)"/>
</record>
@@ -27,7 +27,7 @@
(4, ref('website_slides.slide_channel_tag_level_intermediate')),
(4, ref('website_slides.slide_channel_tag_role_gardener')),
(4, ref('website_slides.slide_channel_tag_other_0'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_gardening_2.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_gardening_2.jpg"/>
<field name="description">Learn how to take care of your favorite trees. Learn when to plant, how to manage potted trees, ...</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=7)"/>
</record>
@@ -55,7 +55,7 @@
(4, ref('website_slides.slide_channel_tag_role_carpenter')),
(4, ref('website_slides.slide_channel_tag_other_0')),
(4, ref('website_slides.slide_channel_tag_other_2'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_flowers.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_flowers.jpg"/>
<field name="description">A lot of nice documentation: trees, wood, gardens. A gold mine for references.</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=6)"/>
</record>
@@ -83,7 +83,7 @@
(4, ref('website_slides.slide_channel_tag_role_carpenter')),
(4, ref('website_slides.slide_channel_tag_role_furniture')),
(4, ref('website_slides.slide_channel_tag_other_2'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_tree_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_tree_1.jpg"/>
<field name="description">Knowing which kind of wood to use depending on your application is important. In this course you
will learn the basics of wood characteristics.</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=5)"/>
@@ -104,7 +104,7 @@ will learn the basics of wood characteristics.</field>
<field name="tag_ids" eval="[(5, 0),
(4, ref('website_slides.slide_channel_tag_level_basic')),
(4, ref('website_slides.slide_channel_tag_role_furniture'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture_2.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_furniture_2.jpg"/>
<field name="description">If you are looking for technical specifications, have a look at this documentation.</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=4)"/>
</record>
@@ -126,7 +126,7 @@ will learn the basics of wood characteristics.</field>
(4, ref('website_slides.slide_channel_tag_role_furniture')),
(4, ref('website_slides.slide_channel_tag_other_0')),
(4, ref('website_slides.slide_channel_tag_other_1'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_furniture.jpg"/>
<field name="description">All you need to know about furniture creation.</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=3)"/>
</record>
@@ -159,7 +159,7 @@ will learn the basics of wood characteristics.</field>
(4, ref('website_slides.slide_channel_tag_role_carpenter')),
(4, ref('website_slides.slide_channel_tag_role_furniture')),
(4, ref('website_slides.slide_channel_tag_other_1'))]"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_diy.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_diy.jpg"/>
<field name="description">So much amazing certification.</field>
<field name="create_date" eval="DateTime.now() - relativedelta(days=2)"/>
</record>
diff --git a/addons/website_slides/data/slide_slide_demo.xml b/addons/website_slides/data/slide_slide_demo.xml
index 9407a408671..3e329b38c28 100644
--- a/addons/website_slides/data/slide_slide_demo.xml
+++ b/addons/website_slides/data/slide_slide_demo.xml
@@ -7,7 +7,7 @@
<field name="name">Know-How Summary</field>
<field name="sequence">1</field>
<field name="datas" type="base64" file="website_slides/static/src/img/presentation.pdf"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
<field name="slide_type">presentation</field>
<field name="channel_id" ref="website_slides.channel_public"/>
<field name="category_id" eval="False"/>
@@ -21,7 +21,7 @@
<record id="slide_slide_demo_0_1" model="slide.slide">
<field name="name">Home Gardening</field>
<field name="sequence">2</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_gardening_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_gardening_1.jpg"/>
<field name="slide_type">infographic</field>
<field name="channel_id" ref="website_slides.channel_public"/>
<field name="category_id" eval="False"/>
@@ -38,7 +38,7 @@
<record id="slide_slide_demo_1_0" model="slide.slide">
<field name="name">Tree Infographic</field>
<field name="sequence">1</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_1.jpg"/>
<field name="slide_type">infographic</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
<field name="category_id" ref="website_slides.slide_category_demo_1_0"/>
@@ -52,7 +52,7 @@
<record id="slide_slide_demo_1_1" model="slide.slide">
<field name="name">Interesting Tree Facts</field>
<field name="sequence">2</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_2.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_2.jpg"/>
<field name="slide_type">infographic</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
<field name="category_id" ref="website_slides.slide_category_demo_1_0"/>
@@ -66,7 +66,7 @@
<record id="slide_slide_demo_1_2" model="slide.slide">
<field name="name">Energy Efficiency Facts</field>
<field name="sequence">3</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_3.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_infographic_3.jpg"/>
<field name="slide_type">infographic</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
<field name="category_id" ref="website_slides.slide_category_demo_1_0"/>
@@ -91,7 +91,7 @@
<field name="name">How to plant a potted tree</field>
<field name="sequence">4</field>
<field name="url">https://www.youtube.com/watch?v=QYmgrw0PgLU</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_thumb_QYmgrw0PgLU.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_thumb_QYmgrw0PgLU.jpg"/>
<field name="document_id">QYmgrw0PgLU</field>
<field name="slide_type">video</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
@@ -106,7 +106,7 @@
<record id="slide_slide_demo_1_4" model="slide.slide">
<field name="name">A little chat with Harry Potted</field>
<field name="sequence">5</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_1.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_1.jpg"/>
<field name="slide_type">webpage</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
<field name="category_id" ref="website_slides.slide_category_demo_1_1"/>
@@ -199,7 +199,7 @@
<field name="name">3 Main Methodologies</field>
<field name="sequence">6</field>
<field name="datas" type="base64" file="website_slides/static/src/img/presentation.pdf"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
<field name="slide_type">presentation</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_1_gard1"/>
<field name="category_id" ref="website_slides.slide_category_demo_1_1"/>
@@ -217,7 +217,7 @@
<field name="name">Main Trees Categories</field>
<field name="sequence">1</field>
<field name="datas" type="base64" file="website_slides/static/src/img/presentation.pdf"/>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_2.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_2.jpg"/>
<field name="slide_type">presentation</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_2_gard2"/>
<field name="category_id" ref="website_slides.slide_category_demo_2_0"/>
@@ -278,7 +278,7 @@
<record id="slide_slide_demo_2_1" model="slide.slide">
<field name="name">A Mighty Forest from Ages</field>
<field name="sequence">2</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_3.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_tree_img_3.jpg"/>
<field name="slide_type">webpage</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_2_gard2"/>
<field name="category_id" ref="website_slides.slide_category_demo_2_0"/>
@@ -327,7 +327,7 @@
<record id="slide_slide_demo_2_2" model="slide.slide">
<field name="name">Tree planting in hanging bottles on wall</field>
<field name="url">https://www.youtube.com/watch?v=ebBez6bcSEc</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_thumb_ebBez6bcSEc.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_thumb_ebBez6bcSEc.jpg"/>
<field name="document_id">ebBez6bcSEc</field>
<field name="slide_type">video</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_2_gard2"/>
@@ -346,7 +346,7 @@
<field name="name">Unforgettable Tools</field>
<field name="sequence">1</field>
<field name="datas" type="base64" file="website_slides/static/src/img/presentation.pdf"/>
- <field name="image" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel-training-default.jpg"/>
<field name="slide_type">presentation</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_5_furn2"/>
<field name="category_id" ref="website_slides.slide_category_demo_5_0"/>
@@ -370,7 +370,7 @@
<record id="slide_slide_demo_5_1" model="slide.slide">
<field name="name">How to find quality wood</field>
<field name="sequence">2</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_thumb_5WMqwTnZ-qs.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_thumb_5WMqwTnZ-qs.jpg"/>
<field name="url">https://www.youtube.com/watch?v=5WMqwTnZ-qs</field>
<field name="document_id">5WMqwTnZ-qs</field>
<field name="slide_type">video</field>
@@ -386,7 +386,7 @@
<record id="slide_slide_demo_5_2" model="slide.slide">
<field name="name">How to create your own piece of furniture</field>
<field name="sequence">3</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_thumb_ptjeDDoURL8.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_thumb_ptjeDDoURL8.jpg"/>
<field name="url">https://www.youtube.com/watch?v=ptjeDDoURL8</field>
<field name="document_id">ptjeDDoURL8</field>
<field name="slide_type">video</field>
@@ -402,7 +402,7 @@
<record id="slide_slide_demo_5_3" model="slide.slide">
<field name="name">Test your knowledge !</field>
<field name="sequence">4</field>
- <field name="image" type="base64" file="website_slides/static/src/img/slide_demo_owl.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/slide_demo_owl.jpg"/>
<field name="slide_type">quiz</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_5_furn2"/>
<field name="category_id" ref="website_slides.slide_category_demo_5_0"/>
diff --git a/addons/website_slides/models/slide_slide.py b/addons/website_slides/models/slide_slide.py
index 4a0523e5593..d369a297afa 100644
--- a/addons/website_slides/models/slide_slide.py
+++ b/addons/website_slides/models/slide_slide.py
@@ -287,8 +287,8 @@ class Slide(models.Model):
if not values.get('index_content'):
values['index_content'] = values.get('description')
- if values.get('slide_type') == 'infographic' and not values.get('image'):
- values['image'] = values['datas']
+ if values.get('slide_type') == 'infographic' and not values.get('image_1920'):
+ values['image_1920'] = values['datas']
if values.get('website_published') and not values.get('date_published'):
values['date_published'] = datetime.datetime.now()
if values.get('url') and not values.get('document_id'):
@@ -604,7 +604,7 @@ class Slide(models.Model):
return values
values.update({
'name': snippet['title'],
- 'image': self._fetch_data(snippet['thumbnails']['high']['url'], {}, 'image')['values'],
+ 'image_1920': self._fetch_data(snippet['thumbnails']['high']['url'], {}, 'image')['values'],
'description': snippet['description'],
'mime_type': False,
})
@@ -615,8 +615,8 @@ class Slide(models.Model):
def get_slide_type(vals):
# TDE FIXME: WTF ??
slide_type = 'presentation'
- if vals.get('image'):
- image = Image.open(io.BytesIO(base64.b64decode(vals['image'])))
+ if vals.get('image_1920'):
+ image = Image.open(io.BytesIO(base64.b64decode(vals['image_1920'])))
width, height = image.size
if height > width:
return 'document'
@@ -648,14 +648,14 @@ class Slide(models.Model):
values = {
'name': google_values['title'],
- 'image': self._fetch_data(google_values['thumbnailLink'].replace('=s220', ''), {}, 'image')['values'],
+ 'image_1920': self._fetch_data(google_values['thumbnailLink'].replace('=s220', ''), {}, 'image')['values'],
'mime_type': google_values['mimeType'],
'document_id': document_id,
}
if google_values['mimeType'].startswith('video/'):
values['slide_type'] = 'video'
elif google_values['mimeType'].startswith('image/'):
- values['datas'] = values['image']
+ values['datas'] = values['image_1920']
values['slide_type'] = 'infographic'
elif google_values['mimeType'].startswith('application/vnd.google-apps'):
values['slide_type'] = get_slide_type(values)
@@ -677,6 +677,6 @@ class Slide(models.Model):
res = super(Slide, self)._default_website_meta()
res['default_opengraph']['og:title'] = res['default_twitter']['twitter:title'] = self.name
res['default_opengraph']['og:description'] = res['default_twitter']['twitter:description'] = self.description
- res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/slide.slide/%s/image" % (self.id)
+ res['default_opengraph']['og:image'] = res['default_twitter']['twitter:image'] = "/web/image/slide.slide/%s/image_1024" % (self.id)
res['default_meta_description'] = self.description
return res
diff --git a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
index 22e8b126b2d..093f147aff6 100644
--- a/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
+++ b/addons/website_slides/static/src/js/slides_course_fullscreen_player.js
@@ -498,7 +498,7 @@ odoo.define('website_slides.fullscreen', function (require) {
slideData.embedCode = $(slideData.embedCode).attr('src'); // embedCode containts an iframe tag, where src attribute is the url (youtube or embed document from odoo)
slideData.embedUrl = "https://" + slideData.embedCode + "&rel=0&autoplay=1&enablejsapi=1&origin=" + window.location.origin;
} else if (slideData.type === 'infographic') {
- slideData.embedUrl = _.str.sprintf('/web/image/slide.slide/%s/image', slideData.id);
+ slideData.embedUrl = _.str.sprintf('/web/image/slide.slide/%s/image_1024', slideData.id);
} else if (_.contains(['document', 'presentation'], slideData.type)) {
slideData.embedUrl = $(slideData.embedCode).attr('src');
}
diff --git a/addons/website_slides/static/src/xml/website_slides_fullscreen.xml b/addons/website_slides/static/src/xml/website_slides_fullscreen.xml
index 6793dd5c736..ceebb9d246c 100644
--- a/addons/website_slides/static/src/xml/website_slides_fullscreen.xml
+++ b/addons/website_slides/static/src/xml/website_slides_fullscreen.xml
@@ -8,7 +8,7 @@
</t>
<t t-if="widget.get('slide').type === 'infographic'">
<div class="o_wslides_fs_player w-100 h-100 overflow-auto d-flex align-items-start justify-content-center">
- <img t-att-src="'/web/image/slide.slide/'+ widget.get('slide').id +'/image'" class="img-fluid position-relative m-auto" alt="Slide image"/>
+ <img t-att-src="'/web/image/slide.slide/'+ widget.get('slide').id +'/image_1024'" class="img-fluid position-relative m-auto" alt="Slide image"/>
</div>
</t>
</t>
diff --git a/addons/website_slides/views/slide_channel_views.xml b/addons/website_slides/views/slide_channel_views.xml
index 27dbd5742c3..7cdf9e63d96 100644
--- a/addons/website_slides/views/slide_channel_views.xml
+++ b/addons/website_slides/views/slide_channel_views.xml
@@ -64,7 +64,7 @@
<field name="is_published" widget="website_button"/>
</button>
</div>
- <field name="image" widget="image" class="oe_avatar" options="{'preview_image': 'image_medium'}"/>
+ <field name="image_1920" widget="image" class="oe_avatar" options="{'preview_image': 'image_128'}"/>
<div class="oe_title">
<label for="name" class="oe_edit_only" string="Name"/>
<h1><field name="name" default_focus="1" placeholder="Name"/></h1>
diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml
index 9ee8fd67c98..5fcb30dbad4 100644
--- a/addons/website_slides/views/slide_slide_views.xml
+++ b/addons/website_slides/views/slide_slide_views.xml
@@ -47,7 +47,7 @@
<field name="is_published" widget="website_button"/>
</button>
</div>
- <field name="image" widget="image" class="oe_avatar" options='{"preview_image": "image_large"}'
+ <field name="image_1920" widget="image" class="oe_avatar" options='{"preview_image": "image_256"}'
attrs="{'readonly': [('slide_type', 'in', ('document', 'presentation', 'video'))]}"
/>
<div class="oe_title">
diff --git a/addons/website_slides/views/website_slides_templates_course.xml b/addons/website_slides/views/website_slides_templates_course.xml
index 8f90923b485..9fac350ac71 100644
--- a/addons/website_slides/views/website_slides_templates_course.xml
+++ b/addons/website_slides/views/website_slides_templates_course.xml
@@ -120,7 +120,7 @@
<!-- ==== Header Left ==== -->
<div class="col-12 col-md-4 col-lg-3">
<div class="d-flex align-items-start justify-content-around h-100">
- <div class="o_wslides_course_pict d-inline-block mb-2 mt-3 my-md-0" t-attf-style="background-image:url(/web/image/slide.channel/#{channel.id}/image)" t-ignore="True"/>
+ <div class="o_wslides_course_pict d-inline-block mb-2 mt-3 my-md-0" t-attf-style="background-image:url(/web/image/slide.channel/#{channel.id}/image_1024)" t-ignore="True"/>
</div>
</div>
@@ -534,7 +534,7 @@
<!-- Featured lesson -->
<div t-if="not search and not search_slide_type and slide_promoted" class="container py-1 mb-2">
<div class="card flex-column flex-lg-row">
- <t t-set="image_url" t-value="'/web/image/slide.slide/%s/image' % slide_promoted.id"/>
+ <t t-set="image_url" t-value="'/web/image/slide.slide/%s/image_1024' % slide_promoted.id"/>
<a t-if="slide_promoted.is_preview or channel.is_member or is_slides_publisher"
t-attf-href="/slides/slide/#{slug(slide_promoted)}#{query_string}" class="w-100 w-lg-50 flex-shrink-0 rounded">
@@ -608,8 +608,8 @@
<div class="card w-100 o_wslides_lesson_card mb-4">
<t t-set="can_access" t-value="slide.is_preview or channel.is_member or channel.can_publish"/>
- <t t-if="slide.image">
- <t t-set="lesson_image" t-value="'/web/image/slide.slide/%s/image' % slide.id"/>
+ <t t-if="slide.image_1024">
+ <t t-set="lesson_image" t-value="'/web/image/slide.slide/%s/image_1024' % slide.id"/>
<a t-if="can_access" t-attf-href="/slides/slide/#{slug(slide)}#{query_string}" t-title="slide.name">
<div class="card-img-top border-bottom" t-attf-style="padding-top: 50%; background-image: url(#{lesson_image}); background-size: cover; background-position:center"/>
</a>
diff --git a/addons/website_slides/views/website_slides_templates_homepage.xml b/addons/website_slides/views/website_slides_templates_homepage.xml
index 5e689745e4b..de824406f1f 100644
--- a/addons/website_slides/views/website_slides_templates_homepage.xml
+++ b/addons/website_slides/views/website_slides_templates_homepage.xml
@@ -15,7 +15,7 @@
<t t-foreach="top3_users" t-as="user">
<img class="rounded-circle img-fluid shadow ml-n4"
style="border: 6px solid white"
- t-attf-src="/web/image/res.users/#{user['id']}/image_medium"/>
+ t-attf-src="/web/image/res.users/#{user['id']}/image_128"/>
</t>
</div>
</div>
@@ -283,9 +283,9 @@
<template id='course_card' name="Course Card">
<div t-attf-class="card w-100 o_wslides_course_card mb-4 #{'o_wslides_course_unpublished' if not channel.is_published else ''}">
- <t t-set="course_image" t-value="'/web/image/slide.channel/%s/image' % channel.id"/>
+ <t t-set="course_image" t-value="'/web/image/slide.channel/%s/image_1024' % channel.id"/>
<a t-attf-href="/slides/#{slug(channel)}" t-title="channel.name">
- <div t-if="channel.image_large" class="card-img-top" t-attf-style="padding-top: 50%; background-image: url(#{course_image}); background-size: cover; background-position:center"/>
+ <div t-if="channel.image_1024" class="card-img-top" t-attf-style="padding-top: 50%; background-image: url(#{course_image}); background-size: cover; background-position:center"/>
<div t-else="" class="o_wslides_gradient card-img-top position-relative" style="padding-top: 50%; opacity: 0.8">
<i class="fa fa-graduation-cap fa-2x mr-3 mb-3 position-absolute text-white-75" style="right:0; bottom: 0"/>
</div>
@@ -394,7 +394,7 @@
<div class="o_wslides_home_aside">
<div t-if="user.rank_id" class="d-flex align-items-center">
<span class="font-weight-bold text-muted mr-2">Current rank:</span>
- <img t-attf-src="/web/image/gamification.karma.rank/#{user.rank_id.id}/image_small" height="16" alt="" class="mr-1"/>
+ <img t-attf-src="/web/image/gamification.karma.rank/#{user.rank_id.id}/image_64" height="16" alt="" class="mr-1"/>
<a href="/profile/ranks_badges" t-field="user.rank_id"/>
</div>
<t t-set="next_rank_id" t-value="user._get_next_rank()"/>
@@ -415,7 +415,7 @@
<div t-attf-class="d-flex mb-3 align-items-center #{'o_wslides_entry_muted' if not challenge_done else ''}">
<img class="mr-2"
style="max-height: 36px;"
- t-att-src="'/web/image/gamification.badge/%s/image_medium' % challenge.reward_id.id"
+ t-att-src="'/web/image/gamification.badge/%s/image_128' % challenge.reward_id.id"
t-att-alt="challenge.reward_id.name"/>
<div class="flex-grow-1">
<b class="text_small_caps" t-esc="challenge.reward_id.name"/><br/>
@@ -430,7 +430,7 @@
<template id='slides_misc_user_image' name="User Avatar">
<img t-att-class="img_class if img_class else 'rounded-circle float-left'"
t-att-style="img_style if img_style else 'max-height: 32px;'"
- t-att-src="'/profile/avatar/%s?field=image_medium' % user.id"
+ t-att-src="'/profile/avatar/%s?field=image_128' % user.id"
t-att-alt="user.name"/>
</template>
</data></odoo>
diff --git a/addons/website_slides/views/website_slides_templates_lesson.xml b/addons/website_slides/views/website_slides_templates_lesson.xml
index ea6b1b74b66..642e097aa64 100644
--- a/addons/website_slides/views/website_slides_templates_lesson.xml
+++ b/addons/website_slides/views/website_slides_templates_lesson.xml
@@ -89,9 +89,9 @@
<!-- Slide sub-template: display an item in a list of related slides (Related, Most Viewed, ...) -->
<template id="slide_aside_card" name="Related Slide">
<a class="list-group-item list-group-item-action d-flex align-items-start px-2" t-att-href="'/slides/slide/%s' % (slug(aside_slide))">
- <t t-set="slide_image" t-value="'/web/image/slide.slide/%s/image' % aside_slide.id"/>
+ <t t-set="slide_image" t-value="'/web/image/slide.slide/%s/image_1024' % aside_slide.id"/>
- <div t-if="aside_slide.image" class="flex-shrink-0 mr-1 border" t-attf-style="width: 20%; padding-top: 20%; background-image: url(#{slide_image}); background-size: cover; background-position:center"/>
+ <div t-if="aside_slide.image_1024" class="flex-shrink-0 mr-1 border" t-attf-style="width: 20%; padding-top: 20%; background-image: url(#{slide_image}); background-size: cover; background-position:center"/>
<div t-else="" class="o_wslides_gradient flex-shrink-0 mr-1" t-attf-style="width: 20%; padding-top: 20%;"/>
<div class="overflow-hidden d-flex flex-column justify-content-start">
<h6 t-esc="aside_slide.name" class="o_wslides_desc_truncate_2 mb-1" style="line-height: 1.15"/>
@@ -234,7 +234,7 @@
</div>
<div class="o_wslides_lesson_content_type">
<img t-if="slide.slide_type == 'infographic'"
- t-attf-src="/web/image/slide.slide/#{slide.id}/image" class="img-fluid" style="width:100%" t-att-alt="slide.name"/>
+ t-attf-src="/web/image/slide.slide/#{slide.id}/image_1024" class="img-fluid" style="width:100%" t-att-alt="slide.name"/>
<div t-if="slide.slide_type in ('presentation', 'document')" class="embed-responsive embed-responsive-4by3 embed-responsive-item mb8" style="height: 600px;">
<t t-raw="slide.embed_code"/>
</div>
diff --git a/addons/website_slides/views/website_slides_templates_lesson_embed.xml b/addons/website_slides/views/website_slides_templates_lesson_embed.xml
index e6fe7a1ae81..d69ddef3215 100644
--- a/addons/website_slides/views/website_slides_templates_lesson_embed.xml
+++ b/addons/website_slides/views/website_slides_templates_lesson_embed.xml
@@ -58,7 +58,7 @@
<div class="col-6 col-md-4 col-lg-3 oe_slides_suggestion_media">
<div class="card mb-3">
<a t-att-href="suggest_slide.website_url" target="_new" class="card-img-top embed-responsive embed-responsive-16by9">
- <img t-attf-src="/web/image/slide.slide/#{suggest_slide.id}/image" class="card-img-top embed-responsive-item" t-att-alt="suggest_slide.name"/>
+ <img t-attf-src="/web/image/slide.slide/#{suggest_slide.id}/image_1024" class="card-img-top embed-responsive-item" t-att-alt="suggest_slide.name"/>
</a>
<div class="card-body">
<h6 class="card-title">
@@ -80,14 +80,14 @@
<i class="fa fa-circle-o-notch fa-spin mr-2"/><b>Loading...</b>
</div>
<div class="toast-body p-0">
- <img class="img-fluid w-100" t-attf-src="/web/image/slide.slide/#{slide.id}/image_large"/>
+ <img class="img-fluid w-100" t-attf-src="/web/image/slide.slide/#{slide.id}/image_256"/>
</div>
</div>
</div>
<canvas id="PDFViewerCanvas" class="img-fluid w-100" style="display: none;"></canvas>
</t>
<t t-if="slide.slide_type == 'infographic'">
- <img t-attf-src="/web/image/slide.slide/#{slide.id}/image" class="img-fluid" style="width: 100%" alt="Slide image"/>
+ <img t-attf-src="/web/image/slide.slide/#{slide.id}/image_1024" class="img-fluid" style="width: 100%" alt="Slide image"/>
</t>
</div>
<!-- Fixed bottom navbar -->
diff --git a/addons/website_slides/views/website_slides_templates_profile.xml b/addons/website_slides/views/website_slides_templates_profile.xml
index 212b0ad9993..e083fd724d6 100644
--- a/addons/website_slides/views/website_slides_templates_profile.xml
+++ b/addons/website_slides/views/website_slides_templates_profile.xml
@@ -39,7 +39,7 @@
<div class="card-body o_wprofile_slides_course_card_body p-0 d-flex"
t-attf-onclick="location.href='/slides/#{slug(course.channel_id)}';">
- <div t-if="course.channel_id.image" class="pl-5 pr-4 rounded-left" t-attf-style="background-image:url(/web/image/slide.channel/#{course.channel_id.id}/image); background-size: cover; background-position: center"/>
+ <div t-if="course.channel_id.image_1024" class="pl-5 pr-4 rounded-left" t-attf-style="background-image:url(/web/image/slide.channel/#{course.channel_id.id}/image_1024); background-size: cover; background-position: center"/>
<div t-else="" class="o_wslides_gradient pl-5 pr-4 rounded-left position-relative" style="opacity: 0.8">
<i class="fa fa-graduation-cap fa-fw mr-2 mt-3 position-absolute text-white-75" style="right:0; top: 0"/>
</div>
diff --git a/addons/website_slides_survey/data/slide_slide_demo.xml b/addons/website_slides_survey/data/slide_slide_demo.xml
index fe4642fbaf5..bf9cc7c95f9 100644
--- a/addons/website_slides_survey/data/slide_slide_demo.xml
+++ b/addons/website_slides_survey/data/slide_slide_demo.xml
@@ -6,7 +6,7 @@
<record id="slide_slide_demo_5_4" model="slide.slide">
<field name="name">Furniture Creation Certification</field>
<field name="sequence">5</field>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_furniture.jpg"/>
<field name="slide_type">certification</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_5_furn2"/>
<field name="category_id" ref="website_slides.slide_category_demo_5_0"/>
@@ -21,7 +21,7 @@
<record id="slide_slide_demo_6_0" model="slide.slide">
<field name="name">DIY Furniture Certification</field>
<field name="sequence">1</field>
- <field name="image" type="base64" file="website_slides/static/src/img/channel_demo_furniture_3.jpg"/>
+ <field name="image_1920" type="base64" file="website_slides/static/src/img/channel_demo_furniture_3.jpg"/>
<field name="slide_type">certification</field>
<field name="channel_id" ref="website_slides.slide_channel_demo_6_furn3"/>
<field name="category_id" eval="False"/>
diff --git a/addons/website_slides_survey/views/website_profile.xml b/addons/website_slides_survey/views/website_profile.xml
index 105a5843861..dd80c485308 100644
--- a/addons/website_slides_survey/views/website_profile.xml
+++ b/addons/website_slides_survey/views/website_profile.xml
@@ -17,7 +17,7 @@
<div class="col-12 col-lg-6" t-foreach="certificates" t-as="certificate">
<div class="card mb-2">
<div class="card-body o_wprofile_slides_course_card_body p-0 d-flex">
- <div class="pl-5 pr-4 rounded-left" t-attf-style="background-image:url(/web/image/slide.slide/#{certificate.slide_id.id}/image_medium); background-position: center"/>
+ <div class="pl-5 pr-4 rounded-left" t-attf-style="background-image:url(/web/image/slide.slide/#{certificate.slide_id.id}/image_128); background-position: center"/>
<div class="p-2 w-100">
<h5 class="mt-0 mb-1" t-esc="certificate.survey_id.title"/>
<div t-if="user.id == uid">
diff --git a/doc/reference/javascript_reference.rst b/doc/reference/javascript_reference.rst
index e963cf878f5..2b2b51e4dc8 100644
--- a/doc/reference/javascript_reference.rst
+++ b/doc/reference/javascript_reference.rst
@@ -1763,7 +1763,7 @@ order.
.. code-block:: xml
- <field name="image" widget='image' options='{"preview_image":"image_medium"}'/>
+ <field name="image" widget='image' options='{"preview_image":"image_128"}'/>
- binary (FieldBinaryFile)
Generic widget to allow saving/downloading a binary file.
diff --git a/odoo/addons/base/models/image_mixin.py b/odoo/addons/base/models/image_mixin.py
index 1941ca41774..d7611c895ff 100644
--- a/odoo/addons/base/models/image_mixin.py
+++ b/odoo/addons/base/models/image_mixin.py
@@ -10,33 +10,19 @@ class ImageMixin(models.AbstractModel):
# all image fields are base64 encoded and PIL-supported
- image_original = fields.Image("Original Image", help="Image in its original size, as it was uploaded.")
+ image_1920 = fields.Image("Image", max_width=1920, max_height=1920)
# resized fields stored (as attachment) for performance
- image_big = fields.Image("Big-sized Image", related="image_original", max_width=1024, max_height=1024, store=True, help="1024px * 1024px")
- image_large = fields.Image("Large-sized Image", related="image_original", max_width=256, max_height=256, store=True, help="256px * 256px")
- image_medium = fields.Image("Medium-sized Image", related="image_original", max_width=128, max_height=128, store=True, help="128px * 128px")
- image_small = fields.Image("Small-sized Image", related="image_original", max_width=64, max_height=64, store=True, help="64px * 64px")
+ image_1024 = fields.Image("Image 1024", related="image_1920", max_width=1024, max_height=1024, store=True)
+ image_512 = fields.Image("Image 512", related="image_1920", max_width=512, max_height=512, store=True)
+ image_256 = fields.Image("Image 256", related="image_1920", max_width=256, max_height=256, store=True)
+ image_128 = fields.Image("Image 128", related="image_1920", max_width=128, max_height=128, store=True)
+ image_64 = fields.Image("Image 64", related="image_1920", max_width=64, max_height=64, store=True)
can_image_be_zoomed = fields.Boolean("Can image raw be zoomed", compute='_compute_images', store=True)
- image = fields.Image("Image", compute='_compute_image', inverse='_set_image')
-
- @api.depends('image_original')
+ @api.depends('image_1920')
def _compute_images(self):
for record in self:
- image = record.image_original
+ image = record.image_1920
record.can_image_be_zoomed = image and tools.is_image_size_above(image)
-
- @api.depends('image_big')
- def _compute_image(self):
- for record in self:
- record.image = record.image_big
-
- def _set_image(self):
- for record in self:
- record.image_original = record.image
- # We want the image field to be recomputed to have a correct size.
- # Without this `invalidate_cache`, the image field will keep holding the
- # image_original instead of the big-sized image.
- self.invalidate_cache()
diff --git a/odoo/addons/base/models/res_partner.py b/odoo/addons/base/models/res_partner.py
index e9c3f91c44a..9ffacd4913f 100644
--- a/odoo/addons/base/models/res_partner.py
+++ b/odoo/addons/base/models/res_partner.py
@@ -222,11 +222,11 @@ class Partner(models.Model):
# image: all image fields are base64 encoded and PIL-supported
image = fields.Binary("Image")
- image_medium = fields.Binary("Medium-sized image",
+ image_128 = fields.Binary("Medium-sized image",
help="Medium-sized image of this contact. It is automatically "\
"resized as a 128x128px image, with aspect ratio preserved. "\
"Use this field in form views or some kanban views.")
- image_small = fields.Binary("Small-sized image",
+ image_64 = fields.Binary("Small-sized image",
help="Small-sized image of this contact. It is automatically "\
"resized as a 64x64px image, with aspect ratio preserved. "\
"Use this field anywhere a small image is required.")
@@ -348,7 +348,7 @@ class Partner(models.Model):
if image_base64 and colorize:
image_base64 = tools.image_process(image_base64, colorize=True)
- return tools.image_process(image_base64, size=tools.IMAGE_BIG_SIZE)
+ return tools.image_process(image_base64, size=(1024, 1024))
@api.model
def _fields_view_get(self, view_id=None, view_type='form', toolbar=False, submenu=False):
diff --git a/odoo/addons/base/models/res_users.py b/odoo/addons/base/models/res_users.py
index d7ef51862cd..96d747ecb07 100644
--- a/odoo/addons/base/models/res_users.py
+++ b/odoo/addons/base/models/res_users.py
@@ -201,9 +201,9 @@ class Users(models.Model):
__uid_cache = defaultdict(dict) # {dbname: {uid: password}}
# User can write on a few of his own fields (but not his groups for example)
- SELF_WRITEABLE_FIELDS = ['signature', 'action_id', 'company_id', 'email', 'name', 'image', 'image_medium', 'image_small', 'lang', 'tz']
+ SELF_WRITEABLE_FIELDS = ['signature', 'action_id', 'company_id', 'email', 'name', 'image', 'image_128', 'image_64', 'lang', 'tz']
# User can read a few of his own fields
- SELF_READABLE_FIELDS = ['signature', 'company_id', 'login', 'email', 'name', 'image', 'image_medium', 'image_small', 'lang', 'tz', 'tz_offset', 'groups_id', 'partner_id', '__last_update', 'action_id']
+ SELF_READABLE_FIELDS = ['signature', 'company_id', 'login', 'email', 'name', 'image', 'image_128', 'image_64', 'lang', 'tz', 'tz_offset', 'groups_id', 'partner_id', '__last_update', 'action_id']
def _default_groups(self):
default_user = self.env.ref('base.default_user', raise_if_not_found=False)
diff --git a/odoo/addons/base/tests/test_ir_http.py b/odoo/addons/base/tests/test_ir_http.py
index 6d8f29686b1..19ab037400f 100644
--- a/odoo/addons/base/tests/test_ir_http.py
+++ b/odoo/addons/base/tests/test_ir_http.py
@@ -62,7 +62,7 @@ class test_ir_http_mimetype(common.TransactionCase):
'type': 'binary',
})
- resized = odoo.tools.image_process(prop.value_binary, size=odoo.tools.IMAGE_SMALL_SIZE)
+ resized = odoo.tools.image_process(prop.value_binary, size=(64, 64))
# Simul computed field which resize and that is not attachement=True (E.G. on product)
prop.write({'value_binary': resized})
status, headers, content = self.env['ir.http'].binary_content(
diff --git a/odoo/addons/base/views/res_partner_views.xml b/odoo/addons/base/views/res_partner_views.xml
index ee59fe130c0..15c9a695c2e 100644
--- a/odoo/addons/base/views/res_partner_views.xml
+++ b/odoo/addons/base/views/res_partner_views.xml
@@ -67,7 +67,7 @@
<form string="Contact">
<field name="is_company" invisible="1"/>
<field name="type" invisible="1"/>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<field name="company_type" options="{'horizontal': true}" class="oe_edit_only" widget="radio" groups="base.group_no_one"/>
<h1>
@@ -97,7 +97,7 @@
<field name="priority" eval="20"/>
<field name="arch" type="xml">
<form string="Partner">
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}' readonly="1"/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}' readonly="1"/>
<div class="oe_title">
<h1>
<field name="name" readonly="1"/>
@@ -135,7 +135,7 @@
<field name="arch" type="xml">
<form string="Partners">
<sheet>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<field name="is_company" invisible="1"/>
<field name="commercial_partner_id" invisible="1"/>
@@ -205,7 +205,7 @@
<sheet>
<widget name="web_ribbon" text="Archived" bg_color="bg-danger" attrs="{'invisible': [('active', '=', True)]}"/>
<div class="oe_button_box" name="button_box"/>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<field name="is_company" invisible="1"/>
<field name="commercial_partner_id" invisible="1"/>
@@ -300,7 +300,7 @@
<field name="country_id"/>
<field name="mobile"/>
<field name="state_id"/>
- <field name="image_small"/>
+ <field name="image_64"/>
<field name="lang"/>
<!-- fields in form x2many view to diminish requests -->
<field name="comment"/>
@@ -310,8 +310,8 @@
<t t-set="color" t-value="kanban_color(record.color.raw_value)"/>
<div t-att-class="color + (record.title.raw_value == 1 ? ' oe_kanban_color_alert' : '') + ' oe_kanban_global_click'">
<div class="o_kanban_image">
- <img alt="" t-if="record.image_small.raw_value" t-att-src="kanban_image('res.partner', 'image_small', record.id.raw_value)"/>
- <t t-if="!record.image_small.raw_value">
+ <img alt="" t-if="record.image_64.raw_value" t-att-src="kanban_image('res.partner', 'image_64', record.id.raw_value)"/>
+ <t t-if="!record.image_64.raw_value">
<img alt="Delivery" t-if="record.type.raw_value === 'delivery'" t-att-src='_s + "/base/static/img/truck.png"'/>
<img alt="Invoice" t-if="record.type.raw_value === 'invoice'" t-att-src='_s + "/base/static/img/money.png"'/>
<t t-if="record.type.raw_value !== 'invoice' &amp;&amp; record.type.raw_value !== 'delivery'">
@@ -373,7 +373,7 @@
<field name="mobile" widget="phone"/>
</group>
<group colspan="1">
- <field name="image_medium" widget="image" class="oe_avatar" nolabel="1"/>
+ <field name="image_128" widget="image" class="oe_avatar" nolabel="1"/>
</group>
</group>
<field name="lang" invisible="True"/>
@@ -503,7 +503,7 @@
<field name="mobile"/>
<field name="state_id"/>
<field name="category_id"/>
- <field name="image_medium"/>
+ <field name="image_128"/>
<field name="type"/>
<templates>
<t t-name="kanban-box">
@@ -512,16 +512,16 @@
<t t-if="record.type.raw_value === 'delivery'" t-set="placeholder" t-value="'/base/static/img/truck.png'"/>
<t t-elif="record.type.raw_value === 'invoice'" t-set="placeholder" t-value="'/base/static/img/money.png'"/>
<t t-else="" t-set="placeholder" t-value="'/base/static/img/avatar_grey.png'"/>
- <div class="o_kanban_image_fill_left d-none d-md-block" t-attf-style="background-image:url('#{kanban_image('res.partner', 'image_medium', record.id.raw_value, placeholder)}')">
- <img class="o_kanban_image_inner_pic" t-if="record.parent_id.raw_value" t-att-alt="record.parent_id.value" t-att-src="kanban_image('res.partner', 'image_small', record.parent_id.raw_value)"/>
+ <div class="o_kanban_image_fill_left d-none d-md-block" t-attf-style="background-image:url('#{kanban_image('res.partner', 'image_128', record.id.raw_value, placeholder)}')">
+ <img class="o_kanban_image_inner_pic" t-if="record.parent_id.raw_value" t-att-alt="record.parent_id.value" t-att-src="kanban_image('res.partner', 'image_64', record.parent_id.raw_value)"/>
</div>
- <div class="o_kanban_image rounded-circle d-md-none" t-attf-style="background-image:url('#{kanban_image('res.partner', 'image_medium', record.id.raw_value, placeholder)}')">
- <img class="o_kanban_image_inner_pic" t-if="record.parent_id.raw_value" t-att-alt="record.parent_id.value" t-att-src="kanban_image('res.partner', 'image_small', record.parent_id.raw_value)"/>
+ <div class="o_kanban_image rounded-circle d-md-none" t-attf-style="background-image:url('#{kanban_image('res.partner', 'image_128', record.id.raw_value, placeholder)}')">
+ <img class="o_kanban_image_inner_pic" t-if="record.parent_id.raw_value" t-att-alt="record.parent_id.value" t-att-src="kanban_image('res.partner', 'image_64', record.parent_id.raw_value)"/>
</div>
</t>
<t t-else="">
<t t-set="placeholder" t-value="'/base/static/img/company_image.png'"/>
- <div class="o_kanban_image_fill_left o_kanban_image_full" t-attf-style="background-image: url(#{kanban_image('res.partner', 'image_medium', record.id.raw_value, placeholder)})" role="img"/>
+ <div class="o_kanban_image_fill_left o_kanban_image_full" t-attf-style="background-image: url(#{kanban_image('res.partner', 'image_128', record.id.raw_value, placeholder)})" role="img"/>
</t>
<div class="oe_kanban_details">
<strong class="o_kanban_record_title oe_partner_heading"><field name="display_name"/></strong>
diff --git a/odoo/addons/base/views/res_users_views.xml b/odoo/addons/base/views/res_users_views.xml
index 7d2472ca7c0..33d7e1008b2 100644
--- a/odoo/addons/base/views/res_users_views.xml
+++ b/odoo/addons/base/views/res_users_views.xml
@@ -125,7 +125,7 @@
<div class="alert alert-info text-center mb-3" attrs="{'invisible': [('id', '>', 0)]}" role="alert">
You are inviting a new user.
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"zoom": true, "preview_image": "image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" required="1"/></h1>
@@ -189,7 +189,7 @@
<field name="partner_id" required="0" readonly="1"/>
</div>
</div>
- <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_medium"}'/>
+ <field name="image" widget='image' class="oe_avatar" options='{"preview_image": "image_128"}'/>
<div class="oe_title">
<label for="name" class="oe_edit_only"/>
<h1><field name="name" required="1"/></h1>
@@ -269,7 +269,7 @@
<t t-name="kanban-box">
<div t-attf-class="oe_kanban_global_click">
<div class="o_kanban_image">
- <img alt="Avatar" t-att-src="kanban_image('res.users', 'image_medium', record.id.raw_value)"/>
+ <img alt="Avatar" t-att-src="kanban_image('res.users', 'image_128', record.id.raw_value)"/>
</div>
<div class="oe_kanban_details">
<ul>
@@ -342,7 +342,7 @@
<field eval="18" name="priority"/>
<field name="arch" type="xml">
<form string="Users">
- <field name="image" readonly="0" widget='image' class="oe_right oe_avatar" options='{"preview_image": "image_small"}'/>
+ <field name="image" readonly="0" widget='image' class="oe_right oe_avatar" options='{"preview_image": "image_64"}'/>
<h1>
<field name="name" readonly="1" class="oe_inline"/>
</h1>
diff --git a/odoo/tools/image.py b/odoo/tools/image.py
index ee7d109c10b..77232fda658 100644
--- a/odoo/tools/image.py
+++ b/odoo/tools/image.py
@@ -25,11 +25,6 @@ FILETYPE_BASE64_MAGICWORD = {
b'P': 'svg+xml',
}
-IMAGE_BIG_SIZE = (1024, 1024)
-IMAGE_LARGE_SIZE = (256, 256)
-IMAGE_MEDIUM_SIZE = (128, 128)
-IMAGE_SMALL_SIZE = (64, 64)
-
# Arbitraty limit to fit most resolutions, including Nokia Lumia 1020 photo,
# 8K with a ratio up to 16:10, and almost all variants of 4320p
IMAGE_MAX_RESOLUTION = 45e6
@@ -367,7 +362,7 @@ def image_to_base64(image, format, **params):
return base64.b64encode(stream.getvalue())
-def is_image_size_above(base64_source, size=IMAGE_BIG_SIZE):
+def is_image_size_above(base64_source, size=(1024, 1024)):
"""Return whether or not the size of the given image `base64_source` is
above the provided `size` (tuple: width, height).
"""
@@ -392,25 +387,22 @@ def image_guess_size_from_field_name(field_name):
:return: the guessed size
:rtype: tuple (width, height)
"""
- suffix = 'big' if field_name == 'image' else field_name.split('_')[-1]
- if suffix == 'big':
- return IMAGE_BIG_SIZE
- if suffix == 'large':
- return IMAGE_LARGE_SIZE
- if suffix == 'medium':
- return IMAGE_MEDIUM_SIZE
- if suffix == 'small':
- return IMAGE_SMALL_SIZE
- return (0, 0)
+ suffix = '1024' if field_name == 'image' else field_name.split('_')[-1]
+ if suffix == 'max':
+ return (1920, 1920)
+ try:
+ return (int(suffix), int(suffix))
+ except ValueError:
+ return (0, 0)
def image_get_resized_images(base64_source,
- big_name='image', large_name='image_large', medium_name='image_medium', small_name='image_small'):
+ big_name='image', large_name='image_256', medium_name='image_128', small_name='image_64'):
""" Standard tool function that returns a dictionary containing the
big, medium, large and small versions of the source image.
:param {..}_name: key of the resized image in the return dictionary;
- 'image', 'image_large', 'image_medium' and 'image_small' by default.
+ 'image', 'image_256', 'image_128' and 'image_64' by default.
Set a key to False to not include it.
Refer to image_resize_image for the other parameters.
@@ -420,19 +412,19 @@ def image_get_resized_images(base64_source,
"""
return_dict = dict()
if big_name:
- return_dict[big_name] = image_process(base64_source, size=IMAGE_BIG_SIZE)
+ return_dict[big_name] = image_process(base64_source, size=(1024, 1024))
if large_name:
- return_dict[large_name] = image_process(base64_source, size=IMAGE_LARGE_SIZE)
+ return_dict[large_name] = image_process(base64_source, size=(256, 256))
if medium_name:
- return_dict[medium_name] = image_process(base64_source, size=IMAGE_MEDIUM_SIZE)
+ return_dict[medium_name] = image_process(base64_source, size=(128, 128))
if small_name:
- return_dict[small_name] = image_process(base64_source, size=IMAGE_SMALL_SIZE)
+ return_dict[small_name] = image_process(base64_source, size=(64, 64))
return return_dict
def image_resize_images(vals,
return_big=True, return_large=False, return_medium=True, return_small=True,
- big_name='image', large_name='image_large', medium_name='image_medium', small_name='image_small'):
+ big_name='image', large_name='image_256', medium_name='image_128', small_name='image_64'):
""" Update ``vals`` with image fields resized as expected. """
big_image = vals.get(big_name)
large_image = vals.get(large_name)