mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] Add check_company=True on contracts and contract lines
Add check_company=True in field definition and
[('company_id', '=', company_id)] in the domain (in view or in field definition)
This commit is contained in:
committed by
Adrià Pallejà
parent
bedf38e34f
commit
de6e2fea0d
@@ -14,6 +14,7 @@ class ContractContract(models.Model):
|
||||
help="If mandate required in payment method and not set mandate, "
|
||||
"invoice takes the first valid mandate",
|
||||
index=True,
|
||||
check_company=True,
|
||||
)
|
||||
mandate_required = fields.Boolean(
|
||||
related="payment_mode_id.payment_method_id.mandate_required", readonly=True
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
<field name="payment_mode_id" position="after">
|
||||
<field
|
||||
name="mandate_id"
|
||||
domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid')]"
|
||||
domain="[('partner_id', '=', commercial_partner_id), ('state', '=', 'valid'), ('company_id', '=', company_id)]"
|
||||
attrs="{'invisible': [('mandate_required', '=', False)]}"
|
||||
/>
|
||||
<field name="commercial_partner_id" invisible="1" />
|
||||
|
||||
Reference in New Issue
Block a user