Skip to content
Snippets Groups Projects
Commit 3667516a authored by Nicolas Martinelli's avatar Nicolas Martinelli
Browse files

[FIX] product_margin: computed values

After commit 9a479e65, all values in the report are 0.0.

opw-695649
parent 18799641
Branches
Tags
No related merge requests found
......@@ -144,4 +144,6 @@ class ProductProduct(models.Model):
res[val.id]['total_margin_rate'] = res[val.id]['turnover'] and res[val.id]['total_margin'] * 100 / res[val.id]['turnover'] or 0.0
if 'expected_margin_rate' in field_names:
res[val.id]['expected_margin_rate'] = res[val.id]['sale_expected'] and res[val.id]['expected_margin'] * 100 / res[val.id]['sale_expected'] or 0.0
for k, v in res[val.id].items():
setattr(val, k, v)
return res
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment