mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[IMP] account_banking_mandate: Allow to change the bank mandate on invoices if they are not paid.
TT51723
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user