[MIG] account_payment_sale: Migration to 13.0

This commit is contained in:
Raf Ven
2020-01-31 15:37:36 +01:00
committed by Marçal Isern
parent 24a18a1318
commit 0f23ec3a97
2 changed files with 4 additions and 3 deletions

View File

@@ -20,7 +20,7 @@ class AccountMove(models.Model):
compute="_compute_payment_mode",
store=True,
ondelete="restrict",
states={"draft": [("readonly", False)]},
readonly=False,
)
bank_account_required = fields.Boolean(
related="payment_mode_id.payment_method_id.bank_account_required", readonly=True
@@ -29,7 +29,7 @@ class AccountMove(models.Model):
compute="_compute_invoice_partner_bank",
store=True,
ondelete="restrict",
states={"draft": [("readonly", False)]},
readonly=False,
)
@api.depends("type")

View File

@@ -28,6 +28,7 @@
<field name="payment_mode_id"
domain="[('payment_type', '=', payment_mode_filter_type_domain), ('company_id', '=', company_id)]"
widget="selection"
attrs="{'readonly': [('state', '!=', 'draft')]}"
invisible="context.get('default_type') not in ('out_invoice','out_refund','in_invoice','in_refund')"/>
<field name="commercial_partner_id" invisible="1"/>
<field name="bank_account_required" invisible="1"/>
@@ -37,7 +38,7 @@
<field name="invoice_partner_bank_id" position="attributes">
<attribute name="domain">[('partner_id', '=', partner_bank_filter_type_domain),
'|',('company_id', '=', company_id),('company_id', '=', False)]</attribute>
<attribute name="attrs">{'required': [('bank_account_required', '=', True)]}</attribute>
<attribute name="attrs">{'required': [('bank_account_required', '=', True)], 'readonly': [('state', '!=', 'draft')]}</attribute>
<attribute name="context">{'default_partner_id':commercial_partner_id}</attribute>
</field>
</field>