From f99e5570584aa7ed3b2a311a0e568b596d4463d1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 16:43:46 +0100 Subject: [PATCH] [MIG] intrastat_base to v15 --- intrastat_base/__manifest__.py | 9 +++++---- intrastat_base/demo/intrastat_demo.xml | 8 +++++++- intrastat_base/models/account_chart_template.py | 3 ++- intrastat_base/models/account_fiscal_position.py | 3 +-- .../models/account_fiscal_position_template.py | 1 - intrastat_base/models/account_move.py | 2 +- intrastat_base/models/product_template.py | 14 +++++++++----- intrastat_base/models/res_company.py | 8 ++++---- intrastat_base/views/account_fiscal_position.xml | 2 +- intrastat_base/views/intrastat.xml | 4 ++-- intrastat_base/views/product_template.xml | 2 +- intrastat_base/views/res_config_settings.xml | 4 ++-- intrastat_base/views/res_partner.xml | 2 +- intrastat_base/wizards/res_config_settings.py | 4 ++-- setup/intrastat_base/odoo/addons/intrastat_base | 1 + setup/intrastat_base/setup.py | 6 ++++++ 16 files changed, 45 insertions(+), 28 deletions(-) create mode 120000 setup/intrastat_base/odoo/addons/intrastat_base create mode 100644 setup/intrastat_base/setup.py diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index e414249..a9d6fe8 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,15 +1,16 @@ -# Copyright 2011-2020 Akretion (http://www.akretion.com) -# Copyright 2018-2020 brain-tec AG (Kumar Aberer ) -# Copyright 2009-2020 Noviat (http://www.noviat.com) +# Copyright 2011-2021 Akretion (http://www.akretion.com) +# Copyright 2018-2021 brain-tec AG (Kumar Aberer ) +# Copyright 2009-2021 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Intrastat Reporting Base", - "version": "14.0.2.0.0", + "version": "15.0.1.0.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", "author": "ACSONE SA/NV, Akretion,Noviat,Odoo Community Association (OCA)", + "maintainers": ["alexis-via", "luc-demeyer"], "website": "https://github.com/OCA/intrastat-extrastat", "depends": ["base_vat", "account"], "excludes": ["account_intrastat"], diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index 6e6cd90..de17e22 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,10 +1,16 @@ + + + FR58441019213 diff --git a/intrastat_base/models/account_chart_template.py b/intrastat_base/models/account_chart_template.py index 939e9e2..e826e11 100644 --- a/intrastat_base/models/account_chart_template.py +++ b/intrastat_base/models/account_chart_template.py @@ -1,6 +1,7 @@ -# Copyright 2020 Akretion France (http://www.akretion.com/) +# Copyright 2020-2021 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + from odoo import models diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py index 0c56e59..b89c7c5 100644 --- a/intrastat_base/models/account_fiscal_position.py +++ b/intrastat_base/models/account_fiscal_position.py @@ -1,4 +1,4 @@ -# Copyright 2020 Akretion France (http://www.akretion.com/) +# Copyright 2020-2021 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -9,7 +9,6 @@ class AccountFiscalPosition(models.Model): _inherit = "account.fiscal.position" intrastat = fields.Boolean( - string="Intrastat", help="Set to True if the invoices with this fiscal position should " "be taken into account for the generation of the intrastat reports.", ) diff --git a/intrastat_base/models/account_fiscal_position_template.py b/intrastat_base/models/account_fiscal_position_template.py index 9085f53..a6a8a7a 100644 --- a/intrastat_base/models/account_fiscal_position_template.py +++ b/intrastat_base/models/account_fiscal_position_template.py @@ -8,7 +8,6 @@ class AccountFiscalPositionTemplate(models.Model): _inherit = "account.fiscal.position.template" intrastat = fields.Boolean( - string="Intrastat", help="Check this if you want to generate intrastat declarations with" "the created fiscal position", ) diff --git a/intrastat_base/models/account_move.py b/intrastat_base/models/account_move.py index 4ad7eb7..f510ff1 100644 --- a/intrastat_base/models/account_move.py +++ b/intrastat_base/models/account_move.py @@ -1,4 +1,4 @@ -# Copyright 2020 Akretion France (http://www.akretion.com/) +# Copyright 2020-2021 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 d63656c..d5f5777 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,4 +1,5 @@ -# Copyright 2010-2020 Akretion () +# Copyright 2010-2021 Akretion France (http://www.akretion.com/) +# @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models @@ -9,7 +10,6 @@ class ProductTemplate(models.Model): _inherit = "product.template" is_accessory_cost = fields.Boolean( - string="Is accessory cost", help="Activate this option for shipping costs, packaging " "costs and all services related to the sale of products. " "This option is used for Intrastat reports.", @@ -23,8 +23,12 @@ class ProductTemplate(models.Model): _( "The option 'Is accessory cost?' should only be " "activated on 'Service' products. You have activated " - "this option for the product '%s' which is of type " - "'%s'" + "this option for the product '{product_name}' which is " + "configured with type '{product_type}'." + ).format( + product_name=this.display_name, + product_type=this._fields["type"].convert_to_export( + this.type, this + ), ) - % (this.display_name, this.type) ) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 7a2dbc9..f7b5213 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,4 @@ -# Copyright 2013-2020 Akretion France (http://www.akretion.com/) +# Copyright 2013-2021 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -63,10 +63,10 @@ class ResCompany(models.Model): logger.warning(xml_bytes) logger.warning(e) usererror = "{}\n\n{}".format(e.__class__.__name__, str(e)) - raise UserError(usererror) - except Exception: + raise UserError(usererror) from e + except Exception as e: error = _("Unknown Error") tb = "".join(format_exception(*exc_info())) error += "\n%s" % tb logger.warning(error) - raise UserError(error) + raise UserError(error) from e diff --git a/intrastat_base/views/account_fiscal_position.xml b/intrastat_base/views/account_fiscal_position.xml index f67a1bd..78a107b 100644 --- a/intrastat_base/views/account_fiscal_position.xml +++ b/intrastat_base/views/account_fiscal_position.xml @@ -1,6 +1,6 @@ diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 4784270..befbd84 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 4854cdd..0d4bd9f 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 04c4b97..1c9ada8 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -1,8 +1,8 @@ diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 3b1d193..ea4e355 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 25e1b37..2b8adbd 100644 --- a/intrastat_base/wizards/res_config_settings.py +++ b/intrastat_base/wizards/res_config_settings.py @@ -1,5 +1,5 @@ -# Copyright 2017-2020 Akretion France (http://www.akretion.com/) -# Copyright 2018-2020 brain-tec AG (Kumar Aberer ) +# Copyright 2017-2021 Akretion France (http://www.akretion.com/) +# Copyright 2018-2021 brain-tec AG (Kumar Aberer ) # @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/setup/intrastat_base/odoo/addons/intrastat_base b/setup/intrastat_base/odoo/addons/intrastat_base new file mode 120000 index 0000000..74df3f8 --- /dev/null +++ b/setup/intrastat_base/odoo/addons/intrastat_base @@ -0,0 +1 @@ +../../../../intrastat_base \ No newline at end of file diff --git a/setup/intrastat_base/setup.py b/setup/intrastat_base/setup.py new file mode 100644 index 0000000..28c57bb --- /dev/null +++ b/setup/intrastat_base/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)