Skip to content

Commit

Permalink
Merge PR #216 into 15.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Feb 24, 2023
2 parents d4be5cc + e779af0 commit 77a0745
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions intrastat_product/models/intrastat_product_declaration.py
Original file line number Diff line number Diff line change
Expand Up @@ -648,6 +648,7 @@ def _gather_invoices(self, notedict):
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:

Expand Down Expand Up @@ -692,8 +693,8 @@ def _gather_invoices(self, notedict):
# 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:
Expand Down
1 change: 1 addition & 0 deletions intrastat_product/tests/test_brexit.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ def test_brexit_sale(self):
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,
}
)
Expand Down

0 comments on commit 77a0745

Please sign in to comment.