Skip to content

Commit

Permalink
[FIX] product_margin: crash of read_group
Browse files Browse the repository at this point in the history
Introduced by 9a479e6
  • Loading branch information
nim-odoo committed Dec 29, 2016
1 parent 3667516 commit 1e22870
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions addons/product_margin/models/product_product.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=Fals
"""
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']
Expand All @@ -66,7 +66,7 @@ def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=Fals
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]]
Expand Down

0 comments on commit 1e22870

Please sign in to comment.