[FIX] project: no personal stage when editing someone else's task

Since odoo#90588, the personal stage is a required field on the task form view in debug mode.
However, it does not make sense to have to set a personal stage when editing a task assigned to someone else.

This commit therefore hides the field when the user edits a task they are not assigned to.

Part-of: odoo/odoo#99735
This commit is contained in:
Vincent Larcin
2022-09-14 21:21:45 +02:00
committed by Laurent Stukkens (LTU)
parent cdf46cc9d9
commit b79c0e20c8
+1 -1
View File
@@ -1300,7 +1300,7 @@
<group>
<field name="is_analytic_account_id_changed" invisible="1"/>
<field name="parent_id" attrs="{'invisible': [('allow_subtasks', '=', False)]}" groups="base.group_no_one"/>
<field name="personal_stage_type_id" string="Personal Stage" groups="base.group_no_one" domain="[('user_id', '!=', False)]" context="{'default_user_id' : uid}" readonly="0" required="1"/>
<field name="personal_stage_type_id" string="Personal Stage" groups="base.group_no_one" domain="[('user_id', '!=', False)]" context="{'default_user_id' : uid}" readonly="0" required="1" attrs="{'invisible': &quot;[('user_ids', 'not in', [uid])]&quot;}"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting" context="{'default_partner_id': partner_id}"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags"/>
<field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/>