[IMP] intrastat_product: Skip invoices according to partner country

Accidentally removed in 2646dc489e

TT38922
This commit is contained in:
Víctor Martínez
2022-09-09 17:07:02 +02:00
parent 4ae2f56426
commit 8336a94397

View File

@@ -691,6 +691,9 @@ class IntrastatProductDeclaration(models.Model):
partner_country = self._get_partner_country( partner_country = self._get_partner_country(
inv_line, notedict, eu_countries 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 = ( partner_country_code = (
invoice.commercial_partner_id._get_intrastat_country_code() invoice.commercial_partner_id._get_intrastat_country_code()
) )