Merge PR #462 into 12.0

Signed-off-by sbejaoui
This commit is contained in:
OCA-git-bot
2020-03-18 17:01:38 +00:00
2 changed files with 4 additions and 2 deletions

View File

@@ -127,7 +127,9 @@ class SaleOrder(models.Model):
@api.depends("order_line")
def _compute_contract_count(self):
for rec in self:
rec.contract_count = len(rec.order_line.mapped('contract_id'))
rec.contract_count = len(
rec.order_line.mapped('contract_id').filtered(
lambda r: r.active))
@api.multi
def action_show_contracts(self):