summaryrefslogtreecommitdiff
path: root/addons/account/views/account_move_views.xml
diff options
context:
space:
mode:
authorNicolas (vin) <vin@odoo.com>2020-07-15 13:11:13 +0000
committerNicolas (vin) <vin@odoo.com>2020-07-27 05:04:39 +0000
commitc09c6a92e155961f25cdee7b8a8a724f26bf8c7c (patch)
treefe56fa8b2eece1a698971419ef03b93c67839915 /addons/account/views/account_move_views.xml
parent501487c9d7152477d8848397ca3ae96735ffd8c1 (diff)
[IMP] account: Make analytic fields read-only
Analytics fields are currently updatable when the move has been posted, even though editing them as no effect. This change make them read-only when the move has been posted. Task ID: #2299319 closes odoo/odoo#54521 Signed-off-by: Cedric Snauwaert (csn) <csn@openerp.com>
Diffstat (limited to 'addons/account/views/account_move_views.xml')
-rw-r--r--addons/account/views/account_move_views.xml4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index f2bcf9e71f4..37205c50df3 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -146,7 +146,7 @@
<field name="statement_id" invisible="1"/>
<field name="ref" optional="show"/>
<field name="name" optional="show"/>
- <field name="analytic_account_id" groups="account.group_account_readonly" optional="show"/>
+ <field name="analytic_account_id" groups="account.group_account_readonly" optional="show" attrs="{'readonly':[('parent_state','=','posted')]}"/>
<field name="analytic_tag_ids" widget="many2many_tags" groups="analytic.group_analytic_tags" optional="hide"/>
<field name="tax_ids" widget="many2many_tags" width="0.5" optional="show"/>
<field name="debit" sum="Total Debit"/>
@@ -184,7 +184,7 @@
<field name="matching_number" string="Matching" optional="show"/>
<field name="reconcile_model_id" invisible="1"/>
<field name="date_maturity" optional="hide"/>
- <field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting"/>
+ <field name="analytic_account_id" optional="hide" groups="analytic.group_analytic_accounting" attrs="{'readonly':[('parent_state','=','posted')]}"/>
<field name="analytic_tag_ids" optional="hide" readonly="1" groups="analytic.group_analytic_tags"/>
<field name="debit" sum="Total Debit" readonly="1"/>
<field name="credit" sum="Total Credit" readonly="1"/>