From 1eafa04529e7581d3fa244fa4f44cb0814287e83 Mon Sep 17 00:00:00 2001 From: Aritz Olea Date: Fri, 22 Dec 2023 09:08:49 +0100 Subject: [PATCH] [FIX] l10n_eu_oss_oca: Set tax country_id as company's fiscal country --- l10n_eu_oss_oca/migrations/16.0.1.0.1/post-migration.py | 2 +- l10n_eu_oss_oca/tests/test_l10n_eu_oss.py | 2 +- l10n_eu_oss_oca/wizard/l10n_eu_oss_wizard.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/l10n_eu_oss_oca/migrations/16.0.1.0.1/post-migration.py b/l10n_eu_oss_oca/migrations/16.0.1.0.1/post-migration.py index f890de195..882f1638f 100644 --- a/l10n_eu_oss_oca/migrations/16.0.1.0.1/post-migration.py +++ b/l10n_eu_oss_oca/migrations/16.0.1.0.1/post-migration.py @@ -9,4 +9,4 @@ def migrate(cr, version): env = api.Environment(cr, SUPERUSER_ID, {}) oss_taxes = env["account.tax"].search([("oss_country_id", "!=", False)]) for oss_tax in oss_taxes: - oss_tax.country_id = oss_tax.company_id.country_id + oss_tax.country_id = oss_tax.company_id.account_fiscal_country_id diff --git a/l10n_eu_oss_oca/tests/test_l10n_eu_oss.py b/l10n_eu_oss_oca/tests/test_l10n_eu_oss.py index 7527fc05a..7c3aab391 100644 --- a/l10n_eu_oss_oca/tests/test_l10n_eu_oss.py +++ b/l10n_eu_oss_oca/tests/test_l10n_eu_oss.py @@ -138,4 +138,4 @@ def test_02(self): } ] ) - self.assertEqual(move.tax_country_id, move.company_id.country_id) + self.assertEqual(move.tax_country_id, move.company_id.account_fiscal_country_id) diff --git a/l10n_eu_oss_oca/wizard/l10n_eu_oss_wizard.py b/l10n_eu_oss_oca/wizard/l10n_eu_oss_wizard.py index 03956c905..a4e49faea 100644 --- a/l10n_eu_oss_oca/wizard/l10n_eu_oss_wizard.py +++ b/l10n_eu_oss_oca/wizard/l10n_eu_oss_wizard.py @@ -116,7 +116,7 @@ def _prepare_tax_vals(self, country_id, tax_id, rate, tax_group): return { "name": _("OSS for EU to %(country_name)s: %(rate)s") % {"country_name": country_id.name, "rate": rate}, - "country_id": self.company_id.country_id.id, + "country_id": self.company_id.account_fiscal_country_id.id, "amount": rate, "invoice_repartition_line_ids": self._prepare_repartition_line_vals( tax_id.invoice_repartition_line_ids