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

[FIX] report_intrastat: product weight

- Create a product with 2 variants A & B
- Set a weight on the variants (btw, the weight field is not available
  on the template in this case)
- Create an invoice for A, validate

On the intrastat report, the weight remains 0.0.

The report clearly takes into account the weight of the template, not of
the variant. We use the product weight, and fall back on the template
weight.

opw-1913305

closes odoo/odoo#29178
parent 80a11ca2
No related branches found
No related tags found
No related merge requests found
......@@ -40,8 +40,8 @@ class ReportIntrastat(models.Model):
else 0
end) as value,
sum(
case when uom.category_id != puom.category_id then (pt.weight * inv_line.quantity)
else (pt.weight * inv_line.quantity * uom.factor) end
case when uom.category_id != puom.category_id then (coalesce(nullif(pp.weight, 0), pt.weight) * inv_line.quantity)
else (coalesce(nullif(pp.weight, 0), pt.weight) * inv_line.quantity * uom.factor) end
) as weight,
sum(
case when uom.category_id != puom.category_id then inv_line.quantity
......
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