mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
[MIG] account_payment_sale: Migration to 13.0
This commit is contained in:
@@ -20,7 +20,7 @@ class AccountMove(models.Model):
|
|||||||
compute="_compute_payment_mode",
|
compute="_compute_payment_mode",
|
||||||
store=True,
|
store=True,
|
||||||
ondelete="restrict",
|
ondelete="restrict",
|
||||||
states={"draft": [("readonly", False)]},
|
readonly=False,
|
||||||
)
|
)
|
||||||
bank_account_required = fields.Boolean(
|
bank_account_required = fields.Boolean(
|
||||||
related="payment_mode_id.payment_method_id.bank_account_required", readonly=True
|
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",
|
compute="_compute_invoice_partner_bank",
|
||||||
store=True,
|
store=True,
|
||||||
ondelete="restrict",
|
ondelete="restrict",
|
||||||
states={"draft": [("readonly", False)]},
|
readonly=False,
|
||||||
)
|
)
|
||||||
|
|
||||||
@api.depends("type")
|
@api.depends("type")
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
<field name="payment_mode_id"
|
<field name="payment_mode_id"
|
||||||
domain="[('payment_type', '=', payment_mode_filter_type_domain), ('company_id', '=', company_id)]"
|
domain="[('payment_type', '=', payment_mode_filter_type_domain), ('company_id', '=', company_id)]"
|
||||||
widget="selection"
|
widget="selection"
|
||||||
|
attrs="{'readonly': [('state', '!=', 'draft')]}"
|
||||||
invisible="context.get('default_type') not in ('out_invoice','out_refund','in_invoice','in_refund')"/>
|
invisible="context.get('default_type') not in ('out_invoice','out_refund','in_invoice','in_refund')"/>
|
||||||
<field name="commercial_partner_id" invisible="1"/>
|
<field name="commercial_partner_id" invisible="1"/>
|
||||||
<field name="bank_account_required" invisible="1"/>
|
<field name="bank_account_required" invisible="1"/>
|
||||||
@@ -37,7 +38,7 @@
|
|||||||
<field name="invoice_partner_bank_id" position="attributes">
|
<field name="invoice_partner_bank_id" position="attributes">
|
||||||
<attribute name="domain">[('partner_id', '=', partner_bank_filter_type_domain),
|
<attribute name="domain">[('partner_id', '=', partner_bank_filter_type_domain),
|
||||||
'|',('company_id', '=', company_id),('company_id', '=', False)]</attribute>
|
'|',('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>
|
<attribute name="context">{'default_partner_id':commercial_partner_id}</attribute>
|
||||||
</field>
|
</field>
|
||||||
</field>
|
</field>
|
||||||
|
|||||||
Reference in New Issue
Block a user