[FIX] account : forbid recipient bank update on posted bill

When updating the recipient bank on a posted vendor bill the chnages
will not be saved.

Steps to reproduce the error:
1-Go to accounting
2-Create a vendor bill and confirm it
3-Change the bank recipient and click manual save
4-Reload and you can see the changes disappeared

The error was happening because the recipient bank was not displayed as
readonly on a posted state of the account move.

opw-3247282

closes odoo/odoo#118783

X-original-commit: 7e7ca95080a601ccf5c0da679aae00a61a9f8ccf
Signed-off-by: Quentin De Paoli <qdp@odoo.com>
Signed-off-by: Mahdi Cheikh Rouhou (macr) <macr@odoo.com>
This commit is contained in:
Mahdi cheikh rouhou (macr)
2023-04-17 16:35:00 +02:00
parent 4c5cdf5f09
commit bce7da2a38
+2 -1
View File
@@ -816,7 +816,8 @@
<field name="partner_bank_id"
context="{'default_partner_id': bank_partner_id, 'display_account_trust': True}"
domain="[('partner_id', '=', bank_partner_id)]"
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))]}"/>
attrs="{'invisible': [('move_type', 'not in', ('in_invoice', 'in_refund', 'in_receipt'))],
'readonly': [('state', '!=', 'draft')]}"/>
<!-- Invoice payment terms (only invoices) + due date (only invoices / receipts) -->
<div class="o_td_label" attrs="{'invisible': [('move_type', 'not in', ('out_invoice', 'out_refund', 'in_invoice', 'in_refund', 'out_receipt', 'in_receipt'))]}">