From 034e1d37d9af08e11b3b36a31b436f7823ca737a Mon Sep 17 00:00:00 2001 From: Nicolas Martinelli Date: Mon, 17 Sep 2018 10:30:43 +0200 Subject: [PATCH] [FIX] report_intrastat: delivery address Complement of commit d5b46020c3cbedc41508, applied to the generic Intrastat report. opw-1878590 --- addons/report_intrastat/report/report_intrastat_report.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/report_intrastat/report/report_intrastat_report.py b/addons/report_intrastat/report/report_intrastat_report.py index 40dd21df0a8..012fd84ea1b 100644 --- a/addons/report_intrastat/report/report_intrastat_report.py +++ b/addons/report_intrastat/report/report_intrastat_report.py @@ -66,7 +66,7 @@ class ReportIntrastat(models.Model): left join report_intrastat_code intrastat on pt.intrastat_id = intrastat.id left join (res_partner inv_address left join res_country inv_country on (inv_country.id = inv_address.country_id)) - on (inv_address.id = inv.partner_id) + on (inv_address.id = coalesce(inv.partner_shipping_id, inv.partner_id)) where inv.state in ('open','paid') and inv_line.product_id is not null