mirror of
https://github.com/OCA/contract.git
synced 2025-02-13 17:57:24 +02:00
[FIX] contract: Fix performance issue on contract line read + Fix contract partner label + contract company must be the same as the sale order
- multi-company record rules on contract line causes performance issue - the label Partner (always False) don't make any sens - When creating a contract from a sale order the company must be the sale order company and not the user company
This commit is contained in:
@@ -14,12 +14,12 @@ class ContractAbstractContract(models.AbstractModel):
|
||||
_description = 'Abstract Recurring Contract'
|
||||
|
||||
# These fields will not be synced to the contract
|
||||
NO_SYNC = ['name', 'partner_id']
|
||||
NO_SYNC = ['name', 'partner_id', 'company_id']
|
||||
|
||||
name = fields.Char(required=True)
|
||||
# Needed for avoiding errors on several inherited behaviors
|
||||
partner_id = fields.Many2one(
|
||||
comodel_name="res.partner", string="Partner (always False)", index=True
|
||||
comodel_name="res.partner", string="Partner", index=True
|
||||
)
|
||||
pricelist_id = fields.Many2one(
|
||||
comodel_name='product.pricelist', string='Pricelist'
|
||||
|
||||
@@ -24,6 +24,7 @@ class ContractLine(models.Model):
|
||||
string='Contract',
|
||||
required=True,
|
||||
index=True,
|
||||
auto_join=True,
|
||||
ondelete='cascade',
|
||||
)
|
||||
analytic_account_id = fields.Many2one(
|
||||
|
||||
Reference in New Issue
Block a user