Merge PR #205 into 14.0

Signed-off-by pedrobaeza
This commit is contained in:
OCA-git-bot
2023-02-23 17:03:46 +00:00
2 changed files with 4 additions and 2 deletions

View File

@@ -662,6 +662,7 @@ class IntrastatProductDeclaration(models.Model):
domain = self._prepare_invoice_domain()
order = "journal_id, name"
invoices = self.env["account.move"].search(domain, order=order)
partner_model = self.env["res.partner"]
for invoice in invoices:
@@ -706,8 +707,8 @@ class IntrastatProductDeclaration(models.Model):
# 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()
partner_country_code = partner_model._get_intrastat_country_code(
country=partner_country, state=invoice.partner_shipping_id.state_id
)
if inv_intrastat_line:

View File

@@ -53,6 +53,7 @@ class TestIntrastatBrexit(IntrastatProductCommon, SavepointCase):
inv_out_xi = self.inv_obj.with_context(default_move_type="out_invoice").create(
{
"partner_id": self.partner_xi.id,
"partner_shipping_id": self.partner_xi.id,
"fiscal_position_id": self.position.id,
}
)