[FIX] sale: Number of SO linked to an archived article
When archiving a product template P with one SO linked to it, - Going to P by Accounting > Configuration > Products > P shows 1 sale in smart button - Going to P by Accounting > Sellable products > P showed 0 sale in smart button Now it shows 1 sale in these two cases. opw:1852948
This commit is contained in:
@@ -24,7 +24,7 @@ class ProductTemplate(models.Model):
|
||||
@api.depends('product_variant_ids.sales_count')
|
||||
def _sales_count(self):
|
||||
for product in self:
|
||||
product.sales_count = sum([p.sales_count for p in product.product_variant_ids])
|
||||
product.sales_count = sum([p.sales_count for p in product.with_context(active_test=False).product_variant_ids])
|
||||
|
||||
@api.multi
|
||||
def action_view_sales(self):
|
||||
|
||||
Reference in New Issue
Block a user