diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 17c5d0b..d574ac5 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,11 +1,11 @@ -# Copyright 2011-2021 Akretion (http://www.akretion.com) -# Copyright 2018-2021 brain-tec AG (Kumar Aberer ) -# Copyright 2009-2021 Noviat (http://www.noviat.com) +# Copyright 2011-2022 Akretion (http://www.akretion.com) +# Copyright 2018-2022 brain-tec AG (Kumar Aberer ) +# Copyright 2009-2022 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Intrastat Reporting Base", - "version": "15.0.1.0.1", + "version": "16.0.1.0.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index de17e22..f19b285 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,22 +1,64 @@ - - - FR58441019213 - - - BE0884025633 + + + Noviat + 1 + https://www.noviat.com + Avenue de Rusatiralaan 1 + Ganshoren + 1083 + + BE0820512013 + + + Acsone + 1 + https://www.acsone.eu + Drève Richelle, 167 + Waterloo + 1410 + + BE0835207216 + + + Tecnativa + 1 + https://www.tecnativa.com + Calle Tormos 1-A, 25 + Alicante + 03008 + + ESB87530432 + + + ForgeFlow + 1 + https://www.forgeflow.com + Rosselló 319, 6-1 + Barcelona + 08037 + + ESB66676008 + + + Akretion France + 1 + https://www.akretion.com + 27 rue Henri Rolland + Villeurbanne + 69100 + + FR86792377731 Shipping costs diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index cc10e08..cea19b9 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -3,4 +3,3 @@ from . import res_company from . import account_fiscal_position from . import account_fiscal_position_template from . import account_move -from . import res_partner diff --git a/intrastat_base/models/account_chart_template.py b/intrastat_base/models/account_chart_template.py index e826e11..0899413 100644 --- a/intrastat_base/models/account_chart_template.py +++ b/intrastat_base/models/account_chart_template.py @@ -1,4 +1,4 @@ -# Copyright 2020-2021 Akretion France (http://www.akretion.com/) +# Copyright 2020-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py index b89c7c5..dfb9be3 100644 --- a/intrastat_base/models/account_fiscal_position.py +++ b/intrastat_base/models/account_fiscal_position.py @@ -1,4 +1,4 @@ -# Copyright 2020-2021 Akretion France (http://www.akretion.com/) +# Copyright 2020-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/account_fiscal_position_template.py b/intrastat_base/models/account_fiscal_position_template.py index a6a8a7a..8b6c51e 100644 --- a/intrastat_base/models/account_fiscal_position_template.py +++ b/intrastat_base/models/account_fiscal_position_template.py @@ -1,4 +1,4 @@ -# Copyright 2020 Akretion France (http://www.akretion.com/) +# Copyright 2020-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/intrastat_base/models/account_move.py b/intrastat_base/models/account_move.py index f510ff1..83c13cb 100644 --- a/intrastat_base/models/account_move.py +++ b/intrastat_base/models/account_move.py @@ -1,4 +1,4 @@ -# Copyright 2020-2021 Akretion France (http://www.akretion.com/) +# Copyright 2020-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index d5f5777..b8da8d2 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,4 +1,4 @@ -# Copyright 2010-2021 Akretion France (http://www.akretion.com/) +# Copyright 2010-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index f7b5213..7198994 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,4 @@ -# Copyright 2013-2021 Akretion France (http://www.akretion.com/) +# Copyright 2013-2022 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/res_partner.py b/intrastat_base/models/res_partner.py deleted file mode 100644 index ed692b8..0000000 --- a/intrastat_base/models/res_partner.py +++ /dev/null @@ -1,67 +0,0 @@ -# Copyright 2022 Noviat. -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import _, api, models -from odoo.exceptions import UserError - -XI_COUNTY_NAMES = [ - "antrim", - "armagh", - "down", - "fermanagh", - "londonderry", - "tyrone", - "northern ireland", -] - -XI_COUNTIES = [ - "base.state_uk18", # County Antrim - "base.state_uk19", # County Armagh - "base.state_uk20", # County Down - "base.state_uk22", # County Fermanagh - "base.state_uk23", # County Londonderry - "base.state_uk24", # County Tyrone - "base.state_ie_27", # Antrim - "base.state_ie_28", # Armagh - "base.state_ie_29", # Down - "base.state_ie_30", # Fermanagh - "base.state_ie_31", # Londonderry - "base.state_ie_32", # Tyrone -] - - -class ResPartner(models.Model): - _inherit = "res.partner" - - @api.model - def _get_xi_counties(self): - return [self.env.ref(x) for x in XI_COUNTIES] - - @api.model - def _get_xu_counties(self): - uk_counties = self.env.ref("base.uk").state_ids - xu_counties = uk_counties.filtered(lambda r: r not in self._get_xi_counties()) - return xu_counties - - def _get_intrastat_country_code(self, country=None, state=None): - if self: - self.ensure_one() - country = self.country_id - state = self.state_id - else: - state = state or self.env["res.country.state"] - country = country or state.country_id - if not country: - raise UserError( - _("Programming Error when calling '_get_intrastat_country_code()") - ) - cc = country.code - if cc == "GB": - cc = "XU" - if state and cc in ["XU", "IE"]: - if ( - state in self._get_xi_counties() - or state.name.lower().strip() in XI_COUNTY_NAMES - ): - cc = "XI" - return cc diff --git a/intrastat_base/views/account_fiscal_position.xml b/intrastat_base/views/account_fiscal_position.xml index 78a107b..a52b5b4 100644 --- a/intrastat_base/views/account_fiscal_position.xml +++ b/intrastat_base/views/account_fiscal_position.xml @@ -1,6 +1,6 @@ @@ -25,4 +25,18 @@ + + account.fiscal.position + + + + + + + + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index befbd84..8469cd7 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,7 +1,7 @@ diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 0d4bd9f..93961c5 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,6 +1,6 @@ diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index 1c9ada8..2c82cd9 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -1,8 +1,8 @@ @@ -11,7 +11,7 @@ res.config.settings - +

Intrastat

diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index ea4e355..3fc4d2e 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,6 +1,6 @@ diff --git a/intrastat_base/wizards/res_config_settings.py b/intrastat_base/wizards/res_config_settings.py index 2b8adbd..9806cb4 100644 --- a/intrastat_base/wizards/res_config_settings.py +++ b/intrastat_base/wizards/res_config_settings.py @@ -1,5 +1,5 @@ -# Copyright 2017-2021 Akretion France (http://www.akretion.com/) -# Copyright 2018-2021 brain-tec AG (Kumar Aberer ) +# Copyright 2017-2022 Akretion France (http://www.akretion.com/) +# Copyright 2018-2022 brain-tec AG (Kumar Aberer ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).