summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVishnu Thuletiya <vtu@odoo.com>2020-05-06 06:21:14 +0000
committerBarad Mahendra <mba@openerp.com>2020-05-13 12:37:48 +0000
commit9a830432dbdf678c732ebe6e91135dad5ff2e6d2 (patch)
tree54596a0d2567c75fcd37f719e8707db18031f832
parent25cb4c18e5f49b83014f6b1abf63044a6ab6c2cf (diff)
[IMP] various: Use the new avatar widget in kanban view
The purpose of task is to update the 'user/employee avatar' to the new widget in all the kanban view across all modules. The below new widget are introduced for avatar: - many2one_avatar_user (for user_id fields) - many2one_avatar_employee (for employee_id fields) which displays the avatar (i.e. picture) of a user/employee in front of his name and clicking on the avatar will open a chatbox to message that specific user/employee. So in this commit, For each kanban view with a user or employee avatar, replaced it by the field with the new 'many2one_avatar' widget. TaskID: 2244928 Related Enterprise PR: https://github.com/odoo/enterprise/pull/10420 closes odoo/odoo#50789 Closes: #50789 Related: odoo/enterprise#10420 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
-rw-r--r--addons/account_analytic_default/views/account_analytic_default_view.xml7
-rw-r--r--addons/crm/views/crm_lead_views.xml4
-rw-r--r--addons/event/static/src/scss/event.scss6
-rw-r--r--addons/event/views/event_views.xml7
-rw-r--r--addons/hr_contract/views/hr_contract_views.xml4
-rw-r--r--addons/hr_maintenance/views/maintenance_views.xml8
-rw-r--r--addons/hr_recruitment/views/hr_recruitment_views.xml5
-rw-r--r--addons/lunch/report/lunch_cashmove_report_views.xml4
-rw-r--r--addons/lunch/views/lunch_cashmove_views.xml4
-rw-r--r--addons/lunch/views/lunch_orders_views.xml4
-rw-r--r--addons/maintenance/views/maintenance_views.xml16
-rw-r--r--addons/mass_mailing/views/mailing_mailing_views.xml6
-rw-r--r--addons/point_of_sale/views/point_of_sale_dashboard.xml9
-rw-r--r--addons/point_of_sale/views/pos_session_view.xml2
-rw-r--r--addons/project/views/project_views.xml7
-rw-r--r--addons/purchase_requisition/views/purchase_requisition_views.xml5
-rw-r--r--addons/utm/views/utm_campaign_views.xml2
-rw-r--r--addons/website_slides/views/slide_slide_views.xml5
18 files changed, 34 insertions, 71 deletions
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 842f59d34c5..b628d2bb466 100644
--- a/addons/account_analytic_default/views/account_analytic_default_view.xml
+++ b/addons/account_analytic_default/views/account_analytic_default_view.xml
@@ -59,14 +59,13 @@
<div t-attf-class="oe_kanban_card oe_kanban_global_click">
<div>
<strong><span><field name="analytic_id"/></span></strong>
- <img t-if="record.user_id.raw_value"
- t-att-title="record.user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover 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>
<div t-if="record.partner_id.value"><strong>Customer</strong> <field name="partner_id"/> </div>
+ <div class="float-right">
+ <field name="user_id" widget="many2one_avatar_user"/>
+ </div>
</div>
</t>
</templates>
diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml
index 5355b4c2102..0900c8c0a61 100644
--- a/addons/crm/views/crm_lead_views.xml
+++ b/addons/crm/views/crm_lead_views.xml
@@ -385,9 +385,7 @@
</div>
</div>
<div class="oe_kanban_bottom_right">
- <img t-if="record.user_id.raw_value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar float-right"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/event/static/src/scss/event.scss b/addons/event/static/src/scss/event.scss
index 0fed82448a8..ad32c3cf5db 100644
--- a/addons/event/static/src/scss/event.scss
+++ b/addons/event/static/src/scss/event.scss
@@ -18,11 +18,5 @@
.o_event_fontsize_20 {
font-size: 2rem;
}
-
- .o_event_fit_20 {
- height: 20px;
- object-fit: cover;
- width: 20px;
- }
}
}
diff --git a/addons/event/views/event_views.xml b/addons/event/views/event_views.xml
index b316fe15e68..85726d0d822 100644
--- a/addons/event/views/event_views.xml
+++ b/addons/event/views/event_views.xml
@@ -362,10 +362,9 @@
<div class="text-right">
<div class="float-left"><field name="activity_ids" widget="kanban_activity"/></div>
<field name="kanban_state" widget="state_selection"/>
- <img t-if="record.user_id.raw_value"
- class="oe_kanban_avatar o_event_fit_20 ml-2 rounded-circle"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-title="record.user_id.value" t-att-alt="record.user_id.value"/>
+ <span class="ml-2">
+ <field name="user_id" widget="many2one_avatar_user"/>
+ </span>
</div>
</div>
</div>
diff --git a/addons/hr_contract/views/hr_contract_views.xml b/addons/hr_contract/views/hr_contract_views.xml
index 0f2be3e836b..3f8bf7f40f5 100644
--- a/addons/hr_contract/views/hr_contract_views.xml
+++ b/addons/hr_contract/views/hr_contract_views.xml
@@ -278,7 +278,9 @@
<field name="job_id"/>
</div>
<div class="oe_kanban_bottom_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"/>
+ <span class="float-right">
+ <field name="employee_id" widget="many2one_avatar_employee"/>
+ </span>
<span class="float-right mr4">
<field name="kanban_state" widget="state_selection"/>
</span>
diff --git a/addons/hr_maintenance/views/maintenance_views.xml b/addons/hr_maintenance/views/maintenance_views.xml
index 287e7ca7db0..a6373143ba8 100644
--- a/addons/hr_maintenance/views/maintenance_views.xml
+++ b/addons/hr_maintenance/views/maintenance_views.xml
@@ -98,12 +98,8 @@
<field name="employee_id"/>
<field name="department_id"/>
</xpath>
- <xpath expr="//img[@t-att-title='record.owner_user_id.value']" position='replace'>
- <img t-if="record.employee_id.raw_value"
- class="oe_kanban_avatar"
- t-att-alt="record.employee_id.value"
- t-att-title="record.employee_id.value"
- t-att-src="kanban_image('hr.employee', 'image_128', record.employee_id.raw_value)"/>
+ <xpath expr="//field[@name='owner_user_id']" position='replace'>
+ <field name="employee_id" widget="many2one_avatar_employee"/>
</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/views/hr_recruitment_views.xml b/addons/hr_recruitment/views/hr_recruitment_views.xml
index 4d8c33b43d1..903d3d65d34 100644
--- a/addons/hr_recruitment/views/hr_recruitment_views.xml
+++ b/addons/hr_recruitment/views/hr_recruitment_views.xml
@@ -331,10 +331,7 @@
<field name="legend_blocked" invisible="1"/>
<field name="legend_done" invisible="1"/>
</div>
- <img t-if="record.user_id.raw_value"
- t-att-title="record.user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
diff --git a/addons/lunch/report/lunch_cashmove_report_views.xml b/addons/lunch/report/lunch_cashmove_report_views.xml
index d75e89a867d..58e8b0855df 100644
--- a/addons/lunch/report/lunch_cashmove_report_views.xml
+++ b/addons/lunch/report/lunch_cashmove_report_views.xml
@@ -106,7 +106,9 @@
<t t-esc="record.date.value"/>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover float-right"/>
+ <div class="float-right">
+ <field name="user_id" widget="many2one_avatar_user"/>
+ </div>
</div>
</div>
</div>
diff --git a/addons/lunch/views/lunch_cashmove_views.xml b/addons/lunch/views/lunch_cashmove_views.xml
index 945402a30eb..de3ad7ae11a 100644
--- a/addons/lunch/views/lunch_cashmove_views.xml
+++ b/addons/lunch/views/lunch_cashmove_views.xml
@@ -77,7 +77,9 @@
<t t-esc="record.date.value"/>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover float-right"/>
+ <div class="float-right">
+ <field name="user_id" widget="many2one_avatar_user"/>
+ </div>
</div>
</div>
</div>
diff --git a/addons/lunch/views/lunch_orders_views.xml b/addons/lunch/views/lunch_orders_views.xml
index f423f003cc8..f9c614471f8 100644
--- a/addons/lunch/views/lunch_orders_views.xml
+++ b/addons/lunch/views/lunch_orders_views.xml
@@ -91,7 +91,9 @@
</a>
</div>
<div class="col-6">
- <img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover float-right"/>
+ <span class="float-right">
+ <field name="user_id" widget="many2one_avatar_user"/>
+ </span>
</div>
</div>
</div>
diff --git a/addons/maintenance/views/maintenance_views.xml b/addons/maintenance/views/maintenance_views.xml
index 7bf76102ef7..1dc661d9c94 100644
--- a/addons/maintenance/views/maintenance_views.xml
+++ b/addons/maintenance/views/maintenance_views.xml
@@ -164,10 +164,7 @@
</div>
<div class="oe_kanban_bottom_right">
<field name="kanban_state" widget="state_selection"/>
- <img t-if="record.user_id.raw_value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-title="record.user_id.value"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar float-right"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
@@ -471,10 +468,7 @@
<div class="o_kanban_inline_block" t-if="!selection_mode">
<field name="activity_ids" widget="kanban_activity" />
</div>
- <img t-if="record.owner_user_id.raw_value"
- t-att-title="record.owner_user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.owner_user_id.raw_value)"
- t-att-alt="record.owner_user_id.value" class="oe_kanban_avatar"/>
+ <field name="owner_user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
@@ -666,11 +660,6 @@
<div t-attf-class="oe_kanban_global_click">
<div class="mb4">
<strong><field name="name"/></strong>
- <img t-if="record.technician_user_id.raw_value"
- t-att-alt="record.technician_user_id.value"
- t-att-title="record.technician_user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.technician_user_id.raw_value)"
- class="oe_kanban_avatar o_image_24_cover float-right"/>
</div>
<div class="row mt4">
<div class="col-6">
@@ -682,6 +671,7 @@
<span class="badge badge-pill">
<strong>Maintenance:</strong> <field name="maintenance_count"/>
</span>
+ <field name="technician_user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/mass_mailing/views/mailing_mailing_views.xml b/addons/mass_mailing/views/mailing_mailing_views.xml
index c600a525694..1469bb1f6ba 100644
--- a/addons/mass_mailing/views/mailing_mailing_views.xml
+++ b/addons/mass_mailing/views/mailing_mailing_views.xml
@@ -368,11 +368,7 @@
</span>
</div>
<div class="oe_kanban_bottom_right">
- <img t-if="record.user_id.raw_value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-title="record.user_id.value"
- t-att-alt="record.user_id.value"
- class="o_image_24_cover oe_kanban_avatar"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/point_of_sale/views/point_of_sale_dashboard.xml b/addons/point_of_sale/views/point_of_sale_dashboard.xml
index 1c3fc3b4888..e4afcae6115 100644
--- a/addons/point_of_sale/views/point_of_sale_dashboard.xml
+++ b/addons/point_of_sale/views/point_of_sale_dashboard.xml
@@ -117,13 +117,8 @@
</div>
</div>
</div>
- <div style="text-align:right;" t-if="record.current_user_id.value">
- <img
- class="oe_kanban_avatar o_image_24_cover"
- t-att-src="kanban_image('res.users', 'image_128', record.current_user_id.raw_value)"
- t-att-title="record.current_user_id.value"
- t-att-alt="record.current_user_id.value"
- />
+ <div style="text-align:right;">
+ <field name="current_user_id" widget="many2one_avatar_user"/>
</div>
</div><div class="container o_kanban_card_manage_pane dropdown-menu" role="menu">
<div class="row">
diff --git a/addons/point_of_sale/views/pos_session_view.xml b/addons/point_of_sale/views/pos_session_view.xml
index 115178b61ba..98aa025c93c 100644
--- a/addons/point_of_sale/views/pos_session_view.xml
+++ b/addons/point_of_sale/views/pos_session_view.xml
@@ -174,7 +174,7 @@
<span><field name="start_at" /></span>
</div>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-title="record.user_id.value" t-att-alt="record.user_id.value" class="oe_kanban_avatar float-right"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 72a73474862..da4cdfe0b78 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -435,11 +435,8 @@
<field name="partner_id" string="Contact"/>
</div>
<div class="col-4">
- <div class="oe_kanban_bottom_right">
- <img t-if="record.user_id.raw_value"
- t-att-title="record.user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover float-right"/>
+ <div class="oe_kanban_bottom_right float-right">
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/purchase_requisition/views/purchase_requisition_views.xml b/addons/purchase_requisition/views/purchase_requisition_views.xml
index f32da4ccc89..781b9d9e570 100644
--- a/addons/purchase_requisition/views/purchase_requisition_views.xml
+++ b/addons/purchase_requisition/views/purchase_requisition_views.xml
@@ -234,10 +234,7 @@
<field name="vendor_id"/>
</div>
<div class="oe_kanban_bottom_right">
- <img t-if="record.user_id.raw_value"
- t-att-title="record.user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar float-right"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/utm/views/utm_campaign_views.xml b/addons/utm/views/utm_campaign_views.xml
index c390306d972..d97c7396a70 100644
--- a/addons/utm/views/utm_campaign_views.xml
+++ b/addons/utm/views/utm_campaign_views.xml
@@ -108,7 +108,7 @@
<div class="o_kanban_record_bottom h5 mt-2 mb-0">
<div id="utm_statistics" class="d-flex flex-grow-1 text-600 mt-1"/>
<div class="oe_kanban_bottom_right">
- <img t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)" t-att-data-member_id="record.user_id.raw_value" t-att-alt="record.user_id.raw_value" width="32" height="32" class="oe_kanban_avatar"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>
diff --git a/addons/website_slides/views/slide_slide_views.xml b/addons/website_slides/views/slide_slide_views.xml
index 8693ec9900a..9077731d156 100644
--- a/addons/website_slides/views/slide_slide_views.xml
+++ b/addons/website_slides/views/slide_slide_views.xml
@@ -224,10 +224,7 @@
<t t-else=""><i class="fa fa-file-pdf-o mr-2" aria-label="Document" role="img" title="Document"/></t>
<field name="slide_type"/>
</span>
- <img t-if="record.user_id.raw_value"
- t-att-title="record.user_id.value"
- t-att-src="kanban_image('res.users', 'image_128', record.user_id.raw_value)"
- t-att-alt="record.user_id.value" class="oe_kanban_avatar o_image_24_cover"/>
+ <field name="user_id" widget="many2one_avatar_user"/>
</div>
</div>
</div>