summaryrefslogtreecommitdiff
path: root/addons/account
diff options
context:
space:
mode:
authorAchraf (abz) <abz@odoo.com>2021-05-05 09:02:51 +0000
committerAchraf (abz) <abz@odoo.com>2021-05-07 08:19:30 +0000
commitc449fcb6274c9e68d4470423b5e2d91df3566615 (patch)
treec4a7f01256292b54b0abf39f53f6bad46217cb37 /addons/account
parent4ed6527cb414ee11d9bfac43a78dcc68ce233d07 (diff)
[FIX] account: Prevent user to change product via journal items after posting
What are the steps to reproduce your issue ? 1. Go to Account/Journal Items 2. Open a posted item 3. Change product What is currently happening ? The product is changed in the account move What are you expecting to happen ? The account move lines cannot be changed when the status is posted How to fix the bug ? Make the field read-only when the status is posted opw-2517325 closes odoo/odoo#70514 X-original-commit: 0b0cd8fa2a7b3363d3f118ba183fbc00046ed04d Signed-off-by: William André (wan) <wan@odoo.com> Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/account')
-rw-r--r--addons/account/views/account_move_views.xml20
1 files changed, 10 insertions, 10 deletions
diff --git a/addons/account/views/account_move_views.xml b/addons/account/views/account_move_views.xml
index 1658fa80ab1..086268bfc03 100644
--- a/addons/account/views/account_move_views.xml
+++ b/addons/account/views/account_move_views.xml
@@ -18,19 +18,19 @@
<field name="name"/>
<field name="partner_id"
domain="['|', ('parent_id', '=', False), ('is_company', '=', True)]"
- attrs="{'readonly': [('parent_state', '=', 'posted')]}"/>
+ readonly="1"/>
</group>
<notebook colspan="4">
<page string="Information" name="information">
<group>
<group string="Amount">
- <field name="account_id" options="{'no_create': True}" domain="[('company_id', '=', company_id)]" attrs="{'readonly':[('parent_state','=','posted')]}"/>
- <field name="debit" attrs="{'readonly':[('parent_state','=','posted')]}"/>
- <field name="credit" attrs="{'readonly':[('parent_state','=','posted')]}"/>
- <field name="quantity" attrs="{'readonly':[('parent_state','=','posted')]}"/>
+ <field name="account_id" options="{'no_create': True}" domain="[('company_id', '=', company_id)]" readonly="1"/>
+ <field name="debit" readonly="1"/>
+ <field name="credit" readonly="1"/>
+ <field name="quantity" readonly="1"/>
</group>
<group string="Accounting Documents">
- <field name="move_id" attrs="{'readonly':[('parent_state','=','posted')]}"/>
+ <field name="move_id" readonly="1"/>
<field name="statement_id" readonly="True" attrs="{'invisible': [('statement_id','=',False)]}"/>
</group>
<group string="Dates">
@@ -41,7 +41,7 @@
<group string="Taxes" attrs="{'invisible': [('tax_line_id','=',False), ('tax_ids','=',[])]}">
<field name="tax_line_id" readonly="1" attrs="{'invisible': [('tax_line_id','=',False)]}"/>
<field name="tax_ids" widget="many2many_tags" readonly="1" attrs="{'invisible': [('tax_ids','=',[])]}"/>
- <field name="tax_exigible" attrs="{'readonly':[('parent_state','=','posted')]}"/>
+ <field name="tax_exigible" readonly="1"/>
<field name="tax_audit"/>
</group>
<group string="Matching" attrs="{'invisible':[('matched_debit_ids', '=', []),('matched_credit_ids', '=', [])]}">
@@ -63,7 +63,7 @@
<field name="amount_currency"/>
</group>
<group string="Product" attrs="{'invisible': [('product_id', '=', False)]}">
- <field name="product_id"/>
+ <field name="product_id" readonly="1"/>
</group>
<group string="States">
<field name="blocked"/>
@@ -71,7 +71,7 @@
<group string="Analytic" groups="analytic.group_analytic_accounting,analytic.group_analytic_tags">
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"
domain="['|', ('company_id', '=', company_id), ('company_id', '=', False)]"
- attrs="{'readonly':[('parent_state','=','posted')]}"/>
+ readonly="1"/>
<field name="analytic_tag_ids" groups="analytic.group_analytic_tags"
widget="many2many_tags"/>
</group>
@@ -895,7 +895,7 @@
</group>
<group>
<field name="analytic_tag_ids" groups="analytic.group_analytic_tags" widget="many2many_tags"/>
- <field name="account_id" options="{'no_create': True}" domain="[('company_id', '=', company_id)]" attrs="{'readonly':[('parent_state','=','posted')]}"/>
+ <field name="account_id" options="{'no_create': True}" domain="[('company_id', '=', company_id)]" readonly="1"/>
<field name="tax_ids" widget="many2many_tags"/>
<field name="analytic_account_id" groups="analytic.group_analytic_accounting"/>
</group>