summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGoffin Simon <sig@odoo.com>2018-06-04 13:27:16 +0200
committerGoffin Simon <sig@odoo.com>2018-06-05 09:58:28 +0200
commitd91c0a2013eeb58e837e2a8405190d7d2ca699b5 (patch)
treeace566cb43b69d4e9e9f836814d1a85b91172b0c
parentf71b934ce6686a1e9f83c5b73f5e828cd3475ab6 (diff)
[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
-rw-r--r--addons/sale/models/product_template.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/sale/models/product_template.py b/addons/sale/models/product_template.py
index 6d51984b51e..38a158948f5 100644
--- a/addons/sale/models/product_template.py
+++ b/addons/sale/models/product_template.py
@@ -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):