From 8336a9439744c97127814c884ada1b468f428806 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Fri, 9 Sep 2022 17:07:02 +0200 Subject: [PATCH] [IMP] intrastat_product: Skip invoices according to partner country Accidentally removed in https://github.com/OCA/intrastat-extrastat/commit/2646dc489ed76000d5eb0356ded1a71d60bf5a67 TT38922 --- intrastat_product/models/intrastat_product_declaration.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/intrastat_product/models/intrastat_product_declaration.py b/intrastat_product/models/intrastat_product_declaration.py index 8e80a3d..3fef185 100644 --- a/intrastat_product/models/intrastat_product_declaration.py +++ b/intrastat_product/models/intrastat_product_declaration.py @@ -691,6 +691,9 @@ class IntrastatProductDeclaration(models.Model): partner_country = self._get_partner_country( inv_line, notedict, eu_countries ) + # When the country is the same as the company's country must be skipped. + if partner_country == self.company_id.country_id: + continue partner_country_code = ( invoice.commercial_partner_id._get_intrastat_country_code() )