[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:
sbejaoui
2019-10-30 10:59:09 +01:00
committed by Pedro M. Baeza
parent 35e782e631
commit 0964de5f8f
72 changed files with 1775 additions and 1773 deletions

View File

@@ -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'

View File

@@ -24,6 +24,7 @@ class ContractLine(models.Model):
string='Contract',
required=True,
index=True,
auto_join=True,
ondelete='cascade',
)
analytic_account_id = fields.Many2one(