[IMP] account_banking_mandate: Allow to change the bank mandate on invoices if they are not paid.

TT51723
This commit is contained in:
sergio-teruel
2024-11-13 16:30:48 +01:00
parent 4449d96278
commit d43b9ca38a
2 changed files with 3 additions and 3 deletions

View File

@@ -12,9 +12,7 @@ class AccountMove(models.Model):
"account.banking.mandate",
string="Direct Debit Mandate",
ondelete="restrict",
readonly=True,
check_company=True,
states={"draft": [("readonly", False)]},
)
mandate_required = fields.Boolean(
related="payment_mode_id.payment_method_id.mandate_required", readonly=True

View File

@@ -14,7 +14,9 @@
name="mandate_id"
domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]"
attrs="{'required': [('mandate_required', '=', True),('move_type', 'in', ('out_invoice', 'out_refund'))],
'invisible': ['|', ('mandate_required', '=', False),('move_type', 'not in', ('out_invoice', 'out_refund'))]}"
'invisible': ['|', ('mandate_required', '=', False),('move_type', 'not in', ('out_invoice', 'out_refund'))],
'readonly': [('payment_state', '=', 'paid')]
}"
/>
<field name="mandate_required" invisible="1" />
</field>