diff --git a/addons/report_intrastat/report/report_intrastat_report.py b/addons/report_intrastat/report/report_intrastat_report.py index 3ff63b4a4f6..1ca5dfb4bec 100644 --- a/addons/report_intrastat/report/report_intrastat_report.py +++ b/addons/report_intrastat/report/report_intrastat_report.py @@ -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