Skip to content
Snippets Groups Projects
Commit d91c0a20 authored by Goffin Simon's avatar Goffin Simon
Browse files

[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
parent f71b934c
No related branches found
No related tags found
No related merge requests found
......@@ -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):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment