summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLaurent Stukkens (LTU) <ltu@odoo.com>2020-12-09 12:16:13 +0100
committerXavier BOL (xbo) <xbo@odoo.com>2020-12-21 15:35:20 +0100
commite18229b9a4335e2cfa9d01d11f9e99be2bd99f9c (patch)
treefe745103c238a1b6262539fb64cc31b5c855b15b
parent659418a695b9e8ae32ed1ab4aa88b9ebe2b9c665 (diff)
[IMP] project,sale_project: have partner_id many2One behave as in sale.order
Prior to this commit the partners where sorted out by display_name in the task form view. After this commit the will be sorted out by their ranking, as it is the case in sale.order form view. task-2409761
-rw-r--r--addons/project/views/project_views.xml2
-rw-r--r--addons/sale_project/views/project_task_views.xml4
2 files changed, 5 insertions, 1 deletions
diff --git a/addons/project/views/project_views.xml b/addons/project/views/project_views.xml
index 843418ff4c9..e2d8db23535 100644
--- a/addons/project/views/project_views.xml
+++ b/addons/project/views/project_views.xml
@@ -670,7 +670,7 @@
</group>
<group>
<field name="active" invisible="1"/>
- <field name="partner_id" class="o_task_customer_field"/>
+ <field name="partner_id" widget="res_partner_many2one" class="o_task_customer_field"/>
<field name="partner_email" widget="email" invisible="1"/>
<field name="partner_phone" widget="phone" attrs="{'invisible': [('partner_id', '=', False)]}"/>
<field name="legend_blocked" invisible="1"/>
diff --git a/addons/sale_project/views/project_task_views.xml b/addons/sale_project/views/project_task_views.xml
index 436eeb0b020..6cb6eb36b28 100644
--- a/addons/sale_project/views/project_task_views.xml
+++ b/addons/sale_project/views/project_task_views.xml
@@ -26,6 +26,10 @@
string="Sales Order"
groups="sales_team.group_sale_salesman"/>
</div>
+ <xpath expr="//field[@name='partner_id']" position="attributes">
+ <attribute name="options">{'always_reload': True}</attribute>
+ <attribute name="context">{'res_partner_search_mode': 'customer'}</attribute>
+ </xpath>
<xpath expr="//field[@name='partner_phone']" position="after">
<field name="sale_order_id" attrs="{'invisible': [('project_id', '!=', False)]}" groups="sales_team.group_sale_salesman"/>
<field name="sale_line_id" string="Sales Order Item" attrs="{'invisible': [('partner_id', '=', False)]}" options='{"no_open": True}' readonly="1" context="{'create': False, 'edit': False, 'delete': False}" groups="sales_team.group_sale_salesman"/>