summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Martinelli <nim@odoo.com>2016-12-29 14:53:48 +0100
committerNicolas Martinelli <nim@odoo.com>2016-12-29 14:55:31 +0100
commit1e22870d2628e8b8019e8c499b96c8652f5bdfc4 (patch)
tree9be4c23f77f9fd6b03069e414d755724f592f37b
parent3667516a749c7056aa263b3c82679f526fff8cb2 (diff)
[FIX] product_margin: crash of read_group
Introduced by 9a479e657202c
-rw-r--r--addons/product_margin/models/product_product.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/addons/product_margin/models/product_product.py b/addons/product_margin/models/product_product.py
index 64ae6c4f7a6..6b9d71287d7 100644
--- a/addons/product_margin/models/product_product.py
+++ b/addons/product_margin/models/product_product.py
@@ -50,7 +50,7 @@ class ProductProduct(models.Model):
"""
Inherit read_group to calculate the sum of the non-stored fields, as it is not automatically done anymore through the XML.
"""
- res = super(ProductProduct, self).read_group(fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
+ res = super(ProductProduct, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
fields_list = ['turnover', 'sale_avg_price', 'sale_purchase_price', 'sale_num_invoiced', 'purchase_num_invoiced',
'sales_gap', 'purchase_gap', 'total_cost', 'sale_expected', 'normal_cost', 'total_margin',
'expected_margin', 'total_margin_rate', 'expected_margin_rate']
@@ -66,7 +66,7 @@ class ProductProduct(models.Model):
for prod in products:
prod_re[prod] = re_ind
re_ind += 1
- res_val = tot_products._compute_product_margin_fields_values([x for x in fields if fields in fields_list], '')
+ res_val = tot_products._compute_product_margin_fields_values(field_names=[x for x in fields if fields in fields_list])
for key in res_val.keys():
for l in res_val[key].keys():
re = res[prod_re[key]]