From 560dd7e9157ea99156cc5b2d4accd48479cd989d Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 5 Apr 2011 00:57:21 +0200 Subject: [PATCH 01/90] [ADD] intrastat_base: Redesign for 6.1 Complete change of design for intrastat_type ! Now that report_intrastat_product/service object is stored in database, we don't need the legal_intrastat state on invoices any more, because we will be able to create entry lines for DEB for a repair of equipment under warranty without using a legal_intrastat. Report_intrastat_type is now only required for DEB -> object moved to module l10n_fr_intrastat_product. For DEB, the button "regenerate lines" only regenerate DEB lines related to invoices. Renamed intrastat base module, because it doesn't have France-specific parameters any more. Add demo data. Full re-design of intrastat types : probably requires deleting the report_intrastat_type table, restarting OpenERP and re-creating intrastat types. Moved intrastat departments from stock.warehouse to stock.location. Dropped SQL queries ; replaced by traditionnal python code logic. No more need to have one rate per day for invoices with foreign currency. Add total fiscal value for DEB More code factorization. Prepare translation work. Moved some demo data from l10n_fr_intrastat_product to intrastat_base Moved configuration about taxes from company form to tax form Some modifications to ease v5 -> v6 migration : - object report_intrastat_code now belong to group account manager - button functions now return True Tried to implement the following feature : open attachement form when the XML file as been generated : works on v6, but make client crash en v5 -> code has been commented DEB lines with procedure code = 25 are now deducted from the fiscal total. Round invoice total. Moved the field exclude_from_intrastat_if_present of account.tax from l10n_fr_intrastat_product to intrastat_base, because it should also be used in the module l10n_fr_intrastat_service. Take this field into account in the generation of DEB lines (module l10n_fr_intrastat_service). It is now possible to set the H.S. code on the product category. Some "return None" changed to "return True" Implemented the fiscal representative : for example, when you ship to the EU but invoice outside of the EU, your customer needs to have a fiscal representative inside the EU, which will be used for the DEB . depend on base_vat instead of account. Same modification as my previous commit for DEB : when we sell to a physical person in the EU with VAT, the move is not declared in DEB, so it must not block with a "raise" if the partner doesn't have a VAT number. Add option "is_accessory_cost" on product.template : If the invoice has is_accessory_cost services but no regular product -> DES If the invoice has is_accessory_cost services and regular product -> added to the cost of products in DEB Now allows "pricelist for statistical value" which is not in EUR (the currency conversion will be made from the pricelist currency to EUR) Usability improvements : - Order for DEB and DES tree view : "the more recent at the top" - distinction between "Information to declare" and "Additionnal information" in intrastat lines Better string. Update French translation. Use the new logger API of OpenERP 6.1 Move the "EU fiscal representative" field in order to avoid the "compression" of the VAT field that made it too small. Code clean-up : - context is not passed in constraints - don't use lambda when not necessary IMPORTANT CHANGE : - All EU countries should now be intrastat=True, including your own country - When generating lines for Intrastat Product/Service, all invoices for which country == Company's country are excluded Update help message according to my change of commit 61. Fix copyright header. --- intrastat_base/__init__.py | 28 ++++ intrastat_base/__openerp__.py | 54 ++++++ intrastat_base/country.py | 35 ++++ intrastat_base/country_data.xml | 87 ++++++++++ intrastat_base/country_view.xml | 36 ++++ intrastat_base/i18n/fr_FR.po | 176 ++++++++++++++++++++ intrastat_base/i18n/intrastat_base.pot | 166 ++++++++++++++++++ intrastat_base/intrastat_common.py | 132 +++++++++++++++ intrastat_base/intrastat_demo.xml | 57 +++++++ intrastat_base/intrastat_menu.xml | 16 ++ intrastat_base/partner_address.py | 35 ++++ intrastat_base/product.py | 49 ++++++ intrastat_base/product_view.xml | 53 ++++++ intrastat_base/security/ir.model.access.csv | 2 + intrastat_base/tax.py | 33 ++++ intrastat_base/tax_view.xml | 28 ++++ 16 files changed, 987 insertions(+) create mode 100644 intrastat_base/__init__.py create mode 100644 intrastat_base/__openerp__.py create mode 100644 intrastat_base/country.py create mode 100644 intrastat_base/country_data.xml create mode 100644 intrastat_base/country_view.xml create mode 100644 intrastat_base/i18n/fr_FR.po create mode 100644 intrastat_base/i18n/intrastat_base.pot create mode 100644 intrastat_base/intrastat_common.py create mode 100644 intrastat_base/intrastat_demo.xml create mode 100644 intrastat_base/intrastat_menu.xml create mode 100644 intrastat_base/partner_address.py create mode 100644 intrastat_base/product.py create mode 100644 intrastat_base/product_view.xml create mode 100644 intrastat_base/security/ir.model.access.csv create mode 100644 intrastat_base/tax.py create mode 100644 intrastat_base/tax_view.xml diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py new file mode 100644 index 0000000..13ca149 --- /dev/null +++ b/intrastat_base/__init__.py @@ -0,0 +1,28 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +import country +import product +import tax +import partner_address +import intrastat_common + diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py new file mode 100644 index 0000000..089173a --- /dev/null +++ b/intrastat_base/__openerp__.py @@ -0,0 +1,54 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +{ + 'name': 'Base module for Intrastat reporting', + 'version': '1.1', + 'category': 'Localisation/Report Intrastat', + 'license': 'AGPL-3', + 'description': """This module contains the common functions for 2 other modules : +- l10n_fr_intrastat_service : the module for the "Déclaration Européenne des Services" (DES) +- l10n_fr_intrastat_product : the module for the "Déclaration d'Echange de Biens" (DEB) +This module is not usefull if it's not used together with one of those 2 modules. + +This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries. + +WARNING : this module conflicts with the module "report_intrastat" from the addons. If you have already installed the module "report_intrastat", you should uninstall it first before installing this module. + +Please contact Alexis de Lattre from Akretion for any help or question about this module. + """, + 'author': 'Akretion', + 'website': 'http://www.akretion.com', + 'depends': ['base_vat'], + 'init_xml': ['country_data.xml'], + 'update_xml': [ + 'security/ir.model.access.csv', + 'product_view.xml', + 'country_view.xml', + 'tax_view.xml', + 'intrastat_menu.xml', + ], + 'demo_xml': ['intrastat_demo.xml'], + 'installable': True, + 'active': False, +} diff --git a/intrastat_base/country.py b/intrastat_base/country.py new file mode 100644 index 0000000..2542d72 --- /dev/null +++ b/intrastat_base/country.py @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields + +class res_country(osv.osv): + _inherit = 'res.country' + _columns = { + 'intrastat': fields.boolean('EU country', help="Set to True for all European Union countries."), + } + + _defaults = { + 'intrastat': False, + } + +res_country() diff --git a/intrastat_base/country_data.xml b/intrastat_base/country_data.xml new file mode 100644 index 0000000..04fb439 --- /dev/null +++ b/intrastat_base/country_data.xml @@ -0,0 +1,87 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/intrastat_base/country_view.xml b/intrastat_base/country_view.xml new file mode 100644 index 0000000..bf62fa3 --- /dev/null +++ b/intrastat_base/country_view.xml @@ -0,0 +1,36 @@ + + + + + + + + + + intrastat.base.country.tree + res.country + + + + + + + + + + intrastat.base.country.form + res.country + + + + + + + + + + + diff --git a/intrastat_base/i18n/fr_FR.po b/intrastat_base/i18n/fr_FR.po new file mode 100644 index 0000000..c3a85fe --- /dev/null +++ b/intrastat_base/i18n/fr_FR.po @@ -0,0 +1,176 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.4\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2012-06-05 13:28+0000\n" +"PO-Revision-Date: 2012-06-05 13:28+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: intrastat_base +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +msgid "Intrastat reporting" +msgstr "DEB et DES" + +#. module: intrastat_base +#: sql_constraint:res.country:0 +msgid "The code of the country must be unique !" +msgstr "Le code du pays doit être unique !" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "Erreur: l'UdM par défaut et l'UdM d'achat doivent appartenir à la même catégorie." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:64 +#: code:addons/intrastat_base/intrastat_common.py:70 +#: code:addons/intrastat_base/intrastat_common.py:85 +#: code:addons/intrastat_base/intrastat_common.py:93 +#: code:addons/intrastat_base/product.py:41 +#, python-format +msgid "Error :" +msgstr "Erreur :" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_tax +msgid "account.tax" +msgstr "account.tax" + +#. module: intrastat_base +#: field:account.tax,exclude_from_intrastat_if_present:0 +msgid "Exclude invoice line from intrastat if this tax is present" +msgstr "Exclue la ligne de facture de la DEB/DES si cette taxe est présente" + +#. module: intrastat_base +#: help:res.country,intrastat:0 +msgid "Set as True for countries that must be selected in the intrastat reports, i.e. for all European Union countries other than your own country." +msgstr "Activer cette option pour les pays qui doivent être inclus dans la DEB et la DES, i.e. tous les pays de l'Union Européenne sauf votre propre pays." + +#. module: intrastat_base +#: view:product.product:0 +#: view:product.template:0 +msgid "Intrastat properties" +msgstr "Paramètres pour la DEB et la DES" + +#. module: intrastat_base +#: model:ir.module.module,description:intrastat_base.module_meta_information +msgid "This module contains the common functions for 2 other modules :\n" +"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" +"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" +"This module is not usefull if it's not used together with one of those 2 modules.\n" +"\n" +"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" +"\n" +"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" +"\n" +"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" +" " +msgstr "This module contains the common functions for 2 other modules :\n" +"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" +"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" +"This module is not usefull if it's not used together with one of those 2 modules.\n" +"\n" +"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" +"\n" +"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" +"\n" +"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" +" " + +#. module: intrastat_base +#: sql_constraint:res.country:0 +msgid "The name of the country must be unique !" +msgstr "Le nom du pays doit être unique !" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error msg is in raise" +msgstr "Error msg is in raise" + +#. module: intrastat_base +#: help:account.tax,exclude_from_intrastat_if_present:0 +msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture ne sera pas prise en compte lors de la génération de la DEB et de la DES depuis les factures." + +#. module: intrastat_base +#: field:product.template,is_accessory_cost:0 +msgid "Is accessory cost" +msgstr "Frais accessoires" + +#. module: intrastat_base +#: field:res.country,intrastat:0 +msgid "Intrastat country" +msgstr "Pays intrastat" + +#. module: intrastat_base +#: help:product.template,exclude_from_intrastat:0 +msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." +msgstr "Si l'option est activée, le produit ou service ne sera pris en compte ni pour la DEB ni pour la DES. Cette option doit donc rester désactivée sauf si vous avez une très bonne raison." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:64 +#, python-format +msgid "The company currency must be 'EUR', but is currently '%s'." +msgstr "La monnaie de la société doit être 'EUR', mais est actuellement '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:70 +#, python-format +msgid "The VAT number is not set for the partner '%s'." +msgstr "Le numéro de TVA n'est pas renseigné pour le partenaire '%s'." + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_report_intrastat_common +msgid "Common functions for intrastat reports for products and services" +msgstr "Common functions for intrastat reports for products and services" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_country +msgid "Country" +msgstr "Pays" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product Template" +msgstr "Modèle de produit" + +#. module: intrastat_base +#: model:ir.module.module,shortdesc:intrastat_base.module_meta_information +msgid "Base module for Intrastat reporting" +msgstr "Module de base pour les rapports intrastat" + +#. module: intrastat_base +#: field:product.template,exclude_from_intrastat:0 +msgid "Exclude from Intrastat reports" +msgstr "Exclure de la DEB et de la DES" + +#. module: intrastat_base +#: help:product.template,is_accessory_cost:0 +msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +msgstr "Activez cette option pour les frais de port, les frais d'emballage et tous les services liés à la vente de produits physiques. Cette option est utilisée pour la DEB et la DES." + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "Frais de port" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:85 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." +msgstr "La validation du fichier XML avec le schéma XML officiel a échoué. Le fichier XML généré et le détail de l'erreur ont été écrits dans les logs du serveur. Voici le message d'erreur, qui peut vous donner une idée de la cause du problème : %s." + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_partner_address +msgid "Partner Addresses" +msgstr "Carnet d'adresses" + diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot new file mode 100644 index 0000000..d7baf12 --- /dev/null +++ b/intrastat_base/i18n/intrastat_base.pot @@ -0,0 +1,166 @@ +# Translation of OpenERP Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: OpenERP Server 6.0.4\n" +"Report-Msgid-Bugs-To: support@openerp.com\n" +"POT-Creation-Date: 2012-06-05 13:28+0000\n" +"PO-Revision-Date: 2012-06-05 13:28+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: intrastat_base +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +msgid "Intrastat reporting" +msgstr "" + +#. module: intrastat_base +#: sql_constraint:res.country:0 +msgid "The code of the country must be unique !" +msgstr "" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error: The default UOM and the purchase UOM must be in the same category." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:64 +#: code:addons/intrastat_base/intrastat_common.py:70 +#: code:addons/intrastat_base/intrastat_common.py:85 +#: code:addons/intrastat_base/intrastat_common.py:93 +#: code:addons/intrastat_base/product.py:41 +#, python-format +msgid "Error :" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_tax +msgid "account.tax" +msgstr "" + +#. module: intrastat_base +#: field:account.tax,exclude_from_intrastat_if_present:0 +msgid "Exclude invoice line from intrastat if this tax is present" +msgstr "" + +#. module: intrastat_base +#: help:res.country,intrastat:0 +msgid "Set as True for countries that must be selected in the intrastat reports, i.e. for all European Union countries other than your own country." +msgstr "" + +#. module: intrastat_base +#: view:product.product:0 +#: view:product.template:0 +msgid "Intrastat properties" +msgstr "" + +#. module: intrastat_base +#: model:ir.module.module,description:intrastat_base.module_meta_information +msgid "This module contains the common functions for 2 other modules :\n" +"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" +"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" +"This module is not usefull if it's not used together with one of those 2 modules.\n" +"\n" +"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" +"\n" +"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" +"\n" +"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" +" " +msgstr "" + +#. module: intrastat_base +#: sql_constraint:res.country:0 +msgid "The name of the country must be unique !" +msgstr "" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error msg is in raise" +msgstr "" + +#. module: intrastat_base +#: help:account.tax,exclude_from_intrastat_if_present:0 +msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgstr "" + +#. module: intrastat_base +#: field:product.template,is_accessory_cost:0 +msgid "Is accessory cost" +msgstr "" + +#. module: intrastat_base +#: field:res.country,intrastat:0 +msgid "Intrastat country" +msgstr "" + +#. module: intrastat_base +#: help:product.template,exclude_from_intrastat:0 +msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:64 +#, python-format +msgid "The company currency must be 'EUR', but is currently '%s'." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:70 +#, python-format +msgid "The VAT number is not set for the partner '%s'." +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_report_intrastat_common +msgid "Common functions for intrastat reports for products and services" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_country +msgid "Country" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product Template" +msgstr "" + +#. module: intrastat_base +#: model:ir.module.module,shortdesc:intrastat_base.module_meta_information +msgid "Base module for Intrastat reporting" +msgstr "" + +#. module: intrastat_base +#: field:product.template,exclude_from_intrastat:0 +msgid "Exclude from Intrastat reports" +msgstr "" + +#. module: intrastat_base +#: help:product.template,is_accessory_cost:0 +msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +msgstr "" + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:85 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_partner_address +msgid "Partner Addresses" +msgstr "" + diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py new file mode 100644 index 0000000..8320b8a --- /dev/null +++ b/intrastat_base/intrastat_common.py @@ -0,0 +1,132 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/). All rights reserved. +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields +from datetime import datetime +from dateutil.relativedelta import relativedelta +from tools.translate import _ + +class report_intrastat_common(osv.osv_memory): + _name = "report.intrastat.common" + _description = "Common functions for intrastat reports for products and services" + + def _compute_numbers(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + total_amount = 0.0 + num_lines = 0 + for line in intrastat.intrastat_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + result[intrastat.id] = {'num_lines': num_lines, 'total_amount': total_amount} + return result + + + def _compute_end_date(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + start_date_datetime = datetime.strptime(intrastat.start_date, '%Y-%m-%d') + end_date_str = datetime.strftime(start_date_datetime + relativedelta(day=31), '%Y-%m-%d') + result[intrastat.id] = end_date_str + return result + + + def _check_start_date(self, cr, uid, ids, object, context=None): + '''Check that the start date is the first day of the month''' + for date_to_check in object.read(cr, uid, ids, ['start_date'], context=context): + datetime_to_check = datetime.strptime(date_to_check['start_date'], '%Y-%m-%d') + if datetime_to_check.day != 1: + return False + return True + + + def _check_generate_lines(self, cr, uid, intrastat, context=None): + if not intrastat.company_id.country_id: + raise osv.except_osv(_('Error :'), _("The country is not set on the company '%s'.") %intrastat.company_id.name) + if not intrastat.currency_id.name == 'EUR': + raise osv.except_osv(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") %intrastat.currency_id.name) + return True + + + def _check_generate_xml(self, cr, uid, intrastat, context=None): + if not intrastat.company_id.partner_id.vat: + raise osv.except_osv(_('Error :'), _("The VAT number is not set for the partner '%s'.") %intrastat.company_id.partner_id.name) + return True + + + def _check_xml_schema(self, cr, uid, xml_root, xml_string, xsd, context=None): + '''Validate the XML file against the XSD''' + from lxml import etree + official_des_xml_schema = etree.XMLSchema(etree.fromstring(xsd)) + try: official_des_xml_schema.assertValid(xml_root) + except Exception, e: # if the validation of the XSD fails, we arrive here + import logging + _logger = logging.getLogger(__name__) + _logger.warning("The XML file is invalid against the XML Schema Definition") + _logger.warning(xml_string) + _logger.warning(e) + raise osv.except_osv(_('Error :'), _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s.') % str(e)) + return True + + + def _attach_xml_file(self, cr, uid, ids, object, xml_string, start_date_datetime, declaration_name, context=None): + '''Attach the XML file to the report_intrastat_product/service object''' + import base64 + if len(ids) != 1: + raise osv.except_osv(_('Error :'), 'Hara kiri in attach_xml_file') + filename = datetime.strftime(start_date_datetime, '%Y-%m') + '_' + declaration_name + '.xml' + attach_name = declaration_name.upper() + ' ' + datetime.strftime(start_date_datetime, '%Y-%m') + attach_obj = self.pool.get('ir.attachment') + if not context: + context = {} + context.update({'default_res_id' : ids[0], 'default_res_model': object._name}) + attach_id = attach_obj.create(cr, uid, {'name': attach_name, 'datas': base64.encodestring(xml_string), 'datas_fname': filename}, context=context) + return attach_id + + + def _open_attach_view(self, cr, uid, attach_id, title='XML file', context=None): + '''Returns an action which opens the form view of the corresponding attachement''' + # Only works in v6 -> not used in v5 + action = { + 'name': title, + 'view_type': 'form', + 'view_mode': 'form,tree', + 'view_id': False, + 'res_model': 'ir.attachment', + 'type': 'ir.actions.act_window', + 'nodestroy': True, + 'target': 'current', + 'res_id': [attach_id], + } + return action + + + def partner_on_change(self, cr, uid, ids, partner_id=False): + result = {} + result['value'] = {} + if partner_id: + company = self.pool.get('res.partner').read(cr, uid, partner_id, ['vat']) + result['value'].update({'partner_vat': company['vat']}) + return result + +report_intrastat_common() + diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/intrastat_demo.xml new file mode 100644 index 0000000..d83640e --- /dev/null +++ b/intrastat_base/intrastat_demo.xml @@ -0,0 +1,57 @@ + + + + + + + + + FR58441019213 + + + + BE0828696437 + True + + + + BE0443167858 + True + + + + BE0884025633 + True + + + + True + + + + True + + + + True + + + + True + + + + Shipping costs + SHIP + service + + 30 + True + + + + diff --git a/intrastat_base/intrastat_menu.xml b/intrastat_base/intrastat_menu.xml new file mode 100644 index 0000000..b078c6a --- /dev/null +++ b/intrastat_base/intrastat_menu.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + diff --git a/intrastat_base/partner_address.py b/intrastat_base/partner_address.py new file mode 100644 index 0000000..f36329b --- /dev/null +++ b/intrastat_base/partner_address.py @@ -0,0 +1,35 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/) All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields + +# We want to have the country field on res_partner_address always set +# because the selection of invoices for intrastat reports is based +# on the country of the invoice partner address ! +class res_partner_address(osv.osv): + _inherit = 'res.partner.address' + _columns = { + 'country_id': fields.many2one('res.country', 'Country', required=True), + } + +res_partner_address() + diff --git a/intrastat_base/product.py b/intrastat_base/product.py new file mode 100644 index 0000000..c535a72 --- /dev/null +++ b/intrastat_base/product.py @@ -0,0 +1,49 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2010-2012 Akretion (http://www.akretion.com/) All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields +from tools.translate import _ + +class product_template(osv.osv): + _inherit = "product.template" + _columns = { + 'exclude_from_intrastat': fields.boolean('Exclude from Intrastat reports', help="If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason."), + 'is_accessory_cost' : fields.boolean('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.'), + } + + _defaults = { + 'exclude_from_intrastat': False, + } + + + def _check_accessory_cost(self, cr, uid, ids): + for product in self.browse(cr, uid, ids): + if product.is_accessory_cost and product.type != 'service': + raise osv.except_osv(_('Error :'), _("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'" % (product.name, product.type))) + return True + + _constraints = [ + (_check_accessory_cost, "Error msg is in raise", ['is_accessory_cost', 'type']) + ] + +product_template() + diff --git a/intrastat_base/product_view.xml b/intrastat_base/product_view.xml new file mode 100644 index 0000000..28b026e --- /dev/null +++ b/intrastat_base/product_view.xml @@ -0,0 +1,53 @@ + + + + + + + + + + intrastat.base.product.normal.form + product.product + + + + + + + + + + + + + + + + + + + intrastat.base.product.template.form + product.template + + + + + + + + + + + + + + + + + + diff --git a/intrastat_base/security/ir.model.access.csv b/intrastat_base/security/ir.model.access.csv new file mode 100644 index 0000000..d7a2bf1 --- /dev/null +++ b/intrastat_base/security/ir.model.access.csv @@ -0,0 +1,2 @@ +"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" +"access_report_intrastat_common","Read access on report.intrastat.common","model_report_intrastat_common","base.group_user",1,0,0,0 diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py new file mode 100644 index 0000000..4d12d32 --- /dev/null +++ b/intrastat_base/tax.py @@ -0,0 +1,33 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for OpenERP +# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from osv import osv, fields + + +class account_tax(osv.osv): + _inherit = "account.tax" + _columns = { + 'exclude_from_intrastat_if_present': fields.boolean('Exclude invoice line from intrastat if this tax is present', help="If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices."), + } + +account_tax() + diff --git a/intrastat_base/tax_view.xml b/intrastat_base/tax_view.xml new file mode 100644 index 0000000..e60a327 --- /dev/null +++ b/intrastat_base/tax_view.xml @@ -0,0 +1,28 @@ + + + + + + + + + + intrastat.base.tax + account.tax + form + + + + + + + + + + + + From cd5578635b0718a96ae381ddb1bf61b31bebdfca Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 24 Apr 2013 10:55:14 +0200 Subject: [PATCH 02/90] [MIG] intrastat_base: Migration to 7.0 Should now be compatible with both OCB and RS-OCB Add field import_obligation_level on res.company Add group group_detailed_intrastat_product, so that companies that only use obligation = simplified don't see all the additionnal fields. Remove transaction code corresponding to repairs in intrastat types Better on_change on intrastat types (code is mutualised with field.function) Update syntax : demo_xml/update_xml/init_xml -> data/demo Welcome to Croatia in the European Union ! Add an e-mail reminder for l10n_fr_intrastat_product and l10n_fr_intrastat_service (hope that Akretion France won't forget it's own declarations now !!!) On report.intrastat.product and report.intrastat.service : add copy() fonctions, tracking of important fields, a year_month function field and enhance views. Remove date_done field (the tracking in the chatter does the job). Remove class instanciation in the code. Better form view of product category, courtesy of David Beal. Raise an explicit exception (take into account Stefan remark on the merge proposal) Fix to make the module truly usable when user is not part of the group "Detailed intrastat product". Remove dead code and fields that was used when we had to put DEB lines for repair operations (a thing of the past !). Update coding style. Reduce the number of flake8 warnings. On OpenERP 7, when you have the document module installed and you download the attachement via the drop down list on the form view, the name of the file will be the name of the attachement and not datas_fname ; so we need to have name = datas_fname. --- intrastat_base/__init__.py | 14 ++--- intrastat_base/__openerp__.py | 15 ++--- intrastat_base/company.py | 62 ++++++++++++++++++ intrastat_base/company_view.xml | 29 +++++++++ intrastat_base/country.py | 7 +-- intrastat_base/country_data.xml | 3 + intrastat_base/country_view.xml | 4 +- intrastat_base/intrastat_common.py | 63 ++++++++++--------- intrastat_base/intrastat_demo.xml | 8 +-- intrastat_base/intrastat_menu.xml | 2 +- .../{partner_address.py => partner.py} | 16 +++-- intrastat_base/product.py | 20 +++--- intrastat_base/product_view.xml | 32 ++++------ intrastat_base/tax.py | 9 +-- intrastat_base/tax_view.xml | 4 +- 15 files changed, 186 insertions(+), 102 deletions(-) create mode 100644 intrastat_base/company.py create mode 100644 intrastat_base/company_view.xml rename intrastat_base/{partner_address.py => partner.py} (77%) diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 13ca149..8e2eaa0 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ # ############################################################################## -import country -import product -import tax -import partner_address -import intrastat_common - +from . import country +from . import product +from . import tax +from . import partner +from . import company +from . import intrastat_common diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 089173a..973786b 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -22,14 +22,15 @@ { - 'name': 'Base module for Intrastat reporting', + 'name': 'Intrastat Reporting Base', 'version': '1.1', 'category': 'Localisation/Report Intrastat', 'license': 'AGPL-3', + 'summary': 'Base module for Intrastat reporting', 'description': """This module contains the common functions for 2 other modules : - l10n_fr_intrastat_service : the module for the "Déclaration Européenne des Services" (DES) - l10n_fr_intrastat_product : the module for the "Déclaration d'Echange de Biens" (DEB) -This module is not usefull if it's not used together with one of those 2 modules. +This module is not usefull if it's not used together with one of those 2 modules or other country-specific intrastat modules. This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries. @@ -40,15 +41,15 @@ Please contact Alexis de Lattre from Akretion for 'author': 'Akretion', 'website': 'http://www.akretion.com', 'depends': ['base_vat'], - 'init_xml': ['country_data.xml'], - 'update_xml': [ - 'security/ir.model.access.csv', + 'data': [ + 'country_data.xml', 'product_view.xml', 'country_view.xml', 'tax_view.xml', + 'company_view.xml', 'intrastat_menu.xml', ], - 'demo_xml': ['intrastat_demo.xml'], + 'demo': ['intrastat_demo.xml'], 'installable': True, 'active': False, } diff --git a/intrastat_base/company.py b/intrastat_base/company.py new file mode 100644 index 0000000..69163f5 --- /dev/null +++ b/intrastat_base/company.py @@ -0,0 +1,62 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Intrastat base module for OpenERP +# Copyright (C) 2013 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from openerp.osv import orm, fields +from openerp.tools.translate import _ + + +class res_company(orm.Model): + _inherit = "res.company" + + def _compute_intrastat_email_list(self, cr, uid, ids, name, arg, context=None): + result = {} + for company in self.browse(cr, uid, ids, context=context): + result[company.id] = '' + for user in company.intrastat_remind_user_ids: + if result[company.id]: + result[company.id] += ',%s' % (user.email) + else: + result[company.id] = user.email + return result + + _columns = { + 'intrastat_remind_user_ids': fields.many2many('res.users', + id1='company_id', id2='user_id', + string="Users Receiving the Intrastat Reminder", + help="List of OpenERP users who will receive a notification to remind them about the Intrastat declaration."), + 'intrastat_email_list': fields.function(_compute_intrastat_email_list, + type='char', size=1000, + string='List of emails of Users Receiving the Intrastat Reminder', + help='Comma-separated list of email addresses of Users Receiving the Intrastat Reminder. For use in the email template.'), + } + + def _check_intrastat_remind_users(self, cr, uid, ids): + for company in self.browse(cr, uid, ids): + for user in company.intrastat_remind_user_ids: + if not user.email: + raise orm.except_orm(_('Error :'), _("Missing e-mail address on user '%s'.") % (user.name)) + return True + + _constraints = [ + (_check_intrastat_remind_users, "error msg in raise", + ['intrastat_remind_user_ids']), + ] diff --git a/intrastat_base/company_view.xml b/intrastat_base/company_view.xml new file mode 100644 index 0000000..14cf1fe --- /dev/null +++ b/intrastat_base/company_view.xml @@ -0,0 +1,29 @@ + + + + + + + + + intrastat.company.form + res.company + + + + + + + + + + + + + + + diff --git a/intrastat_base/country.py b/intrastat_base/country.py index 2542d72..2cb923f 100644 --- a/intrastat_base/country.py +++ b/intrastat_base/country.py @@ -20,9 +20,10 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import orm, fields -class res_country(osv.osv): + +class res_country(orm.Model): _inherit = 'res.country' _columns = { 'intrastat': fields.boolean('EU country', help="Set to True for all European Union countries."), @@ -31,5 +32,3 @@ class res_country(osv.osv): _defaults = { 'intrastat': False, } - -res_country() diff --git a/intrastat_base/country_data.xml b/intrastat_base/country_data.xml index 04fb439..c77f548 100644 --- a/intrastat_base/country_data.xml +++ b/intrastat_base/country_data.xml @@ -83,5 +83,8 @@ + + + diff --git a/intrastat_base/country_view.xml b/intrastat_base/country_view.xml index bf62fa3..87e7ec9 100644 --- a/intrastat_base/country_view.xml +++ b/intrastat_base/country_view.xml @@ -1,7 +1,7 @@ @@ -26,7 +26,7 @@ - + diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 8320b8a..7a21a62 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/). All rights reserved. +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). All rights reserved. # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,12 +20,16 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import orm +from openerp.tools.translate import _ from datetime import datetime from dateutil.relativedelta import relativedelta -from tools.translate import _ +import logging -class report_intrastat_common(osv.osv_memory): +logger = logging.getLogger(__name__) + + +class report_intrastat_common(orm.TransientModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products and services" @@ -40,16 +44,17 @@ class report_intrastat_common(osv.osv_memory): result[intrastat.id] = {'num_lines': num_lines, 'total_amount': total_amount} return result - - def _compute_end_date(self, cr, uid, ids, object, context=None): + def _compute_dates(self, cr, uid, ids, object, context=None): result = {} for intrastat in object.browse(cr, uid, ids, context=context): start_date_datetime = datetime.strptime(intrastat.start_date, '%Y-%m-%d') end_date_str = datetime.strftime(start_date_datetime + relativedelta(day=31), '%Y-%m-%d') - result[intrastat.id] = end_date_str + result[intrastat.id] = { + 'end_date': end_date_str, + 'year_month': start_date_datetime.strftime('%Y-%m'), + } return result - def _check_start_date(self, cr, uid, ids, object, context=None): '''Check that the start date is the first day of the month''' for date_to_check in object.read(cr, uid, ids, ['start_date'], context=context): @@ -58,54 +63,47 @@ class report_intrastat_common(osv.osv_memory): return False return True - def _check_generate_lines(self, cr, uid, intrastat, context=None): if not intrastat.company_id.country_id: - raise osv.except_osv(_('Error :'), _("The country is not set on the company '%s'.") %intrastat.company_id.name) + raise orm.except_orm(_('Error :'), _("The country is not set on the company '%s'.") % intrastat.company_id.name) if not intrastat.currency_id.name == 'EUR': - raise osv.except_osv(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") %intrastat.currency_id.name) + raise orm.except_orm(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") % intrastat.currency_id.name) return True - def _check_generate_xml(self, cr, uid, intrastat, context=None): if not intrastat.company_id.partner_id.vat: - raise osv.except_osv(_('Error :'), _("The VAT number is not set for the partner '%s'.") %intrastat.company_id.partner_id.name) + raise orm.except_orm(_('Error :'), _("The VAT number is not set for the partner '%s'.") % intrastat.company_id.partner_id.name) return True - def _check_xml_schema(self, cr, uid, xml_root, xml_string, xsd, context=None): '''Validate the XML file against the XSD''' from lxml import etree official_des_xml_schema = etree.XMLSchema(etree.fromstring(xsd)) - try: official_des_xml_schema.assertValid(xml_root) + try: + official_des_xml_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here import logging _logger = logging.getLogger(__name__) _logger.warning("The XML file is invalid against the XML Schema Definition") _logger.warning(xml_string) _logger.warning(e) - raise osv.except_osv(_('Error :'), _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s.') % str(e)) + raise orm.except_orm(_('Error :'), _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s.') % str(e)) return True - def _attach_xml_file(self, cr, uid, ids, object, xml_string, start_date_datetime, declaration_name, context=None): '''Attach the XML file to the report_intrastat_product/service object''' import base64 - if len(ids) != 1: - raise osv.except_osv(_('Error :'), 'Hara kiri in attach_xml_file') + assert len(ids) == 1, "Only one ID accepted" filename = datetime.strftime(start_date_datetime, '%Y-%m') + '_' + declaration_name + '.xml' - attach_name = declaration_name.upper() + ' ' + datetime.strftime(start_date_datetime, '%Y-%m') attach_obj = self.pool.get('ir.attachment') if not context: context = {} - context.update({'default_res_id' : ids[0], 'default_res_model': object._name}) - attach_id = attach_obj.create(cr, uid, {'name': attach_name, 'datas': base64.encodestring(xml_string), 'datas_fname': filename}, context=context) + context.update({'default_res_id': ids[0], 'default_res_model': object._name}) + attach_id = attach_obj.create(cr, uid, {'name': filename, 'datas': base64.encodestring(xml_string), 'datas_fname': filename}, context=context) return attach_id - def _open_attach_view(self, cr, uid, attach_id, title='XML file', context=None): '''Returns an action which opens the form view of the corresponding attachement''' - # Only works in v6 -> not used in v5 action = { 'name': title, 'view_type': 'form', @@ -115,11 +113,10 @@ class report_intrastat_common(osv.osv_memory): 'type': 'ir.actions.act_window', 'nodestroy': True, 'target': 'current', - 'res_id': [attach_id], + 'res_id': attach_id, } return action - def partner_on_change(self, cr, uid, ids, partner_id=False): result = {} result['value'] = {} @@ -128,5 +125,15 @@ class report_intrastat_common(osv.osv_memory): result['value'].update({'partner_vat': company['vat']}) return result -report_intrastat_common() - + def send_reminder_email(self, cr, uid, company, module_name, template_xmlid, intrastat_id, context=None): + template_data = self.pool['ir.model.data'].get_object_reference(cr, uid, module_name, template_xmlid) + if template_data and template_data[0] == 'email.template': + template_id = template_data[1] + else: + raise orm.except_orm(_('Error :'), _("Wrong model for XMLID '%s.%s': model is '%s' and it should be 'email.template'.") % (module_name, template_xmlid, template_data[0])) + if company.intrastat_remind_user_ids: + self.pool['email.template'].send_mail(cr, uid, template_id, intrastat_id, context=context) + logger.info('Intrastat Reminder email has been sent (XMLID: %s).' % template_xmlid) + else: + logger.warning('The list of users receiving the Intrastat Reminder is empty on company %s' % company.name) + return True diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/intrastat_demo.xml index d83640e..07c68ab 100644 --- a/intrastat_base/intrastat_demo.xml +++ b/intrastat_base/intrastat_demo.xml @@ -1,7 +1,7 @@ @@ -13,7 +13,7 @@ FR58441019213 - + BE0828696437 True @@ -23,7 +23,7 @@ True - + BE0884025633 True @@ -48,7 +48,7 @@ Shipping costs SHIP service - + 30 True diff --git a/intrastat_base/intrastat_menu.xml b/intrastat_base/intrastat_menu.xml index b078c6a..83434cb 100644 --- a/intrastat_base/intrastat_menu.xml +++ b/intrastat_base/intrastat_menu.xml @@ -1,7 +1,7 @@ diff --git a/intrastat_base/partner_address.py b/intrastat_base/partner.py similarity index 77% rename from intrastat_base/partner_address.py rename to intrastat_base/partner.py index f36329b..a87c0ed 100644 --- a/intrastat_base/partner_address.py +++ b/intrastat_base/partner.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2011 Akretion (http://www.akretion.com/) All Rights Reserved +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,16 +20,14 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import orm, fields -# We want to have the country field on res_partner_address always set + +# We want to have the country field on res_partner always set # because the selection of invoices for intrastat reports is based -# on the country of the invoice partner address ! -class res_partner_address(osv.osv): - _inherit = 'res.partner.address' +# on the country of the invoice partner ! +class res_partner(orm.Model): + _inherit = 'res.partner' _columns = { 'country_id': fields.many2one('res.country', 'Country', required=True), } - -res_partner_address() - diff --git a/intrastat_base/product.py b/intrastat_base/product.py index c535a72..60132f0 100644 --- a/intrastat_base/product.py +++ b/intrastat_base/product.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2012 Akretion (http://www.akretion.com/) All Rights Reserved +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,30 +20,28 @@ # ############################################################################## -from osv import osv, fields -from tools.translate import _ +from openerp.osv import orm, fields +from openerp.tools.translate import _ -class product_template(osv.osv): + +class product_template(orm.Model): _inherit = "product.template" _columns = { 'exclude_from_intrastat': fields.boolean('Exclude from Intrastat reports', help="If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason."), - 'is_accessory_cost' : fields.boolean('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.'), + 'is_accessory_cost': fields.boolean('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.'), } _defaults = { 'exclude_from_intrastat': False, } - def _check_accessory_cost(self, cr, uid, ids): for product in self.browse(cr, uid, ids): if product.is_accessory_cost and product.type != 'service': - raise osv.except_osv(_('Error :'), _("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'" % (product.name, product.type))) + raise orm.except_orm(_('Error :'), _("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'" % (product.name, product.type))) return True _constraints = [ - (_check_accessory_cost, "Error msg is in raise", ['is_accessory_cost', 'type']) + (_check_accessory_cost, "Error msg is in raise", + ['is_accessory_cost', 'type']) ] - -product_template() - diff --git a/intrastat_base/product_view.xml b/intrastat_base/product_view.xml index 28b026e..fd7c2d4 100644 --- a/intrastat_base/product_view.xml +++ b/intrastat_base/product_view.xml @@ -1,7 +1,7 @@ @@ -15,17 +15,12 @@ product.product - - - - - - - - + + + - - + + @@ -35,17 +30,12 @@ product.template - - - - - - - - + + + - - + + diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py index 4d12d32..5e933d1 100644 --- a/intrastat_base/tax.py +++ b/intrastat_base/tax.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,14 +20,11 @@ # ############################################################################## -from osv import osv, fields +from openerp.osv import orm, fields -class account_tax(osv.osv): +class account_tax(orm.Model): _inherit = "account.tax" _columns = { 'exclude_from_intrastat_if_present': fields.boolean('Exclude invoice line from intrastat if this tax is present', help="If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices."), } - -account_tax() - diff --git a/intrastat_base/tax_view.xml b/intrastat_base/tax_view.xml index e60a327..c481490 100644 --- a/intrastat_base/tax_view.xml +++ b/intrastat_base/tax_view.xml @@ -17,8 +17,8 @@ - - + + From a088b46773196f9be8d18abd5b70f3301166b42c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20B=C3=A9al?= Date: Sun, 9 Mar 2014 09:29:59 +0100 Subject: [PATCH 03/90] [FIX] intrastat_base: Several things * switch required=True for country_id from model to views in res.partner * xpath in partner view as Niels Huylebroeck suggest * simplify first xpath too in partner view * xpath in a more generic way --- intrastat_base/__init__.py | 1 - intrastat_base/__openerp__.py | 1 + intrastat_base/partner.py | 33 --------------------------------- intrastat_base/partner_view.xml | 31 +++++++++++++++++++++++++++++++ 4 files changed, 32 insertions(+), 34 deletions(-) delete mode 100644 intrastat_base/partner.py create mode 100644 intrastat_base/partner_view.xml diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 8e2eaa0..3070e32 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -23,6 +23,5 @@ from . import country from . import product from . import tax -from . import partner from . import company from . import intrastat_common diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 973786b..9661bd8 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -44,6 +44,7 @@ Please contact Alexis de Lattre from Akretion for 'data': [ 'country_data.xml', 'product_view.xml', + 'partner_view.xml', 'country_view.xml', 'tax_view.xml', 'company_view.xml', diff --git a/intrastat_base/partner.py b/intrastat_base/partner.py deleted file mode 100644 index a87c0ed..0000000 --- a/intrastat_base/partner.py +++ /dev/null @@ -1,33 +0,0 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp.osv import orm, fields - - -# We want to have the country field on res_partner always set -# because the selection of invoices for intrastat reports is based -# on the country of the invoice partner ! -class res_partner(orm.Model): - _inherit = 'res.partner' - _columns = { - 'country_id': fields.many2one('res.country', 'Country', required=True), - } diff --git a/intrastat_base/partner_view.xml b/intrastat_base/partner_view.xml new file mode 100644 index 0000000..7dc9f4e --- /dev/null +++ b/intrastat_base/partner_view.xml @@ -0,0 +1,31 @@ + + + + + + + + + + res.partner + + + + {'readonly': [('use_parent_address','=',True)], 'required': True} + + + + {'required': True} + + + + + + + From 24a8f6f2a239337d2f25e9416da029b6b9ee774b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 14 Apr 2014 16:32:08 +0200 Subject: [PATCH 04/90] [IMP] intrastat_base: Several improvements: * Use l10n_fr_* : use the method _company_default_get() intrastat_base : - the module is now PEP-8 compliant ! - add search view on countries - is_accessory_cost is now invisible when product != service - update POT file and FR translation - remove double import of logging lib * Add context in on_change (to be able to use web_context_tunnel) XSD files are now pure XSD files, not python file with the content as string. Convert l10n_fr_intrastat_service to PEP-8 Start to convert l10n_fr_intrastat_product to PEP-8 (not finished yet) l10n_fr_intrastat_product : Update POT file and FR translation. * l10n_fr_intrastat_service : update POT file and FR translation. l10n_fr_intrastat_product : continue PEP-8 compliance --- intrastat_base/company.py | 22 +- intrastat_base/country.py | 6 +- intrastat_base/country_view.xml | 15 ++ intrastat_base/i18n/fr_FR.po | 271 +++++++++++++------------ intrastat_base/i18n/intrastat_base.pot | 245 ++++++++++++---------- intrastat_base/intrastat_common.py | 124 +++++++---- intrastat_base/product.py | 21 +- intrastat_base/product_view.xml | 6 +- intrastat_base/tax.py | 9 +- 9 files changed, 426 insertions(+), 293 deletions(-) diff --git a/intrastat_base/company.py b/intrastat_base/company.py index 69163f5..030101f 100644 --- a/intrastat_base/company.py +++ b/intrastat_base/company.py @@ -27,7 +27,8 @@ from openerp.tools.translate import _ class res_company(orm.Model): _inherit = "res.company" - def _compute_intrastat_email_list(self, cr, uid, ids, name, arg, context=None): + def _compute_intrastat_email_list( + self, cr, uid, ids, name, arg, context=None): result = {} for company in self.browse(cr, uid, ids, context=context): result[company.id] = '' @@ -39,21 +40,24 @@ class res_company(orm.Model): return result _columns = { - 'intrastat_remind_user_ids': fields.many2many('res.users', - id1='company_id', id2='user_id', + 'intrastat_remind_user_ids': fields.many2many( + 'res.users', id1='company_id', id2='user_id', string="Users Receiving the Intrastat Reminder", - help="List of OpenERP users who will receive a notification to remind them about the Intrastat declaration."), - 'intrastat_email_list': fields.function(_compute_intrastat_email_list, - type='char', size=1000, - string='List of emails of Users Receiving the Intrastat Reminder', - help='Comma-separated list of email addresses of Users Receiving the Intrastat Reminder. For use in the email template.'), + help="List of OpenERP users who will receive a notification to " + "remind them about the Intrastat declaration."), + 'intrastat_email_list': fields.function( + _compute_intrastat_email_list, type='char', size=1000, + string='List of emails of Users Receiving the Intrastat Reminder'), } def _check_intrastat_remind_users(self, cr, uid, ids): for company in self.browse(cr, uid, ids): for user in company.intrastat_remind_user_ids: if not user.email: - raise orm.except_orm(_('Error :'), _("Missing e-mail address on user '%s'.") % (user.name)) + raise orm.except_orm( + _('Error :'), + _("Missing e-mail address on user '%s'.") + % (user.name)) return True _constraints = [ diff --git a/intrastat_base/country.py b/intrastat_base/country.py index 2cb923f..e967e92 100644 --- a/intrastat_base/country.py +++ b/intrastat_base/country.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -26,7 +26,9 @@ from openerp.osv import orm, fields class res_country(orm.Model): _inherit = 'res.country' _columns = { - 'intrastat': fields.boolean('EU country', help="Set to True for all European Union countries."), + 'intrastat': fields.boolean( + 'EU Country', + help="Set to True for all European Union countries."), } _defaults = { diff --git a/intrastat_base/country_view.xml b/intrastat_base/country_view.xml index 87e7ec9..2177dbb 100644 --- a/intrastat_base/country_view.xml +++ b/intrastat_base/country_view.xml @@ -31,6 +31,21 @@ + + + intrastat.base.country.search + res.country + + + + + + + + + + diff --git a/intrastat_base/i18n/fr_FR.po b/intrastat_base/i18n/fr_FR.po index c3a85fe..77ac6e9 100644 --- a/intrastat_base/i18n/fr_FR.po +++ b/intrastat_base/i18n/fr_FR.po @@ -4,11 +4,11 @@ # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.0.4\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-06-05 13:28+0000\n" -"PO-Revision-Date: 2012-06-05 13:28+0000\n" -"Last-Translator: <>\n" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-04-14 14:18+0000\n" +"PO-Revision-Date: 2014-04-14 14:18+0000\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -16,122 +16,24 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat reporting" -msgstr "DEB et DES" +#: help:product.template,is_accessory_cost:0 +msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +msgstr "Activez cette option pour les frais de port, les frais d'emballage et tous les services liés à la vente de produits physiques. Cette option est utilisée pour la DEB et la DES." #. module: intrastat_base -#: sql_constraint:res.country:0 -msgid "The code of the country must be unique !" -msgstr "Le code du pays doit être unique !" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error: The default UOM and the purchase UOM must be in the same category." -msgstr "Erreur: l'UdM par défaut et l'UdM d'achat doivent appartenir à la même catégorie." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:64 -#: code:addons/intrastat_base/intrastat_common.py:70 -#: code:addons/intrastat_base/intrastat_common.py:85 -#: code:addons/intrastat_base/intrastat_common.py:93 -#: code:addons/intrastat_base/product.py:41 -#, python-format -msgid "Error :" -msgstr "Erreur :" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_tax -msgid "account.tax" -msgstr "account.tax" - -#. module: intrastat_base -#: field:account.tax,exclude_from_intrastat_if_present:0 -msgid "Exclude invoice line from intrastat if this tax is present" -msgstr "Exclue la ligne de facture de la DEB/DES si cette taxe est présente" - -#. module: intrastat_base -#: help:res.country,intrastat:0 -msgid "Set as True for countries that must be selected in the intrastat reports, i.e. for all European Union countries other than your own country." -msgstr "Activer cette option pour les pays qui doivent être inclus dans la DEB et la DES, i.e. tous les pays de l'Union Européenne sauf votre propre pays." - -#. module: intrastat_base -#: view:product.product:0 -#: view:product.template:0 -msgid "Intrastat properties" -msgstr "Paramètres pour la DEB et la DES" - -#. module: intrastat_base -#: model:ir.module.module,description:intrastat_base.module_meta_information -msgid "This module contains the common functions for 2 other modules :\n" -"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" -"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" -"This module is not usefull if it's not used together with one of those 2 modules.\n" -"\n" -"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" -"\n" -"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" -"\n" -"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" -" " -msgstr "This module contains the common functions for 2 other modules :\n" -"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" -"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" -"This module is not usefull if it's not used together with one of those 2 modules.\n" -"\n" -"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" -"\n" -"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" -"\n" -"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" -" " - -#. module: intrastat_base -#: sql_constraint:res.country:0 -msgid "The name of the country must be unique !" -msgstr "Le nom du pays doit être unique !" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error msg is in raise" -msgstr "Error msg is in raise" - -#. module: intrastat_base -#: help:account.tax,exclude_from_intrastat_if_present:0 -msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." -msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture ne sera pas prise en compte lors de la génération de la DEB et de la DES depuis les factures." - -#. module: intrastat_base -#: field:product.template,is_accessory_cost:0 -msgid "Is accessory cost" -msgstr "Frais accessoires" - -#. module: intrastat_base -#: field:res.country,intrastat:0 -msgid "Intrastat country" -msgstr "Pays intrastat" - -#. module: intrastat_base -#: help:product.template,exclude_from_intrastat:0 -msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." -msgstr "Si l'option est activée, le produit ou service ne sera pris en compte ni pour la DEB ni pour la DES. Cette option doit donc rester désactivée sauf si vous avez une très bonne raison." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:64 -#, python-format -msgid "The company currency must be 'EUR', but is currently '%s'." -msgstr "La monnaie de la société doit être 'EUR', mais est actuellement '%s'." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:70 -#, python-format -msgid "The VAT number is not set for the partner '%s'." -msgstr "Le numéro de TVA n'est pas renseigné pour le partenaire '%s'." +#: view:res.company:0 +msgid "Common Intrastat Settings" +msgstr "Paramètres communs DEB et DES" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_report_intrastat_common msgid "Common functions for intrastat reports for products and services" -msgstr "Common functions for intrastat reports for products and services" +msgstr "Fonctions communes pour la DEB et la DES" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "Sociétés" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country @@ -139,14 +41,26 @@ msgid "Country" msgstr "Pays" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_product_template -msgid "Product Template" -msgstr "Modèle de produit" +#: view:res.country:0 +#: field:res.country,intrastat:0 +msgid "EU Country" +msgstr "Pays UE" #. module: intrastat_base -#: model:ir.module.module,shortdesc:intrastat_base.module_meta_information -msgid "Base module for Intrastat reporting" -msgstr "Module de base pour les rapports intrastat" +#: code:addons/intrastat_base/company.py:58 +#: code:addons/intrastat_base/intrastat_common.py:77 +#: code:addons/intrastat_base/intrastat_common.py:82 +#: code:addons/intrastat_base/intrastat_common.py:90 +#: code:addons/intrastat_base/intrastat_common.py:110 +#: code:addons/intrastat_base/product.py:51 +#, python-format +msgid "Error :" +msgstr "Erreur :" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error msg is in raise" +msgstr "Error msg is in raise" #. module: intrastat_base #: field:product.template,exclude_from_intrastat:0 @@ -154,9 +68,76 @@ msgid "Exclude from Intrastat reports" msgstr "Exclure de la DEB et de la DES" #. module: intrastat_base -#: help:product.template,is_accessory_cost:0 -msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." -msgstr "Activez cette option pour les frais de port, les frais d'emballage et tous les services liés à la vente de produits physiques. Cette option est utilisée pour la DEB et la DES." +#: field:account.tax,exclude_from_intrastat_if_present:0 +msgid "Exclude invoice line from intrastat if this tax is present" +msgstr "Exclue la ligne de facture de la DEB/DES si cette taxe est présente" + +#. module: intrastat_base +#: help:product.template,exclude_from_intrastat:0 +msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." +msgstr "Si l'option est activée, le produit ou service ne sera pris en compte ni pour la DEB ni pour la DES. Cette option doit donc rester désactivée sauf si vous avez une très bonne raison." + +#. module: intrastat_base +#: help:account.tax,exclude_from_intrastat_if_present:0 +msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture ne sera pas prise en compte lors de la génération de la DEB et de la DES depuis les factures." + +#. module: intrastat_base +#: view:product.product:0 +#: view:product.template:0 +msgid "Intrastat Properties" +msgstr "Propriétés DEB/DES" + +#. module: intrastat_base +#: view:res.company:0 +msgid "Intrastat Settings" +msgstr "Configuration DEB/DES" + +#. module: intrastat_base +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +msgid "Intrastat reporting" +msgstr "DEB et DES" + +#. module: intrastat_base +#: field:product.template,is_accessory_cost:0 +msgid "Is accessory cost" +msgstr "Frais accessoires" + +#. module: intrastat_base +#: help:res.company,intrastat_remind_user_ids:0 +msgid "List of OpenERP users who will receive a notification to remind them about the Intrastat declaration." +msgstr "Liste d'utilisateurs OpenERP qui recevront le rappel pour la DEB et/ou la DES." + +#. module: intrastat_base +#: field:res.company,intrastat_email_list:0 +msgid "List of emails of Users Receiving the Intrastat Reminder" +msgstr "Liste des emails d'utilisateurs qui recevront le rappel pour la DEB et/ou la DES" + +#. module: intrastat_base +#: code:addons/intrastat_base/company.py:59 +#, python-format +msgid "Missing e-mail address on user '%s'." +msgstr "Adresse e-mail manquante sur l'utilisateur '%s'." + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_partner +msgid "Partner" +msgstr "Partenaire" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: intrastat_base +#: view:res.country:0 +msgid "Search Countries" +msgstr "Recherche des pays" + +#. module: intrastat_base +#: help:res.country,intrastat:0 +msgid "Set to True for all European Union countries." +msgstr "A cocher pour tous les pays de l'Union Européenne." #. module: intrastat_base #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template @@ -164,13 +145,47 @@ msgid "Shipping costs" msgstr "Frais de port" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:85 +#: model:ir.model,name:intrastat_base.model_account_tax +msgid "Tax" +msgstr "Taxes" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:91 +#, python-format +msgid "The VAT number is not set for the partner '%s'." +msgstr "Le numéro de TVA n'est pas renseigné pour le partenaire '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:83 +#, python-format +msgid "The company currency must be 'EUR', but is currently '%s'." +msgstr "La monnaie de la société doit être 'EUR', mais est actuellement '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:78 +#, python-format +msgid "The country is not set on the company '%s'." +msgstr "Le pays n'est pas renseigné sur la société '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:111 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." msgstr "La validation du fichier XML avec le schéma XML officiel a échoué. Le fichier XML généré et le détail de l'erreur ont été écrits dans les logs du serveur. Voici le message d'erreur, qui peut vous donner une idée de la cause du problème : %s." #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner_address -msgid "Partner Addresses" -msgstr "Carnet d'adresses" +#: code:addons/intrastat_base/product.py:56 +#, python-format +msgid "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'" +msgstr "L'option 'Frais accessoires' ne doit être activée que sur les produits de type 'Service'. Vous avez activé cette option sur le produit '%s' qui est de type '%s'" + +#. module: intrastat_base +#: field:res.company,intrastat_remind_user_ids:0 +msgid "Users Receiving the Intrastat Reminder" +msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" + +#. module: intrastat_base +#: constraint:res.company:0 +msgid "error msg in raise" +msgstr "error msg in raise" diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index d7baf12..b170abd 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,10 +4,10 @@ # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 6.0.4\n" -"Report-Msgid-Bugs-To: support@openerp.com\n" -"POT-Creation-Date: 2012-06-05 13:28+0000\n" -"PO-Revision-Date: 2012-06-05 13:28+0000\n" +"Project-Id-Version: OpenERP Server 7.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2014-04-14 14:18+0000\n" +"PO-Revision-Date: 2014-04-14 14:18+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,106 +16,13 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat reporting" +#: help:product.template,is_accessory_cost:0 +msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." msgstr "" #. module: intrastat_base -#: sql_constraint:res.country:0 -msgid "The code of the country must be unique !" -msgstr "" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error: The default UOM and the purchase UOM must be in the same category." -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:64 -#: code:addons/intrastat_base/intrastat_common.py:70 -#: code:addons/intrastat_base/intrastat_common.py:85 -#: code:addons/intrastat_base/intrastat_common.py:93 -#: code:addons/intrastat_base/product.py:41 -#, python-format -msgid "Error :" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_tax -msgid "account.tax" -msgstr "" - -#. module: intrastat_base -#: field:account.tax,exclude_from_intrastat_if_present:0 -msgid "Exclude invoice line from intrastat if this tax is present" -msgstr "" - -#. module: intrastat_base -#: help:res.country,intrastat:0 -msgid "Set as True for countries that must be selected in the intrastat reports, i.e. for all European Union countries other than your own country." -msgstr "" - -#. module: intrastat_base -#: view:product.product:0 -#: view:product.template:0 -msgid "Intrastat properties" -msgstr "" - -#. module: intrastat_base -#: model:ir.module.module,description:intrastat_base.module_meta_information -msgid "This module contains the common functions for 2 other modules :\n" -"- l10n_fr_intrastat_service : the module for the \"Déclaration Européenne des Services\" (DES)\n" -"- l10n_fr_intrastat_product : the module for the \"Déclaration d'Echange de Biens\" (DEB)\n" -"This module is not usefull if it's not used together with one of those 2 modules.\n" -"\n" -"This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries.\n" -"\n" -"WARNING : this module conflicts with the module \"report_intrastat\" from the addons. If you have already installed the module \"report_intrastat\", you should uninstall it first before installing this module.\n" -"\n" -"Please contact Alexis de Lattre from Akretion for any help or question about this module.\n" -" " -msgstr "" - -#. module: intrastat_base -#: sql_constraint:res.country:0 -msgid "The name of the country must be unique !" -msgstr "" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error msg is in raise" -msgstr "" - -#. module: intrastat_base -#: help:account.tax,exclude_from_intrastat_if_present:0 -msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." -msgstr "" - -#. module: intrastat_base -#: field:product.template,is_accessory_cost:0 -msgid "Is accessory cost" -msgstr "" - -#. module: intrastat_base -#: field:res.country,intrastat:0 -msgid "Intrastat country" -msgstr "" - -#. module: intrastat_base -#: help:product.template,exclude_from_intrastat:0 -msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:64 -#, python-format -msgid "The company currency must be 'EUR', but is currently '%s'." -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:70 -#, python-format -msgid "The VAT number is not set for the partner '%s'." +#: view:res.company:0 +msgid "Common Intrastat Settings" msgstr "" #. module: intrastat_base @@ -123,19 +30,36 @@ msgstr "" msgid "Common functions for intrastat reports for products and services" msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_product_template -msgid "Product Template" +#: view:res.country:0 +#: field:res.country,intrastat:0 +msgid "EU Country" msgstr "" #. module: intrastat_base -#: model:ir.module.module,shortdesc:intrastat_base.module_meta_information -msgid "Base module for Intrastat reporting" +#: code:addons/intrastat_base/company.py:58 +#: code:addons/intrastat_base/intrastat_common.py:77 +#: code:addons/intrastat_base/intrastat_common.py:82 +#: code:addons/intrastat_base/intrastat_common.py:90 +#: code:addons/intrastat_base/intrastat_common.py:110 +#: code:addons/intrastat_base/product.py:51 +#, python-format +msgid "Error :" +msgstr "" + +#. module: intrastat_base +#: constraint:product.template:0 +msgid "Error msg is in raise" msgstr "" #. module: intrastat_base @@ -144,8 +68,75 @@ msgid "Exclude from Intrastat reports" msgstr "" #. module: intrastat_base -#: help:product.template,is_accessory_cost:0 -msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +#: field:account.tax,exclude_from_intrastat_if_present:0 +msgid "Exclude invoice line from intrastat if this tax is present" +msgstr "" + +#. module: intrastat_base +#: help:product.template,exclude_from_intrastat:0 +msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." +msgstr "" + +#. module: intrastat_base +#: help:account.tax,exclude_from_intrastat_if_present:0 +msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgstr "" + +#. module: intrastat_base +#: view:product.product:0 +#: view:product.template:0 +msgid "Intrastat Properties" +msgstr "" + +#. module: intrastat_base +#: view:res.company:0 +msgid "Intrastat Settings" +msgstr "" + +#. module: intrastat_base +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +msgid "Intrastat reporting" +msgstr "" + +#. module: intrastat_base +#: field:product.template,is_accessory_cost:0 +msgid "Is accessory cost" +msgstr "" + +#. module: intrastat_base +#: help:res.company,intrastat_remind_user_ids:0 +msgid "List of OpenERP users who will receive a notification to remind them about the Intrastat declaration." +msgstr "" + +#. module: intrastat_base +#: field:res.company,intrastat_email_list:0 +msgid "List of emails of Users Receiving the Intrastat Reminder" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/company.py:59 +#, python-format +msgid "Missing e-mail address on user '%s'." +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_partner +msgid "Partner" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product Template" +msgstr "" + +#. module: intrastat_base +#: view:res.country:0 +msgid "Search Countries" +msgstr "" + +#. module: intrastat_base +#: help:res.country,intrastat:0 +msgid "Set to True for all European Union countries." msgstr "" #. module: intrastat_base @@ -154,13 +145,47 @@ msgid "Shipping costs" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:85 +#: model:ir.model,name:intrastat_base.model_account_tax +msgid "Tax" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:91 +#, python-format +msgid "The VAT number is not set for the partner '%s'." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:83 +#, python-format +msgid "The company currency must be 'EUR', but is currently '%s'." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:78 +#, python-format +msgid "The country is not set on the company '%s'." +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:111 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." msgstr "" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner_address -msgid "Partner Addresses" +#: code:addons/intrastat_base/product.py:56 +#, python-format +msgid "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'" +msgstr "" + +#. module: intrastat_base +#: field:res.company,intrastat_remind_user_ids:0 +msgid "Users Receiving the Intrastat Reminder" +msgstr "" + +#. module: intrastat_base +#: constraint:res.company:0 +msgid "error msg in raise" msgstr "" diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 7a21a62..2129f8d 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). All rights reserved. +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -22,6 +22,7 @@ from openerp.osv import orm from openerp.tools.translate import _ +from openerp import tools from datetime import datetime from dateutil.relativedelta import relativedelta import logging @@ -31,7 +32,8 @@ logger = logging.getLogger(__name__) class report_intrastat_common(orm.TransientModel): _name = "report.intrastat.common" - _description = "Common functions for intrastat reports for products and services" + _description = "Common functions for intrastat reports for products " + "and services" def _compute_numbers(self, cr, uid, ids, object, context=None): result = {} @@ -41,14 +43,19 @@ class report_intrastat_common(orm.TransientModel): for line in intrastat.intrastat_line_ids: total_amount += line.amount_company_currency num_lines += 1 - result[intrastat.id] = {'num_lines': num_lines, 'total_amount': total_amount} + result[intrastat.id] = { + 'num_lines': num_lines, + 'total_amount': total_amount, + } return result def _compute_dates(self, cr, uid, ids, object, context=None): result = {} for intrastat in object.browse(cr, uid, ids, context=context): - start_date_datetime = datetime.strptime(intrastat.start_date, '%Y-%m-%d') - end_date_str = datetime.strftime(start_date_datetime + relativedelta(day=31), '%Y-%m-%d') + start_date_datetime = datetime.strptime( + intrastat.start_date, '%Y-%m-%d') + end_date_str = datetime.strftime( + start_date_datetime + relativedelta(day=31), '%Y-%m-%d') result[intrastat.id] = { 'end_date': end_date_str, 'year_month': start_date_datetime.strftime('%Y-%m'), @@ -57,53 +64,89 @@ class report_intrastat_common(orm.TransientModel): def _check_start_date(self, cr, uid, ids, object, context=None): '''Check that the start date is the first day of the month''' - for date_to_check in object.read(cr, uid, ids, ['start_date'], context=context): - datetime_to_check = datetime.strptime(date_to_check['start_date'], '%Y-%m-%d') + for date_to_check in object.read( + cr, uid, ids, ['start_date'], context=context): + datetime_to_check = datetime.strptime( + date_to_check['start_date'], '%Y-%m-%d') if datetime_to_check.day != 1: return False return True def _check_generate_lines(self, cr, uid, intrastat, context=None): if not intrastat.company_id.country_id: - raise orm.except_orm(_('Error :'), _("The country is not set on the company '%s'.") % intrastat.company_id.name) + raise orm.except_orm( + _('Error :'), + _("The country is not set on the company '%s'.") + % intrastat.company_id.name) if not intrastat.currency_id.name == 'EUR': - raise orm.except_orm(_('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") % intrastat.currency_id.name) + raise orm.except_orm( + _('Error :'), + _("The company currency must be 'EUR', but is currently '%s'.") + % intrastat.currency_id.name) return True def _check_generate_xml(self, cr, uid, intrastat, context=None): if not intrastat.company_id.partner_id.vat: - raise orm.except_orm(_('Error :'), _("The VAT number is not set for the partner '%s'.") % intrastat.company_id.partner_id.name) + raise orm.except_orm( + _('Error :'), + _("The VAT number is not set for the partner '%s'.") + % intrastat.company_id.partner_id.name) return True - def _check_xml_schema(self, cr, uid, xml_root, xml_string, xsd, context=None): + def _check_xml_schema( + self, cr, uid, xml_root, xml_string, xsd_file, context=None): '''Validate the XML file against the XSD''' from lxml import etree - official_des_xml_schema = etree.XMLSchema(etree.fromstring(xsd)) + xsd_etree_obj = etree.parse( + tools.file_open(xsd_file)) + official_schema = etree.XMLSchema(xsd_etree_obj) try: - official_des_xml_schema.assertValid(xml_root) - except Exception, e: # if the validation of the XSD fails, we arrive here - import logging + official_schema.assertValid(xml_root) + except Exception, e: + # if the validation of the XSD fails, we arrive here _logger = logging.getLogger(__name__) - _logger.warning("The XML file is invalid against the XML Schema Definition") + _logger.warning( + "The XML file is invalid against the XML Schema Definition") _logger.warning(xml_string) _logger.warning(e) - raise orm.except_orm(_('Error :'), _('The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s.') % str(e)) + raise orm.except_orm( + _('Error :'), + _("The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. " + "Here is the error, which may give you an idea on the " + "cause of the problem : %s.") + % str(e)) return True - def _attach_xml_file(self, cr, uid, ids, object, xml_string, start_date_datetime, declaration_name, context=None): - '''Attach the XML file to the report_intrastat_product/service object''' + def _attach_xml_file( + self, cr, uid, ids, object, xml_string, start_date_datetime, + declaration_name, context=None): + '''Attach the XML file to the report_intrastat_product/service ''' + '''object''' import base64 assert len(ids) == 1, "Only one ID accepted" - filename = datetime.strftime(start_date_datetime, '%Y-%m') + '_' + declaration_name + '.xml' - attach_obj = self.pool.get('ir.attachment') + filename = '%s_%s.xml' % ( + datetime.strftime(start_date_datetime, '%Y-%m'), + declaration_name) if not context: context = {} - context.update({'default_res_id': ids[0], 'default_res_model': object._name}) - attach_id = attach_obj.create(cr, uid, {'name': filename, 'datas': base64.encodestring(xml_string), 'datas_fname': filename}, context=context) + context.update({ + 'default_res_id': ids[0], + 'default_res_model': object._name + }) + attach_id = self.pool['ir.attachment'].create( + cr, uid, { + 'name': filename, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}, + context=context) return attach_id - def _open_attach_view(self, cr, uid, attach_id, title='XML file', context=None): - '''Returns an action which opens the form view of the corresponding attachement''' + def _open_attach_view( + self, cr, uid, attach_id, title='XML file', context=None): + '''Returns an action which opens the form view of the ''' + '''corresponding attachement''' action = { 'name': title, 'view_type': 'form', @@ -117,23 +160,30 @@ class report_intrastat_common(orm.TransientModel): } return action - def partner_on_change(self, cr, uid, ids, partner_id=False): + def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): result = {} result['value'] = {} if partner_id: - company = self.pool.get('res.partner').read(cr, uid, partner_id, ['vat']) - result['value'].update({'partner_vat': company['vat']}) + company = self.pool['res.partner'].read( + cr, uid, partner_id, ['vat'], context=context) + result['value']['partner_vat'] = company['vat'] return result - def send_reminder_email(self, cr, uid, company, module_name, template_xmlid, intrastat_id, context=None): - template_data = self.pool['ir.model.data'].get_object_reference(cr, uid, module_name, template_xmlid) - if template_data and template_data[0] == 'email.template': - template_id = template_data[1] - else: - raise orm.except_orm(_('Error :'), _("Wrong model for XMLID '%s.%s': model is '%s' and it should be 'email.template'.") % (module_name, template_xmlid, template_data[0])) + def send_reminder_email( + self, cr, uid, company, module_name, template_xmlid, + intrastat_id, context=None): + template_model, template_id =\ + self.pool['ir.model.data'].get_object_reference( + cr, uid, module_name, template_xmlid) + assert template_model == 'email.template', 'Wrong model' if company.intrastat_remind_user_ids: - self.pool['email.template'].send_mail(cr, uid, template_id, intrastat_id, context=context) - logger.info('Intrastat Reminder email has been sent (XMLID: %s).' % template_xmlid) + self.pool['email.template'].send_mail( + cr, uid, template_id, intrastat_id, context=context) + logger.info( + 'Intrastat Reminder email has been sent (XMLID: %s).' + % template_xmlid) else: - logger.warning('The list of users receiving the Intrastat Reminder is empty on company %s' % company.name) + logger.warning( + 'The list of users receiving the Intrastat Reminder is empty ' + 'on company %s' % company.name) return True diff --git a/intrastat_base/product.py b/intrastat_base/product.py index 60132f0..7181706 100644 --- a/intrastat_base/product.py +++ b/intrastat_base/product.py @@ -27,8 +27,17 @@ from openerp.tools.translate import _ class product_template(orm.Model): _inherit = "product.template" _columns = { - 'exclude_from_intrastat': fields.boolean('Exclude from Intrastat reports', help="If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason."), - 'is_accessory_cost': fields.boolean('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.'), + 'exclude_from_intrastat': fields.boolean( + 'Exclude from Intrastat reports', + help="If set to True, the product or service will not be " + "taken into account for Intrastat Product or Service reports. " + "So you should leave this field to False unless you have a " + "very good reason."), + 'is_accessory_cost': fields.boolean( + '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."), } _defaults = { @@ -38,7 +47,13 @@ class product_template(orm.Model): def _check_accessory_cost(self, cr, uid, ids): for product in self.browse(cr, uid, ids): if product.is_accessory_cost and product.type != 'service': - raise orm.except_orm(_('Error :'), _("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'" % (product.name, product.type))) + raise orm.except_orm( + _('Error :'), + _("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'" + % (product.name, product.type))) return True _constraints = [ diff --git a/intrastat_base/product_view.xml b/intrastat_base/product_view.xml index fd7c2d4..a551868 100644 --- a/intrastat_base/product_view.xml +++ b/intrastat_base/product_view.xml @@ -18,7 +18,8 @@ - + @@ -33,7 +34,8 @@ - + diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py index 5e933d1..fae6a3d 100644 --- a/intrastat_base/tax.py +++ b/intrastat_base/tax.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). All Rights Reserved +# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -25,6 +25,11 @@ from openerp.osv import orm, fields class account_tax(orm.Model): _inherit = "account.tax" + _columns = { - 'exclude_from_intrastat_if_present': fields.boolean('Exclude invoice line from intrastat if this tax is present', help="If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices."), + 'exclude_from_intrastat_if_present': fields.boolean( + 'Exclude invoice line from intrastat if this tax is present', + help="If this tax is present on an invoice line, this invoice " + "line will be skipped when generating Intrastat Product or " + "Service lines from invoices."), } From 53180e04045889abdf8559b53470d1591cbdbd77 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 23 Jun 2014 12:12:40 +0200 Subject: [PATCH 05/90] [MIG] intrastat_base: Migration to 8.0 * Add intrastat_type_data and update demo data accordingly Remove version="7.0" from form views Add ondelete='restrict' on M2O pointing to intrastat.type Add graph views on intrastat.product and intrastat.service... because Odoo v8 graph views are so cool ! :) * When the obligation level for import is none, the type of the DEB is automatically set to export. [FIX] country -> country_id type='string' -> type='char' (v8 only accepts char) Change "error msg in raise", because v8 displays this to the user Remove statistical_pricelist_id from demo data Harmonize labels of button between DEB and DES * Add module intrastat_product. Rename report.intrastat.product to l10n.fr.report.intrastat.product (same for service and for lines) + migration scripts * intrastat_base + l10n_fr_intrastat_service : port to new API --- intrastat_base/__init__.py | 4 +- intrastat_base/__openerp__.py | 5 +- intrastat_base/company.py | 70 ++++----- intrastat_base/company_view.xml | 4 +- intrastat_base/country.py | 19 +-- intrastat_base/country_view.xml | 9 +- intrastat_base/i18n/fr_FR.po | 2 +- intrastat_base/i18n/intrastat_base.pot | 2 +- intrastat_base/intrastat_common.py | 189 +++++++++++-------------- intrastat_base/intrastat_demo.xml | 2 +- intrastat_base/intrastat_menu.xml | 4 +- intrastat_base/product.py | 61 ++++---- intrastat_base/product_view.xml | 27 +--- intrastat_base/tax.py | 20 ++- intrastat_base/tax_view.xml | 7 +- 15 files changed, 177 insertions(+), 248 deletions(-) diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 3070e32..21b2067 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) +# Report intrastat base module for Odoo +# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 9661bd8..179cb4a 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com) +# Report intrastat base module for Odoo +# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -52,5 +52,4 @@ Please contact Alexis de Lattre from Akretion for ], 'demo': ['intrastat_demo.xml'], 'installable': True, - 'active': False, } diff --git a/intrastat_base/company.py b/intrastat_base/company.py index 030101f..9fea8e4 100644 --- a/intrastat_base/company.py +++ b/intrastat_base/company.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Intrastat base module for OpenERP -# Copyright (C) 2013 Akretion (http://www.akretion.com) +# Intrastat base module for Odoo +# Copyright (C) 2013-2014 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,47 +20,37 @@ # ############################################################################## -from openerp.osv import orm, fields -from openerp.tools.translate import _ +from openerp import models, fields, api, _ +from openerp.exceptions import ValidationError -class res_company(orm.Model): +class ResCompany(models.Model): _inherit = "res.company" - def _compute_intrastat_email_list( - self, cr, uid, ids, name, arg, context=None): - result = {} - for company in self.browse(cr, uid, ids, context=context): - result[company.id] = '' - for user in company.intrastat_remind_user_ids: - if result[company.id]: - result[company.id] += ',%s' % (user.email) - else: - result[company.id] = user.email - return result + @api.one + @api.depends( + 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') + def _compute_intrastat_email_list(self): + emails = [] + for user in self.intrastat_remind_user_ids: + if user.email: + emails.append(user.email) + self.intrastat_email_list = ','.join(emails) - _columns = { - 'intrastat_remind_user_ids': fields.many2many( - 'res.users', id1='company_id', id2='user_id', - string="Users Receiving the Intrastat Reminder", - help="List of OpenERP users who will receive a notification to " - "remind them about the Intrastat declaration."), - 'intrastat_email_list': fields.function( - _compute_intrastat_email_list, type='char', size=1000, - string='List of emails of Users Receiving the Intrastat Reminder'), - } + intrastat_remind_user_ids = fields.Many2many( + 'res.users', column1='company_id', column2='user_id', + string="Users Receiving the Intrastat Reminder", + help="List of OpenERP users who will receive a notification to " + "remind them about the Intrastat declaration.") + intrastat_email_list = fields.Char( + compute='_compute_intrastat_email_list', + string='List of emails of Users Receiving the Intrastat Reminder') - def _check_intrastat_remind_users(self, cr, uid, ids): - for company in self.browse(cr, uid, ids): - for user in company.intrastat_remind_user_ids: - if not user.email: - raise orm.except_orm( - _('Error :'), - _("Missing e-mail address on user '%s'.") - % (user.name)) - return True - - _constraints = [ - (_check_intrastat_remind_users, "error msg in raise", - ['intrastat_remind_user_ids']), - ] + @api.one + @api.constrains('intrastat_remind_user_ids') + def _check_intrastat_remind_users(self): + for user in self.intrastat_remind_user_ids: + if not user.email: + raise ValidationError( + _("Missing e-mail address on user '%s'.") + % (user.name)) diff --git a/intrastat_base/company_view.xml b/intrastat_base/company_view.xml index 14cf1fe..87933f4 100644 --- a/intrastat_base/company_view.xml +++ b/intrastat_base/company_view.xml @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ - + intrastat.company.form res.company diff --git a/intrastat_base/country.py b/intrastat_base/country.py index e967e92..7f03e5d 100644 --- a/intrastat_base/country.py +++ b/intrastat_base/country.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). +# Report intrastat base module for Odoo +# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,17 +20,12 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class res_country(orm.Model): +class ResCountry(models.Model): _inherit = 'res.country' - _columns = { - 'intrastat': fields.boolean( - 'EU Country', - help="Set to True for all European Union countries."), - } - _defaults = { - 'intrastat': False, - } + intrastat = fields.Boolean( + string='EU Country', + help="Set to True for all European Union countries.") diff --git a/intrastat_base/country_view.xml b/intrastat_base/country_view.xml index 2177dbb..d887a22 100644 --- a/intrastat_base/country_view.xml +++ b/intrastat_base/country_view.xml @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ - + intrastat.base.country.tree res.country @@ -20,7 +20,7 @@ - + intrastat.base.country.form res.country @@ -32,7 +32,7 @@ - + intrastat.base.country.search res.country @@ -46,6 +46,5 @@ - diff --git a/intrastat_base/i18n/fr_FR.po b/intrastat_base/i18n/fr_FR.po index 77ac6e9..de7e5db 100644 --- a/intrastat_base/i18n/fr_FR.po +++ b/intrastat_base/i18n/fr_FR.po @@ -95,7 +95,7 @@ msgstr "Configuration DEB/DES" #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat reporting" +msgid "Intrastat Reporting" msgstr "DEB et DES" #. module: intrastat_base diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index b170abd..d184def 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -95,7 +95,7 @@ msgstr "" #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat reporting" +msgid "Intrastat Reporting" msgstr "" #. module: intrastat_base diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 2129f8d..fa65afe 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). +# Report intrastat base module for Odoo +# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ # ############################################################################## -from openerp.osv import orm -from openerp.tools.translate import _ -from openerp import tools +from openerp import models, api, tools, _ +from openerp.tools import DEFAULT_SERVER_DATE_FORMAT +from openerp.exceptions import Warning, ValidationError from datetime import datetime from dateutil.relativedelta import relativedelta import logging @@ -30,71 +30,64 @@ import logging logger = logging.getLogger(__name__) -class report_intrastat_common(orm.TransientModel): +class ReportIntrastatCommon(models.AbstractModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products " "and services" - def _compute_numbers(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - total_amount = 0.0 - num_lines = 0 - for line in intrastat.intrastat_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - result[intrastat.id] = { - 'num_lines': num_lines, - 'total_amount': total_amount, - } - return result + @api.one + @api.depends( + 'intrastat_line_ids', 'intrastat_line_ids.amount_company_currency') + def _compute_numbers(self): + total_amount = 0.0 + num_lines = 0 + for line in self.intrastat_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + self.num_lines = num_lines + self.total_amount = total_amount - def _compute_dates(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - start_date_datetime = datetime.strptime( - intrastat.start_date, '%Y-%m-%d') - end_date_str = datetime.strftime( - start_date_datetime + relativedelta(day=31), '%Y-%m-%d') - result[intrastat.id] = { - 'end_date': end_date_str, - 'year_month': start_date_datetime.strftime('%Y-%m'), - } - return result + @api.one + @api.depends('start_date') + def _compute_dates(self): + start_date_dt = datetime.strptime( + self.start_date, DEFAULT_SERVER_DATE_FORMAT) + self.end_date = datetime.strftime( + start_date_dt + relativedelta(day=31), DEFAULT_SERVER_DATE_FORMAT) + self.year_month = start_date_dt.strftime('%Y-%m') - def _check_start_date(self, cr, uid, ids, object, context=None): + @api.one + @api.constrains('start_date') + def _check_start_date(self): '''Check that the start date is the first day of the month''' - for date_to_check in object.read( - cr, uid, ids, ['start_date'], context=context): - datetime_to_check = datetime.strptime( - date_to_check['start_date'], '%Y-%m-%d') - if datetime_to_check.day != 1: - return False - return True + datetime_to_check = datetime.strptime( + self.start_date, DEFAULT_SERVER_DATE_FORMAT) + if datetime_to_check.day != 1: + return ValidationError( + _('The start date must be the first day of the month')) - def _check_generate_lines(self, cr, uid, intrastat, context=None): - if not intrastat.company_id.country_id: - raise orm.except_orm( - _('Error :'), + @api.one + def _check_generate_lines(self): + if not self.company_id.country_id: + raise Warning( _("The country is not set on the company '%s'.") - % intrastat.company_id.name) - if not intrastat.currency_id.name == 'EUR': - raise orm.except_orm( - _('Error :'), + % self.company_id.name) + if self.currency_id.name != 'EUR': + raise Warning( _("The company currency must be 'EUR', but is currently '%s'.") - % intrastat.currency_id.name) + % self.currency_id.name) return True - def _check_generate_xml(self, cr, uid, intrastat, context=None): - if not intrastat.company_id.partner_id.vat: - raise orm.except_orm( - _('Error :'), + @api.one + def _check_generate_xml(self): + if not self.company_id.partner_id.vat: + raise Warning( _("The VAT number is not set for the partner '%s'.") - % intrastat.company_id.partner_id.name) + % self.company_id.partner_id.name) return True - def _check_xml_schema( - self, cr, uid, xml_root, xml_string, xsd_file, context=None): + @api.model + def _check_xml_schema(self, xml_root, xml_string, xsd_file): '''Validate the XML file against the XSD''' from lxml import etree xsd_etree_obj = etree.parse( @@ -104,13 +97,12 @@ class report_intrastat_common(orm.TransientModel): official_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here - _logger = logging.getLogger(__name__) - _logger.warning( + logger = logging.getLogger(__name__) + logger.warning( "The XML file is invalid against the XML Schema Definition") - _logger.warning(xml_string) - _logger.warning(e) - raise orm.except_orm( - _('Error :'), + logger.warning(xml_string) + logger.warning(e) + raise Warning( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -119,39 +111,29 @@ class report_intrastat_common(orm.TransientModel): % str(e)) return True - def _attach_xml_file( - self, cr, uid, ids, object, xml_string, start_date_datetime, - declaration_name, context=None): + @api.multi + def _attach_xml_file(self, xml_string, declaration_name): '''Attach the XML file to the report_intrastat_product/service ''' '''object''' + self.ensure_one() import base64 - assert len(ids) == 1, "Only one ID accepted" - filename = '%s_%s.xml' % ( - datetime.strftime(start_date_datetime, '%Y-%m'), - declaration_name) - if not context: - context = {} - context.update({ - 'default_res_id': ids[0], - 'default_res_model': object._name - }) - attach_id = self.pool['ir.attachment'].create( - cr, uid, { - 'name': filename, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}, - context=context) - return attach_id + filename = '%s_%s.xml' % (self.year_month, declaration_name) + attach = self.with_context( + default_res_id=self.id, + default_res_model=self._name).env['ir.attachment'].create({ + 'name': filename, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}) + return attach.id - def _open_attach_view( - self, cr, uid, attach_id, title='XML file', context=None): + @api.model + def _open_attach_view(self, attach_id, title='XML file'): '''Returns an action which opens the form view of the ''' '''corresponding attachement''' action = { 'name': title, 'view_type': 'form', - 'view_mode': 'form,tree', - 'view_id': False, + 'view_mode': 'form', 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'nodestroy': True, @@ -160,30 +142,27 @@ class report_intrastat_common(orm.TransientModel): } return action - def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): - result = {} - result['value'] = {} - if partner_id: - company = self.pool['res.partner'].read( - cr, uid, partner_id, ['vat'], context=context) - result['value']['partner_vat'] = company['vat'] - return result - - def send_reminder_email( - self, cr, uid, company, module_name, template_xmlid, - intrastat_id, context=None): - template_model, template_id =\ - self.pool['ir.model.data'].get_object_reference( - cr, uid, module_name, template_xmlid) - assert template_model == 'email.template', 'Wrong model' - if company.intrastat_remind_user_ids: + @api.one + def send_reminder_email(self, mail_template_xmlid): + mail_template = self.env.ref(mail_template_xmlid) + if self.company_id.intrastat_remind_user_ids: self.pool['email.template'].send_mail( - cr, uid, template_id, intrastat_id, context=context) + self._cr, self._uid, mail_template.id, self.id, + context=self._context) logger.info( 'Intrastat Reminder email has been sent (XMLID: %s).' - % template_xmlid) + % mail_template_xmlid) else: logger.warning( 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % company.name) + 'on company %s' % self.company_id.name) return True + + @api.multi + def unlink(self): + for intrastat in self: + if intrastat.state == 'done': + raise Warning( + _('Cannot delete the declaration %s ' + 'because it is in Done state') % self.year_month) + return super(ReportIntrastatCommon, self).unlink() diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/intrastat_demo.xml index 07c68ab..953d92b 100644 --- a/intrastat_base/intrastat_demo.xml +++ b/intrastat_base/intrastat_demo.xml @@ -1,7 +1,7 @@ diff --git a/intrastat_base/intrastat_menu.xml b/intrastat_base/intrastat_menu.xml index 83434cb..85303c1 100644 --- a/intrastat_base/intrastat_menu.xml +++ b/intrastat_base/intrastat_menu.xml @@ -1,7 +1,7 @@ @@ -9,7 +9,7 @@ - + diff --git a/intrastat_base/product.py b/intrastat_base/product.py index 7181706..ca1652e 100644 --- a/intrastat_base/product.py +++ b/intrastat_base/product.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/) +# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,43 +20,32 @@ # ############################################################################## -from openerp.osv import orm, fields -from openerp.tools.translate import _ +from openerp import models, fields, api, _ +from openerp.exceptions import ValidationError -class product_template(orm.Model): +class ProductTemplate(models.Model): _inherit = "product.template" - _columns = { - 'exclude_from_intrastat': fields.boolean( - 'Exclude from Intrastat reports', - help="If set to True, the product or service will not be " - "taken into account for Intrastat Product or Service reports. " - "So you should leave this field to False unless you have a " - "very good reason."), - 'is_accessory_cost': fields.boolean( - '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."), - } - _defaults = { - 'exclude_from_intrastat': False, - } + exclude_from_intrastat = fields.Boolean( + string='Exclude from Intrastat reports', + help="If set to True, the product or service will not be " + "taken into account for Intrastat Product or Service reports. " + "So you should leave this field to False unless you have a " + "very good reason.") + 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.") - def _check_accessory_cost(self, cr, uid, ids): - for product in self.browse(cr, uid, ids): - if product.is_accessory_cost and product.type != 'service': - raise orm.except_orm( - _('Error :'), - _("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'" - % (product.name, product.type))) - return True - - _constraints = [ - (_check_accessory_cost, "Error msg is in raise", - ['is_accessory_cost', 'type']) - ] + @api.one + @api.constrains('type', 'is_accessory_cost') + def _check_accessory_cost(self): + if self.is_accessory_cost and self.type != 'service': + raise ValidationError( + _("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'" + % (self.name, self.type))) diff --git a/intrastat_base/product_view.xml b/intrastat_base/product_view.xml index a551868..dc61ca5 100644 --- a/intrastat_base/product_view.xml +++ b/intrastat_base/product_view.xml @@ -1,7 +1,7 @@ @@ -9,11 +9,10 @@ - - - intrastat.base.product.normal.form - product.product - + + intrastat.base.product.template.form + product.template + @@ -25,21 +24,5 @@ - - - intrastat.base.product.template.form - product.template - - - - - - - - - - - diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py index fae6a3d..2b98678 100644 --- a/intrastat_base/tax.py +++ b/intrastat_base/tax.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2011-2013 Akretion (http://www.akretion.com). +# Report intrastat base module for Odoo +# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,16 +20,14 @@ # ############################################################################## -from openerp.osv import orm, fields +from openerp import models, fields -class account_tax(orm.Model): +class AccountTax(models.Model): _inherit = "account.tax" - _columns = { - 'exclude_from_intrastat_if_present': fields.boolean( - 'Exclude invoice line from intrastat if this tax is present', - help="If this tax is present on an invoice line, this invoice " - "line will be skipped when generating Intrastat Product or " - "Service lines from invoices."), - } + exclude_from_intrastat_if_present = fields.Boolean( + string='Exclude invoice line from intrastat if this tax is present', + help="If this tax is present on an invoice line, this invoice " + "line will be skipped when generating Intrastat Product or " + "Service lines from invoices.") diff --git a/intrastat_base/tax_view.xml b/intrastat_base/tax_view.xml index c481490..5defe29 100644 --- a/intrastat_base/tax_view.xml +++ b/intrastat_base/tax_view.xml @@ -1,7 +1,7 @@ @@ -10,17 +10,14 @@ - + intrastat.base.tax account.tax - form - - From ebd037076b8443a0cc382ad6fc0e913665f440c0 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Wed, 4 Feb 2015 20:11:31 +0100 Subject: [PATCH 06/90] Make dutch ICP report workable on odoo 8.0 [FIX] Some small changes in base, to make check_generate_lines better reusable (no need to force currency field on report), and do away with '_' before method name, as method should not be private, as it is called from other classes. --- intrastat_base/intrastat_common.py | 199 +++++++++++++++++------------ 1 file changed, 115 insertions(+), 84 deletions(-) diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index fa65afe..47c10ac 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). +# Report intrastat base module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,9 +20,9 @@ # ############################################################################## -from openerp import models, api, tools, _ -from openerp.tools import DEFAULT_SERVER_DATE_FORMAT -from openerp.exceptions import Warning, ValidationError +from openerp.osv import orm +from openerp.tools.translate import _ +from openerp import tools from datetime import datetime from dateutil.relativedelta import relativedelta import logging @@ -30,64 +30,81 @@ import logging logger = logging.getLogger(__name__) -class ReportIntrastatCommon(models.AbstractModel): +class report_intrastat_common(orm.TransientModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products " "and services" - @api.one - @api.depends( - 'intrastat_line_ids', 'intrastat_line_ids.amount_company_currency') - def _compute_numbers(self): - total_amount = 0.0 - num_lines = 0 - for line in self.intrastat_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - self.num_lines = num_lines - self.total_amount = total_amount + def _compute_numbers(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + total_amount = 0.0 + num_lines = 0 + for line in intrastat.intrastat_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + result[intrastat.id] = { + 'num_lines': num_lines, + 'total_amount': total_amount, + } + return result - @api.one - @api.depends('start_date') - def _compute_dates(self): - start_date_dt = datetime.strptime( - self.start_date, DEFAULT_SERVER_DATE_FORMAT) - self.end_date = datetime.strftime( - start_date_dt + relativedelta(day=31), DEFAULT_SERVER_DATE_FORMAT) - self.year_month = start_date_dt.strftime('%Y-%m') + def _compute_dates(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + start_date_datetime = datetime.strptime( + intrastat.start_date, '%Y-%m-%d') + end_date_str = datetime.strftime( + start_date_datetime + relativedelta(day=31), '%Y-%m-%d') + result[intrastat.id] = { + 'end_date': end_date_str, + 'year_month': start_date_datetime.strftime('%Y-%m'), + } + return result - @api.one - @api.constrains('start_date') - def _check_start_date(self): + def _check_start_date(self, cr, uid, ids, object, context=None): '''Check that the start date is the first day of the month''' - datetime_to_check = datetime.strptime( - self.start_date, DEFAULT_SERVER_DATE_FORMAT) - if datetime_to_check.day != 1: - return ValidationError( - _('The start date must be the first day of the month')) + for date_to_check in object.read( + cr, uid, ids, ['start_date'], context=context): + datetime_to_check = datetime.strptime( + date_to_check['start_date'], '%Y-%m-%d') + if datetime_to_check.day != 1: + return False + return True - @api.one - def _check_generate_lines(self): - if not self.company_id.country_id: - raise Warning( + def check_generate_lines(self, cr, uid, intrastat, context=None): + """Check wether all requirements are met for generating lines.""" + if not intrastat.company_id: + # Should not be possible, but just in case: + raise orm.except_orm( + _('Error :'), + _("Company not yet set on intrastat report.") + ) + company_obj = intrastat.company_id # Simplify references + if not company_obj.country_id: + raise orm.except_orm( + _('Error :'), _("The country is not set on the company '%s'.") - % self.company_id.name) - if self.currency_id.name != 'EUR': - raise Warning( + % company_obj.name + ) + if not company_obj.currency_id.name == 'EUR': + raise orm.except_orm( + _('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") - % self.currency_id.name) + % company_obj.currency_id.name + ) return True - @api.one - def _check_generate_xml(self): - if not self.company_id.partner_id.vat: - raise Warning( + def _check_generate_xml(self, cr, uid, intrastat, context=None): + if not intrastat.company_id.partner_id.vat: + raise orm.except_orm( + _('Error :'), _("The VAT number is not set for the partner '%s'.") - % self.company_id.partner_id.name) + % intrastat.company_id.partner_id.name) return True - @api.model - def _check_xml_schema(self, xml_root, xml_string, xsd_file): + def _check_xml_schema( + self, cr, uid, xml_root, xml_string, xsd_file, context=None): '''Validate the XML file against the XSD''' from lxml import etree xsd_etree_obj = etree.parse( @@ -97,12 +114,13 @@ class ReportIntrastatCommon(models.AbstractModel): official_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here - logger = logging.getLogger(__name__) - logger.warning( + _logger = logging.getLogger(__name__) + _logger.warning( "The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) - logger.warning(e) - raise Warning( + _logger.warning(xml_string) + _logger.warning(e) + raise orm.except_orm( + _('Error :'), _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -111,29 +129,39 @@ class ReportIntrastatCommon(models.AbstractModel): % str(e)) return True - @api.multi - def _attach_xml_file(self, xml_string, declaration_name): + def _attach_xml_file( + self, cr, uid, ids, object, xml_string, start_date_datetime, + declaration_name, context=None): '''Attach the XML file to the report_intrastat_product/service ''' '''object''' - self.ensure_one() import base64 - filename = '%s_%s.xml' % (self.year_month, declaration_name) - attach = self.with_context( - default_res_id=self.id, - default_res_model=self._name).env['ir.attachment'].create({ - 'name': filename, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}) - return attach.id + assert len(ids) == 1, "Only one ID accepted" + filename = '%s_%s.xml' % ( + datetime.strftime(start_date_datetime, '%Y-%m'), + declaration_name) + if not context: + context = {} + context.update({ + 'default_res_id': ids[0], + 'default_res_model': object._name + }) + attach_id = self.pool['ir.attachment'].create( + cr, uid, { + 'name': filename, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}, + context=context) + return attach_id - @api.model - def _open_attach_view(self, attach_id, title='XML file'): + def _open_attach_view( + self, cr, uid, attach_id, title='XML file', context=None): '''Returns an action which opens the form view of the ''' '''corresponding attachement''' action = { 'name': title, 'view_type': 'form', - 'view_mode': 'form', + 'view_mode': 'form,tree', + 'view_id': False, 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'nodestroy': True, @@ -142,27 +170,30 @@ class ReportIntrastatCommon(models.AbstractModel): } return action - @api.one - def send_reminder_email(self, mail_template_xmlid): - mail_template = self.env.ref(mail_template_xmlid) - if self.company_id.intrastat_remind_user_ids: + def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): + result = {} + result['value'] = {} + if partner_id: + company = self.pool['res.partner'].read( + cr, uid, partner_id, ['vat'], context=context) + result['value']['partner_vat'] = company['vat'] + return result + + def send_reminder_email( + self, cr, uid, company, module_name, template_xmlid, + intrastat_id, context=None): + template_model, template_id =\ + self.pool['ir.model.data'].get_object_reference( + cr, uid, module_name, template_xmlid) + assert template_model == 'email.template', 'Wrong model' + if company.intrastat_remind_user_ids: self.pool['email.template'].send_mail( - self._cr, self._uid, mail_template.id, self.id, - context=self._context) + cr, uid, template_id, intrastat_id, context=context) logger.info( 'Intrastat Reminder email has been sent (XMLID: %s).' - % mail_template_xmlid) + % template_xmlid) else: logger.warning( 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % self.company_id.name) + 'on company %s' % company.name) return True - - @api.multi - def unlink(self): - for intrastat in self: - if intrastat.state == 'done': - raise Warning( - _('Cannot delete the declaration %s ' - 'because it is in Done state') % self.year_month) - return super(ReportIntrastatCommon, self).unlink() From d7b8501511ba0acc2ca7f2354a24f139af5c2b48 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sat, 7 Feb 2015 11:36:42 +0100 Subject: [PATCH 07/90] Continue the port to the new API Access for intrastat report to accounting user and not only accounting manager. --- intrastat_base/__openerp__.py | 3 +- intrastat_base/intrastat_common.py | 195 ++++++++++++----------------- 2 files changed, 81 insertions(+), 117 deletions(-) diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 179cb4a..e795155 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -2,7 +2,7 @@ ############################################################################## # # Report intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) +# Copyright (C) 2011-2015 Akretion (http://www.akretion.com) # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,7 +20,6 @@ # ############################################################################## - { 'name': 'Intrastat Reporting Base', 'version': '1.1', diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 47c10ac..b6d8b2f 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). +# Report intrastat base module for Odoo +# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,9 +20,8 @@ # ############################################################################## -from openerp.osv import orm -from openerp.tools.translate import _ -from openerp import tools +from openerp import models, fields, api, tools, _ +from openerp.exceptions import Warning, ValidationError from datetime import datetime from dateutil.relativedelta import relativedelta import logging @@ -30,81 +29,61 @@ import logging logger = logging.getLogger(__name__) -class report_intrastat_common(orm.TransientModel): +class ReportIntrastatCommon(models.AbstractModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products " "and services" - def _compute_numbers(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - total_amount = 0.0 - num_lines = 0 - for line in intrastat.intrastat_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - result[intrastat.id] = { - 'num_lines': num_lines, - 'total_amount': total_amount, - } - return result + @api.one + @api.depends( + 'intrastat_line_ids', 'intrastat_line_ids.amount_company_currency') + def _compute_numbers(self): + total_amount = 0.0 + num_lines = 0 + for line in self.intrastat_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + self.num_lines = num_lines + self.total_amount = total_amount - def _compute_dates(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - start_date_datetime = datetime.strptime( - intrastat.start_date, '%Y-%m-%d') - end_date_str = datetime.strftime( - start_date_datetime + relativedelta(day=31), '%Y-%m-%d') - result[intrastat.id] = { - 'end_date': end_date_str, - 'year_month': start_date_datetime.strftime('%Y-%m'), - } - return result + @api.one + @api.depends('start_date') + def _compute_dates(self): + start_date_dt = fields.Date.from_string(self.start_date) + self.end_date = fields.Date.to_string( + start_date_dt + relativedelta(day=31)) + self.year_month = start_date_dt.strftime('%Y-%m') - def _check_start_date(self, cr, uid, ids, object, context=None): + @api.one + def _check_start_date(self): '''Check that the start date is the first day of the month''' - for date_to_check in object.read( - cr, uid, ids, ['start_date'], context=context): - datetime_to_check = datetime.strptime( - date_to_check['start_date'], '%Y-%m-%d') - if datetime_to_check.day != 1: - return False - return True + datetime_to_check = fields.Date.from_string(self.start_date) + if datetime_to_check.day != 1: + raise ValidationError( + _('The start date must be the first day of the month')) - def check_generate_lines(self, cr, uid, intrastat, context=None): - """Check wether all requirements are met for generating lines.""" - if not intrastat.company_id: - # Should not be possible, but just in case: - raise orm.except_orm( - _('Error :'), - _("Company not yet set on intrastat report.") - ) - company_obj = intrastat.company_id # Simplify references - if not company_obj.country_id: - raise orm.except_orm( - _('Error :'), + @api.one + def _check_generate_lines(self): + if not self.company_id.country_id: + raise Warning( _("The country is not set on the company '%s'.") - % company_obj.name - ) - if not company_obj.currency_id.name == 'EUR': - raise orm.except_orm( - _('Error :'), + % self.company_id.name) + if self.currency_id.name != 'EUR': + raise Warning( _("The company currency must be 'EUR', but is currently '%s'.") - % company_obj.currency_id.name - ) + % self.currency_id.name) return True - def _check_generate_xml(self, cr, uid, intrastat, context=None): - if not intrastat.company_id.partner_id.vat: - raise orm.except_orm( - _('Error :'), + @api.one + def _check_generate_xml(self): + if not self.company_id.partner_id.vat: + raise Warning( _("The VAT number is not set for the partner '%s'.") - % intrastat.company_id.partner_id.name) + % self.company_id.partner_id.name) return True - def _check_xml_schema( - self, cr, uid, xml_root, xml_string, xsd_file, context=None): + @api.model + def _check_xml_schema(self, xml_root, xml_string, xsd_file): '''Validate the XML file against the XSD''' from lxml import etree xsd_etree_obj = etree.parse( @@ -114,13 +93,12 @@ class report_intrastat_common(orm.TransientModel): official_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here - _logger = logging.getLogger(__name__) - _logger.warning( + logger = logging.getLogger(__name__) + logger.warning( "The XML file is invalid against the XML Schema Definition") - _logger.warning(xml_string) - _logger.warning(e) - raise orm.except_orm( - _('Error :'), + logger.warning(xml_string) + logger.warning(e) + raise Warning( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -129,39 +107,29 @@ class report_intrastat_common(orm.TransientModel): % str(e)) return True - def _attach_xml_file( - self, cr, uid, ids, object, xml_string, start_date_datetime, - declaration_name, context=None): + @api.multi + def _attach_xml_file(self, xml_string, declaration_name): '''Attach the XML file to the report_intrastat_product/service ''' '''object''' + self.ensure_one() import base64 - assert len(ids) == 1, "Only one ID accepted" - filename = '%s_%s.xml' % ( - datetime.strftime(start_date_datetime, '%Y-%m'), - declaration_name) - if not context: - context = {} - context.update({ - 'default_res_id': ids[0], - 'default_res_model': object._name - }) - attach_id = self.pool['ir.attachment'].create( - cr, uid, { - 'name': filename, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}, - context=context) - return attach_id + filename = '%s_%s.xml' % (self.year_month, declaration_name) + attach = self.with_context( + default_res_id=self.id, + default_res_model=self._name).env['ir.attachment'].create({ + 'name': filename, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}) + return attach.id - def _open_attach_view( - self, cr, uid, attach_id, title='XML file', context=None): + @api.model + def _open_attach_view(self, attach_id, title='XML file'): '''Returns an action which opens the form view of the ''' '''corresponding attachement''' action = { 'name': title, 'view_type': 'form', - 'view_mode': 'form,tree', - 'view_id': False, + 'view_mode': 'form', 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'nodestroy': True, @@ -170,30 +138,27 @@ class report_intrastat_common(orm.TransientModel): } return action - def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): - result = {} - result['value'] = {} - if partner_id: - company = self.pool['res.partner'].read( - cr, uid, partner_id, ['vat'], context=context) - result['value']['partner_vat'] = company['vat'] - return result - - def send_reminder_email( - self, cr, uid, company, module_name, template_xmlid, - intrastat_id, context=None): - template_model, template_id =\ - self.pool['ir.model.data'].get_object_reference( - cr, uid, module_name, template_xmlid) - assert template_model == 'email.template', 'Wrong model' - if company.intrastat_remind_user_ids: + @api.one + def send_reminder_email(self, mail_template_xmlid): + mail_template = self.env.ref(mail_template_xmlid) + if self.company_id.intrastat_remind_user_ids: self.pool['email.template'].send_mail( - cr, uid, template_id, intrastat_id, context=context) + self._cr, self._uid, mail_template.id, self.id, + context=self._context) logger.info( 'Intrastat Reminder email has been sent (XMLID: %s).' - % template_xmlid) + % mail_template_xmlid) else: logger.warning( 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % company.name) + 'on company %s' % self.company_id.name) return True + + @api.multi + def unlink(self): + for intrastat in self: + if intrastat.state == 'done': + raise Warning( + _('Cannot delete the declaration %s ' + 'because it is in Done state') % self.year_month) + return super(ReportIntrastatCommon, self).unlink() From d78cc5caf6447a79205fa4b792f79692172b0d03 Mon Sep 17 00:00:00 2001 From: Ronald Portier Date: Fri, 13 Feb 2015 11:24:14 +0100 Subject: [PATCH 08/90] Revert rename of _check_generate_lines to version withouth underscore. In pending merge request from Alexis, _check_generate_lines will no longer be called from outside the class, so no longer any need to change private function name convention to public name convention. This will also make it easier to merge all changes. --- intrastat_base/intrastat_common.py | 195 +++++++++++++++++------------ 1 file changed, 115 insertions(+), 80 deletions(-) diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index b6d8b2f..3db1764 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). +# Report intrastat base module for OpenERP +# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,8 +20,9 @@ # ############################################################################## -from openerp import models, fields, api, tools, _ -from openerp.exceptions import Warning, ValidationError +from openerp.osv import orm +from openerp.tools.translate import _ +from openerp import tools from datetime import datetime from dateutil.relativedelta import relativedelta import logging @@ -29,61 +30,81 @@ import logging logger = logging.getLogger(__name__) -class ReportIntrastatCommon(models.AbstractModel): +class report_intrastat_common(orm.TransientModel): _name = "report.intrastat.common" _description = "Common functions for intrastat reports for products " "and services" - @api.one - @api.depends( - 'intrastat_line_ids', 'intrastat_line_ids.amount_company_currency') - def _compute_numbers(self): - total_amount = 0.0 - num_lines = 0 - for line in self.intrastat_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - self.num_lines = num_lines - self.total_amount = total_amount + def _compute_numbers(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + total_amount = 0.0 + num_lines = 0 + for line in intrastat.intrastat_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + result[intrastat.id] = { + 'num_lines': num_lines, + 'total_amount': total_amount, + } + return result - @api.one - @api.depends('start_date') - def _compute_dates(self): - start_date_dt = fields.Date.from_string(self.start_date) - self.end_date = fields.Date.to_string( - start_date_dt + relativedelta(day=31)) - self.year_month = start_date_dt.strftime('%Y-%m') + def _compute_dates(self, cr, uid, ids, object, context=None): + result = {} + for intrastat in object.browse(cr, uid, ids, context=context): + start_date_datetime = datetime.strptime( + intrastat.start_date, '%Y-%m-%d') + end_date_str = datetime.strftime( + start_date_datetime + relativedelta(day=31), '%Y-%m-%d') + result[intrastat.id] = { + 'end_date': end_date_str, + 'year_month': start_date_datetime.strftime('%Y-%m'), + } + return result - @api.one - def _check_start_date(self): + def _check_start_date(self, cr, uid, ids, object, context=None): '''Check that the start date is the first day of the month''' - datetime_to_check = fields.Date.from_string(self.start_date) - if datetime_to_check.day != 1: - raise ValidationError( - _('The start date must be the first day of the month')) + for date_to_check in object.read( + cr, uid, ids, ['start_date'], context=context): + datetime_to_check = datetime.strptime( + date_to_check['start_date'], '%Y-%m-%d') + if datetime_to_check.day != 1: + return False + return True - @api.one - def _check_generate_lines(self): - if not self.company_id.country_id: - raise Warning( + def _check_generate_lines(self, cr, uid, intrastat, context=None): + """Check wether all requirements are met for generating lines.""" + if not intrastat.company_id: + # Should not be possible, but just in case: + raise orm.except_orm( + _('Error :'), + _("Company not yet set on intrastat report.") + ) + company_obj = intrastat.company_id # Simplify references + if not company_obj.country_id: + raise orm.except_orm( + _('Error :'), _("The country is not set on the company '%s'.") - % self.company_id.name) - if self.currency_id.name != 'EUR': - raise Warning( + % company_obj.name + ) + if not company_obj.currency_id.name == 'EUR': + raise orm.except_orm( + _('Error :'), _("The company currency must be 'EUR', but is currently '%s'.") - % self.currency_id.name) + % company_obj.currency_id.name + ) return True - @api.one - def _check_generate_xml(self): - if not self.company_id.partner_id.vat: - raise Warning( + def _check_generate_xml(self, cr, uid, intrastat, context=None): + if not intrastat.company_id.partner_id.vat: + raise orm.except_orm( + _('Error :'), _("The VAT number is not set for the partner '%s'.") - % self.company_id.partner_id.name) + % intrastat.company_id.partner_id.name) return True - @api.model - def _check_xml_schema(self, xml_root, xml_string, xsd_file): + def _check_xml_schema( + self, cr, uid, xml_root, xml_string, xsd_file, context=None): '''Validate the XML file against the XSD''' from lxml import etree xsd_etree_obj = etree.parse( @@ -93,12 +114,13 @@ class ReportIntrastatCommon(models.AbstractModel): official_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here - logger = logging.getLogger(__name__) - logger.warning( + _logger = logging.getLogger(__name__) + _logger.warning( "The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) - logger.warning(e) - raise Warning( + _logger.warning(xml_string) + _logger.warning(e) + raise orm.except_orm( + _('Error :'), _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -107,29 +129,39 @@ class ReportIntrastatCommon(models.AbstractModel): % str(e)) return True - @api.multi - def _attach_xml_file(self, xml_string, declaration_name): + def _attach_xml_file( + self, cr, uid, ids, object, xml_string, start_date_datetime, + declaration_name, context=None): '''Attach the XML file to the report_intrastat_product/service ''' '''object''' - self.ensure_one() import base64 - filename = '%s_%s.xml' % (self.year_month, declaration_name) - attach = self.with_context( - default_res_id=self.id, - default_res_model=self._name).env['ir.attachment'].create({ - 'name': filename, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}) - return attach.id + assert len(ids) == 1, "Only one ID accepted" + filename = '%s_%s.xml' % ( + datetime.strftime(start_date_datetime, '%Y-%m'), + declaration_name) + if not context: + context = {} + context.update({ + 'default_res_id': ids[0], + 'default_res_model': object._name + }) + attach_id = self.pool['ir.attachment'].create( + cr, uid, { + 'name': filename, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}, + context=context) + return attach_id - @api.model - def _open_attach_view(self, attach_id, title='XML file'): + def _open_attach_view( + self, cr, uid, attach_id, title='XML file', context=None): '''Returns an action which opens the form view of the ''' '''corresponding attachement''' action = { 'name': title, 'view_type': 'form', - 'view_mode': 'form', + 'view_mode': 'form,tree', + 'view_id': False, 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'nodestroy': True, @@ -138,27 +170,30 @@ class ReportIntrastatCommon(models.AbstractModel): } return action - @api.one - def send_reminder_email(self, mail_template_xmlid): - mail_template = self.env.ref(mail_template_xmlid) - if self.company_id.intrastat_remind_user_ids: + def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): + result = {} + result['value'] = {} + if partner_id: + company = self.pool['res.partner'].read( + cr, uid, partner_id, ['vat'], context=context) + result['value']['partner_vat'] = company['vat'] + return result + + def send_reminder_email( + self, cr, uid, company, module_name, template_xmlid, + intrastat_id, context=None): + template_model, template_id =\ + self.pool['ir.model.data'].get_object_reference( + cr, uid, module_name, template_xmlid) + assert template_model == 'email.template', 'Wrong model' + if company.intrastat_remind_user_ids: self.pool['email.template'].send_mail( - self._cr, self._uid, mail_template.id, self.id, - context=self._context) + cr, uid, template_id, intrastat_id, context=context) logger.info( 'Intrastat Reminder email has been sent (XMLID: %s).' - % mail_template_xmlid) + % template_xmlid) else: logger.warning( 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % self.company_id.name) + 'on company %s' % company.name) return True - - @api.multi - def unlink(self): - for intrastat in self: - if intrastat.state == 'done': - raise Warning( - _('Cannot delete the declaration %s ' - 'because it is in Done state') % self.year_month) - return super(ReportIntrastatCommon, self).unlink() From a509baa6c2b02b8b1a13658e671cca9783e81d65 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 14 Apr 2015 22:33:32 +0200 Subject: [PATCH 09/90] [IMP] intrasta_base: Several imps: * Move description from __openerp__.py to README.rst Add conflict key in __openerp__.py Simplify code that create attachment Thanks to Luc de Meyer (Noviat) for his help on this. * Update README.rst and translation files * Simplify @depends, as suggested by Yannick * Better use of the new API for send_mail(), as suggested by Yannick (and tested be me) * Large code re-engineering following the Akretion-Noviat code sprint on intrastat This code has been written both by Luc de Meyer and myself. * Add first draft of code to generate decl lines --- intrastat_base/README.rst | 44 +++++ intrastat_base/__openerp__.py | 20 +-- intrastat_base/company_view.xml | 2 +- intrastat_base/country.py | 2 +- intrastat_base/i18n/fr_FR.po | 99 ++++++------ intrastat_base/i18n/intrastat_base.pot | 95 +++++------ intrastat_base/intrastat_common.py | 216 +++++++++++-------------- intrastat_base/intrastat_menu.xml | 16 -- intrastat_base/intrastat_view.xml | 36 +++++ intrastat_base/product.py | 2 +- intrastat_base/tax.py | 2 +- 11 files changed, 273 insertions(+), 261 deletions(-) create mode 100644 intrastat_base/README.rst delete mode 100644 intrastat_base/intrastat_menu.xml create mode 100644 intrastat_base/intrastat_view.xml diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst new file mode 100644 index 0000000..a941d1d --- /dev/null +++ b/intrastat_base/README.rst @@ -0,0 +1,44 @@ +Intrastat Base Module +===================== + +This module contains common functions for the Intrastat reporting and +should be used in combination with country-specific reporting modules +such as: + +- *l10n_fr_intrastat_service*: + the module for the *Déclaration Européenne des Services* (DES) for France +- *l10n_fr_intrastat_product*: + the module for the *Déclaration d'Echange de Biens* (DEB) for France +- *l10n_be_intrastat_product*: + the module for the Intrastat Declaration for Belgium. + +These country-specific modules can be found in the OCA localization for those countries. + +Installation +============ + +WARNING: +This module conflicts with the module *report_intrastat* from the official addons. +If you have already installed the module *report_intrastat*, +you should uninstall it first before installing this module. + +Credits +======= + +Contributors +------------ + +* Alexis de Lattre, Akretion + +Maintainer +---------- + +.. image:: http://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: http://odoo-community.org + +This module is maintained by the OCA. + +OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. + +To contribute to this module, please visit http://odoo-community.org. diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index e795155..ea5483f 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for Odoo +# Intrastat base module for Odoo # Copyright (C) 2011-2015 Akretion (http://www.akretion.com) # @author Alexis de Lattre # @@ -23,23 +23,13 @@ { 'name': 'Intrastat Reporting Base', 'version': '1.1', - 'category': 'Localisation/Report Intrastat', + 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', - 'description': """This module contains the common functions for 2 other modules : -- l10n_fr_intrastat_service : the module for the "Déclaration Européenne des Services" (DES) -- l10n_fr_intrastat_product : the module for the "Déclaration d'Echange de Biens" (DEB) -This module is not usefull if it's not used together with one of those 2 modules or other country-specific intrastat modules. - -This module doesn't have any France-specific stuff. So it can be used as a basis for other intrastat modules for other EU countries. - -WARNING : this module conflicts with the module "report_intrastat" from the addons. If you have already installed the module "report_intrastat", you should uninstall it first before installing this module. - -Please contact Alexis de Lattre from Akretion for any help or question about this module. - """, - 'author': 'Akretion', + 'author': 'Akretion,Odoo Community Association (OCA)', 'website': 'http://www.akretion.com', 'depends': ['base_vat'], + 'conflicts': ['report_intrastat'], 'data': [ 'country_data.xml', 'product_view.xml', @@ -47,7 +37,7 @@ Please contact Alexis de Lattre from Akretion for 'country_view.xml', 'tax_view.xml', 'company_view.xml', - 'intrastat_menu.xml', + 'intrastat_view.xml', ], 'demo': ['intrastat_demo.xml'], 'installable': True, diff --git a/intrastat_base/company_view.xml b/intrastat_base/company_view.xml index 87933f4..1df7aed 100644 --- a/intrastat_base/company_view.xml +++ b/intrastat_base/company_view.xml @@ -16,7 +16,7 @@ - + diff --git a/intrastat_base/country.py b/intrastat_base/country.py index 7f03e5d..7a34e77 100644 --- a/intrastat_base/country.py +++ b/intrastat_base/country.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for Odoo +# Intrastat base module for Odoo # Copyright (C) 2011-2014 Akretion (http://www.akretion.com). # @author Alexis de Lattre # diff --git a/intrastat_base/i18n/fr_FR.po b/intrastat_base/i18n/fr_FR.po index de7e5db..1b3d759 100644 --- a/intrastat_base/i18n/fr_FR.po +++ b/intrastat_base/i18n/fr_FR.po @@ -1,14 +1,14 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * intrastat_base # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-14 14:18+0000\n" -"PO-Revision-Date: 2014-04-14 14:18+0000\n" -"Last-Translator: Alexis de Lattre \n" +"POT-Creation-Date: 2015-05-27 18:43+0000\n" +"PO-Revision-Date: 2015-05-27 18:43+0000\n" +"Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -21,47 +21,43 @@ msgid "Activate this option for shipping costs, packaging costs and all services msgstr "Activez cette option pour les frais de port, les frais d'emballage et tous les services liés à la vente de produits physiques. Cette option est utilisée pour la DEB et la DES." #. module: intrastat_base -#: view:res.company:0 +#: code:addons/intrastat_base/intrastat_common.py:165 +#, python-format +msgid "Cannot delete the declaration %s because it is in Done state" +msgstr "Impossible de supprimer la déclaration %s car elle est à l'état déclaré" + +#. module: intrastat_base +#: view:res.company:intrastat_base.view_company_form msgid "Common Intrastat Settings" msgstr "Paramètres communs DEB et DES" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_report_intrastat_common -msgid "Common functions for intrastat reports for products and services" -msgstr "Fonctions communes pour la DEB et la DES" +msgid "Common functions for intrastat reports for products " +msgstr "" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_company msgid "Companies" msgstr "Sociétés" +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:68 +#, python-format +msgid "Company not yet set on intrastat report." +msgstr "Société non configurée sur le rapport intrastat." + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "Pays" #. module: intrastat_base -#: view:res.country:0 +#: view:res.country:intrastat_base.view_country_search #: field:res.country,intrastat:0 msgid "EU Country" msgstr "Pays UE" -#. module: intrastat_base -#: code:addons/intrastat_base/company.py:58 -#: code:addons/intrastat_base/intrastat_common.py:77 -#: code:addons/intrastat_base/intrastat_common.py:82 -#: code:addons/intrastat_base/intrastat_common.py:90 -#: code:addons/intrastat_base/intrastat_common.py:110 -#: code:addons/intrastat_base/product.py:51 -#, python-format -msgid "Error :" -msgstr "Erreur :" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error msg is in raise" -msgstr "Error msg is in raise" - #. module: intrastat_base #: field:product.template,exclude_from_intrastat:0 msgid "Exclude from Intrastat reports" @@ -72,6 +68,11 @@ msgstr "Exclure de la DEB et de la DES" msgid "Exclude invoice line from intrastat if this tax is present" msgstr "Exclue la ligne de facture de la DEB/DES si cette taxe est présente" +#. module: intrastat_base +#: field:report.intrastat.common,id:0 +msgid "ID" +msgstr "ID" + #. module: intrastat_base #: help:product.template,exclude_from_intrastat:0 msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." @@ -83,21 +84,20 @@ msgid "If this tax is present on an invoice line, this invoice line will be skip msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture ne sera pas prise en compte lors de la génération de la DEB et de la DES depuis les factures." #. module: intrastat_base -#: view:product.product:0 -#: view:product.template:0 +#: view:product.template:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "Propriétés DEB/DES" -#. module: intrastat_base -#: view:res.company:0 -msgid "Intrastat Settings" -msgstr "Configuration DEB/DES" - #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root msgid "Intrastat Reporting" msgstr "DEB et DES" +#. module: intrastat_base +#: view:res.company:intrastat_base.view_company_form +msgid "Intrastat Settings" +msgstr "Configuration DEB/DES" + #. module: intrastat_base #: field:product.template,is_accessory_cost:0 msgid "Is accessory cost" @@ -109,28 +109,18 @@ msgid "List of OpenERP users who will receive a notification to remind them abou msgstr "Liste d'utilisateurs OpenERP qui recevront le rappel pour la DEB et/ou la DES." #. module: intrastat_base -#: field:res.company,intrastat_email_list:0 -msgid "List of emails of Users Receiving the Intrastat Reminder" -msgstr "Liste des emails d'utilisateurs qui recevront le rappel pour la DEB et/ou la DES" - -#. module: intrastat_base -#: code:addons/intrastat_base/company.py:59 +#: code:addons/intrastat_base/company.py:55 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante sur l'utilisateur '%s'." -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner -msgid "Partner" -msgstr "Partenaire" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "Modèle d'article" #. module: intrastat_base -#: view:res.country:0 +#: view:res.country:intrastat_base.view_country_search msgid "Search Countries" msgstr "Recherche des pays" @@ -150,42 +140,43 @@ msgid "Tax" msgstr "Taxes" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:91 +#: code:addons/intrastat_base/intrastat_common.py:84 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "Le numéro de TVA n'est pas renseigné pour le partenaire '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:83 +#: code:addons/intrastat_base/intrastat_common.py:76 #, python-format msgid "The company currency must be 'EUR', but is currently '%s'." msgstr "La monnaie de la société doit être 'EUR', mais est actuellement '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:78 +#: code:addons/intrastat_base/intrastat_common.py:72 #, python-format msgid "The country is not set on the company '%s'." msgstr "Le pays n'est pas renseigné sur la société '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:111 +#: code:addons/intrastat_base/intrastat_common.py:105 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." msgstr "La validation du fichier XML avec le schéma XML officiel a échoué. Le fichier XML généré et le détail de l'erreur ont été écrits dans les logs du serveur. Voici le message d'erreur, qui peut vous donner une idée de la cause du problème : %s." #. module: intrastat_base -#: code:addons/intrastat_base/product.py:56 +#: code:addons/intrastat_base/product.py:51 #, python-format msgid "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'" msgstr "L'option 'Frais accessoires' ne doit être activée que sur les produits de type 'Service'. Vous avez activé cette option sur le produit '%s' qui est de type '%s'" +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:62 +#, python-format +msgid "The start date must be the first day of the month" +msgstr "La date de début doit être le premier jour du mois" + #. module: intrastat_base #: field:res.company,intrastat_remind_user_ids:0 msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" -#. module: intrastat_base -#: constraint:res.company:0 -msgid "error msg in raise" -msgstr "error msg in raise" - diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index d184def..fdc6996 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -1,13 +1,13 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: # * intrastat_base # msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-14 14:18+0000\n" -"PO-Revision-Date: 2014-04-14 14:18+0000\n" +"POT-Creation-Date: 2015-05-27 18:43+0000\n" +"PO-Revision-Date: 2015-05-27 18:43+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -21,13 +21,19 @@ msgid "Activate this option for shipping costs, packaging costs and all services msgstr "" #. module: intrastat_base -#: view:res.company:0 +#: code:addons/intrastat_base/intrastat_common.py:165 +#, python-format +msgid "Cannot delete the declaration %s because it is in Done state" +msgstr "" + +#. module: intrastat_base +#: view:res.company:intrastat_base.view_company_form msgid "Common Intrastat Settings" msgstr "" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_report_intrastat_common -msgid "Common functions for intrastat reports for products and services" +msgid "Common functions for intrastat reports for products " msgstr "" #. module: intrastat_base @@ -35,33 +41,23 @@ msgstr "" msgid "Companies" msgstr "" +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:68 +#, python-format +msgid "Company not yet set on intrastat report." +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "" #. module: intrastat_base -#: view:res.country:0 +#: view:res.country:intrastat_base.view_country_search #: field:res.country,intrastat:0 msgid "EU Country" msgstr "" -#. module: intrastat_base -#: code:addons/intrastat_base/company.py:58 -#: code:addons/intrastat_base/intrastat_common.py:77 -#: code:addons/intrastat_base/intrastat_common.py:82 -#: code:addons/intrastat_base/intrastat_common.py:90 -#: code:addons/intrastat_base/intrastat_common.py:110 -#: code:addons/intrastat_base/product.py:51 -#, python-format -msgid "Error :" -msgstr "" - -#. module: intrastat_base -#: constraint:product.template:0 -msgid "Error msg is in raise" -msgstr "" - #. module: intrastat_base #: field:product.template,exclude_from_intrastat:0 msgid "Exclude from Intrastat reports" @@ -72,6 +68,11 @@ msgstr "" msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" +#. module: intrastat_base +#: field:report.intrastat.common,id:0 +msgid "ID" +msgstr "" + #. module: intrastat_base #: help:product.template,exclude_from_intrastat:0 msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." @@ -83,21 +84,20 @@ msgid "If this tax is present on an invoice line, this invoice line will be skip msgstr "" #. module: intrastat_base -#: view:product.product:0 -#: view:product.template:0 +#: view:product.template:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "" -#. module: intrastat_base -#: view:res.company:0 -msgid "Intrastat Settings" -msgstr "" - #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root msgid "Intrastat Reporting" msgstr "" +#. module: intrastat_base +#: view:res.company:intrastat_base.view_company_form +msgid "Intrastat Settings" +msgstr "" + #. module: intrastat_base #: field:product.template,is_accessory_cost:0 msgid "Is accessory cost" @@ -109,28 +109,18 @@ msgid "List of OpenERP users who will receive a notification to remind them abou msgstr "" #. module: intrastat_base -#: field:res.company,intrastat_email_list:0 -msgid "List of emails of Users Receiving the Intrastat Reminder" -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/company.py:59 +#: code:addons/intrastat_base/company.py:55 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner -msgid "Partner" -msgstr "" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "" #. module: intrastat_base -#: view:res.country:0 +#: view:res.country:intrastat_base.view_country_search msgid "Search Countries" msgstr "" @@ -150,42 +140,43 @@ msgid "Tax" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:91 +#: code:addons/intrastat_base/intrastat_common.py:84 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:83 +#: code:addons/intrastat_base/intrastat_common.py:76 #, python-format msgid "The company currency must be 'EUR', but is currently '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:78 +#: code:addons/intrastat_base/intrastat_common.py:72 #, python-format msgid "The country is not set on the company '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:111 +#: code:addons/intrastat_base/intrastat_common.py:105 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/product.py:56 +#: code:addons/intrastat_base/product.py:51 #, python-format msgid "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'" msgstr "" +#. module: intrastat_base +#: code:addons/intrastat_base/intrastat_common.py:62 +#, python-format +msgid "The start date must be the first day of the month" +msgstr "" + #. module: intrastat_base #: field:res.company,intrastat_remind_user_ids:0 msgid "Users Receiving the Intrastat Reminder" msgstr "" -#. module: intrastat_base -#: constraint:res.company:0 -msgid "error msg in raise" -msgstr "" - diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/intrastat_common.py index 3db1764..a18ea07 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/intrastat_common.py @@ -1,8 +1,8 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP -# Copyright (C) 2010-2013 Akretion (http://www.akretion.com/). +# Intrastat base module for Odoo +# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). # @author Alexis de Lattre # # This program is free software: you can redistribute it and/or modify @@ -20,91 +20,72 @@ # ############################################################################## -from openerp.osv import orm -from openerp.tools.translate import _ -from openerp import tools -from datetime import datetime +from openerp import models, fields, api, tools, _ +from openerp.exceptions import Warning, ValidationError from dateutil.relativedelta import relativedelta import logging logger = logging.getLogger(__name__) -class report_intrastat_common(orm.TransientModel): - _name = "report.intrastat.common" +class IntrastatCommon(models.AbstractModel): + _name = "intrastat.common" _description = "Common functions for intrastat reports for products " "and services" - def _compute_numbers(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - total_amount = 0.0 - num_lines = 0 - for line in intrastat.intrastat_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - result[intrastat.id] = { - 'num_lines': num_lines, - 'total_amount': total_amount, - } - return result + @api.one + @api.depends('declaration_line_ids.amount_company_currency') + def _compute_numbers(self): + total_amount = 0.0 + num_lines = 0 + for line in self.declaration_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + self.num_decl_lines = num_lines + self.total_amount = total_amount - def _compute_dates(self, cr, uid, ids, object, context=None): - result = {} - for intrastat in object.browse(cr, uid, ids, context=context): - start_date_datetime = datetime.strptime( - intrastat.start_date, '%Y-%m-%d') - end_date_str = datetime.strftime( - start_date_datetime + relativedelta(day=31), '%Y-%m-%d') - result[intrastat.id] = { - 'end_date': end_date_str, - 'year_month': start_date_datetime.strftime('%Y-%m'), - } - return result + @api.one + @api.depends('start_date') + def _compute_dates(self): + start_date_dt = fields.Date.from_string(self.start_date) + self.end_date = fields.Date.to_string( + start_date_dt + relativedelta(day=31)) + self.year_month = start_date_dt.strftime('%Y-%m') - def _check_start_date(self, cr, uid, ids, object, context=None): + @api.one + def _check_start_date(self): '''Check that the start date is the first day of the month''' - for date_to_check in object.read( - cr, uid, ids, ['start_date'], context=context): - datetime_to_check = datetime.strptime( - date_to_check['start_date'], '%Y-%m-%d') - if datetime_to_check.day != 1: - return False - return True + datetime_to_check = fields.Date.from_string(self.start_date) + if datetime_to_check.day != 1: + raise ValidationError( + _('The start date must be the first day of the month')) - def _check_generate_lines(self, cr, uid, intrastat, context=None): + @api.one + def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" - if not intrastat.company_id: - # Should not be possible, but just in case: - raise orm.except_orm( - _('Error :'), - _("Company not yet set on intrastat report.") - ) - company_obj = intrastat.company_id # Simplify references + if not self.company_id: + raise Warning(_("Company not yet set on intrastat report.")) + company_obj = self.company_id if not company_obj.country_id: - raise orm.except_orm( - _('Error :'), + raise Warning( _("The country is not set on the company '%s'.") - % company_obj.name - ) - if not company_obj.currency_id.name == 'EUR': - raise orm.except_orm( - _('Error :'), + % company_obj.name) + if company_obj.currency_id.name != 'EUR': + raise Warning( _("The company currency must be 'EUR', but is currently '%s'.") - % company_obj.currency_id.name - ) + % company_obj.currency_id.name) return True - def _check_generate_xml(self, cr, uid, intrastat, context=None): - if not intrastat.company_id.partner_id.vat: - raise orm.except_orm( - _('Error :'), + @api.one + def _check_generate_xml(self): + if not self.company_id.partner_id.vat: + raise Warning( _("The VAT number is not set for the partner '%s'.") - % intrastat.company_id.partner_id.name) + % self.company_id.partner_id.name) return True - def _check_xml_schema( - self, cr, uid, xml_root, xml_string, xsd_file, context=None): + @api.model + def _check_xml_schema(self, xml_root, xml_string, xsd_file): '''Validate the XML file against the XSD''' from lxml import etree xsd_etree_obj = etree.parse( @@ -114,13 +95,12 @@ class report_intrastat_common(orm.TransientModel): official_schema.assertValid(xml_root) except Exception, e: # if the validation of the XSD fails, we arrive here - _logger = logging.getLogger(__name__) - _logger.warning( + logger = logging.getLogger(__name__) + logger.warning( "The XML file is invalid against the XML Schema Definition") - _logger.warning(xml_string) - _logger.warning(e) - raise orm.except_orm( - _('Error :'), + logger.warning(xml_string) + logger.warning(e) + raise Warning( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -129,39 +109,29 @@ class report_intrastat_common(orm.TransientModel): % str(e)) return True - def _attach_xml_file( - self, cr, uid, ids, object, xml_string, start_date_datetime, - declaration_name, context=None): - '''Attach the XML file to the report_intrastat_product/service ''' - '''object''' + @api.multi + def _attach_xml_file(self, xml_string, declaration_name): + '''Attach the XML file to the report_intrastat_product/service + object''' + self.ensure_one() import base64 - assert len(ids) == 1, "Only one ID accepted" - filename = '%s_%s.xml' % ( - datetime.strftime(start_date_datetime, '%Y-%m'), - declaration_name) - if not context: - context = {} - context.update({ - 'default_res_id': ids[0], - 'default_res_model': object._name - }) - attach_id = self.pool['ir.attachment'].create( - cr, uid, { - 'name': filename, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}, - context=context) - return attach_id + filename = '%s_%s.xml' % (self.year_month, declaration_name) + attach = self.env['ir.attachment'].create({ + 'name': filename, + 'res_id': self.id, + 'res_model': self._name, + 'datas': base64.encodestring(xml_string), + 'datas_fname': filename}) + return attach.id - def _open_attach_view( - self, cr, uid, attach_id, title='XML file', context=None): - '''Returns an action which opens the form view of the ''' - '''corresponding attachement''' + @api.model + def _open_attach_view(self, attach_id, title='XML file'): + '''Returns an action which opens the form view of the + corresponding attachement''' action = { 'name': title, 'view_type': 'form', - 'view_mode': 'form,tree', - 'view_id': False, + 'view_mode': 'form', 'res_model': 'ir.attachment', 'type': 'ir.actions.act_window', 'nodestroy': True, @@ -170,30 +140,36 @@ class report_intrastat_common(orm.TransientModel): } return action - def partner_on_change(self, cr, uid, ids, partner_id=False, context=None): - result = {} - result['value'] = {} - if partner_id: - company = self.pool['res.partner'].read( - cr, uid, partner_id, ['vat'], context=context) - result['value']['partner_vat'] = company['vat'] - return result - - def send_reminder_email( - self, cr, uid, company, module_name, template_xmlid, - intrastat_id, context=None): - template_model, template_id =\ - self.pool['ir.model.data'].get_object_reference( - cr, uid, module_name, template_xmlid) - assert template_model == 'email.template', 'Wrong model' - if company.intrastat_remind_user_ids: - self.pool['email.template'].send_mail( - cr, uid, template_id, intrastat_id, context=context) + @api.one + def send_reminder_email(self, mail_template_xmlid): + mail_template = self.env.ref(mail_template_xmlid) + if self.company_id.intrastat_remind_user_ids: + mail_template.send_mail(self.id) logger.info( 'Intrastat Reminder email has been sent (XMLID: %s).' - % template_xmlid) + % mail_template_xmlid) else: logger.warning( 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % company.name) + 'on company %s' % self.company_id.name) return True + + @api.multi + def unlink(self): + for intrastat in self: + if intrastat.state == 'done': + raise Warning( + _('Cannot delete the declaration %s ' + 'because it is in Done state') % self.year_month) + return super(IntrastatCommon, self).unlink() + + +class IntrastatResultView(models.TransientModel): + """ + Transient Model to display Intrastat Report results + """ + _name = 'intrastat.result.view' + + note = fields.Text( + string='Notes', readonly=True, + default=lambda self: self._context.get('note')) diff --git a/intrastat_base/intrastat_menu.xml b/intrastat_base/intrastat_menu.xml deleted file mode 100644 index 85303c1..0000000 --- a/intrastat_base/intrastat_menu.xml +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - diff --git a/intrastat_base/intrastat_view.xml b/intrastat_base/intrastat_view.xml new file mode 100644 index 0000000..4d9c22a --- /dev/null +++ b/intrastat_base/intrastat_view.xml @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + intrastat.result_view_form + intrastat.result.view + +
+ + + +
+
+
+
+
+ +
+
diff --git a/intrastat_base/product.py b/intrastat_base/product.py index ca1652e..5373cb3 100644 --- a/intrastat_base/product.py +++ b/intrastat_base/product.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for OpenERP +# Intrastat base module for Odoo # Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) # @author Alexis de Lattre # diff --git a/intrastat_base/tax.py b/intrastat_base/tax.py index 2b98678..197e51d 100644 --- a/intrastat_base/tax.py +++ b/intrastat_base/tax.py @@ -1,7 +1,7 @@ # -*- encoding: utf-8 -*- ############################################################################## # -# Report intrastat base module for Odoo +# Intrastat base module for Odoo # Copyright (C) 2011-2014 Akretion (http://www.akretion.com). # @author Alexis de Lattre # From bf2f91eba1955a9e3534ac61806288941de19681 Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Tue, 20 Oct 2015 20:26:19 +0200 Subject: [PATCH 10/90] [REF] intrastat_base: major update intrastat V3 --- intrastat_base/README.rst | 37 +++++++++++++++++-- intrastat_base/__init__.py | 6 +-- intrastat_base/__openerp__.py | 20 +++++----- intrastat_base/{ => data}/country_data.xml | 0 intrastat_base/{ => demo}/intrastat_demo.xml | 0 intrastat_base/models/__init__.py | 27 ++++++++++++++ .../{tax.py => models/account_tax.py} | 0 .../{ => models}/intrastat_common.py | 27 +++++++++++++- .../product_template.py} | 0 .../{company.py => models/res_company.py} | 20 +++++----- .../{country.py => models/res_country.py} | 0 .../{tax_view.xml => views/account_tax.xml} | 0 .../intrastat.xml} | 2 +- .../product_template.xml} | 0 .../res_company.xml} | 0 .../res_country.xml} | 2 +- .../res_partner.xml} | 0 17 files changed, 110 insertions(+), 31 deletions(-) rename intrastat_base/{ => data}/country_data.xml (100%) rename intrastat_base/{ => demo}/intrastat_demo.xml (100%) create mode 100644 intrastat_base/models/__init__.py rename intrastat_base/{tax.py => models/account_tax.py} (100%) rename intrastat_base/{ => models}/intrastat_common.py (90%) rename intrastat_base/{product.py => models/product_template.py} (100%) rename intrastat_base/{company.py => models/res_company.py} (100%) rename intrastat_base/{country.py => models/res_country.py} (100%) rename intrastat_base/{tax_view.xml => views/account_tax.xml} (100%) rename intrastat_base/{intrastat_view.xml => views/intrastat.xml} (94%) rename intrastat_base/{product_view.xml => views/product_template.xml} (100%) rename intrastat_base/{company_view.xml => views/res_company.xml} (100%) rename intrastat_base/{country_view.xml => views/res_country.xml} (96%) rename intrastat_base/{partner_view.xml => views/res_partner.xml} (100%) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index a941d1d..1a5cc85 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -1,3 +1,9 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + + +===================== Intrastat Base Module ===================== @@ -12,16 +18,39 @@ such as: - *l10n_be_intrastat_product*: the module for the Intrastat Declaration for Belgium. -These country-specific modules can be found in the OCA localization for those countries. Installation ============ WARNING: + This module conflicts with the module *report_intrastat* from the official addons. If you have already installed the module *report_intrastat*, you should uninstall it first before installing this module. +Usage +===== + +To create H.S. codes, go to the menu *Sales > Configuration > Product Categories and Attributes > H.S. Codes*. + +Then you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). + +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/91/8.0 + + +Bug Tracker +=========== + +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here `_. + + Credits ======= @@ -29,16 +58,18 @@ Contributors ------------ * Alexis de Lattre, Akretion +* Luc De Meyer, Noviat Maintainer ---------- - .. image:: http://odoo-community.org/logo.png :alt: Odoo Community Association :target: http://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. To contribute to this module, please visit http://odoo-community.org. diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 21b2067..cd5b2df 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -20,8 +20,4 @@ # ############################################################################## -from . import country -from . import product -from . import tax -from . import company -from . import intrastat_common +from . import models diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index ea5483f..f50f146 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Intrastat Reporting Base', - 'version': '1.1', + 'version': '1.2', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', @@ -31,14 +31,16 @@ 'depends': ['base_vat'], 'conflicts': ['report_intrastat'], 'data': [ - 'country_data.xml', - 'product_view.xml', - 'partner_view.xml', - 'country_view.xml', - 'tax_view.xml', - 'company_view.xml', - 'intrastat_view.xml', + 'data/country_data.xml', + 'views/product_template.xml', + 'views/res_partner.xml', + 'views/res_country.xml', + 'views/account_tax.xml', + 'views/res_company.xml', + 'views/intrastat.xml', + ], + 'demo': [ + 'demo/intrastat_demo.xml', ], - 'demo': ['intrastat_demo.xml'], 'installable': True, } diff --git a/intrastat_base/country_data.xml b/intrastat_base/data/country_data.xml similarity index 100% rename from intrastat_base/country_data.xml rename to intrastat_base/data/country_data.xml diff --git a/intrastat_base/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml similarity index 100% rename from intrastat_base/intrastat_demo.xml rename to intrastat_base/demo/intrastat_demo.xml diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py new file mode 100644 index 0000000..18530f9 --- /dev/null +++ b/intrastat_base/models/__init__.py @@ -0,0 +1,27 @@ +# -*- encoding: utf-8 -*- +############################################################################## +# +# Report intrastat base module for Odoo +# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) +# @author Alexis de Lattre +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +from . import res_country +from . import product_template +from . import account_tax +from . import res_company +from . import intrastat_common diff --git a/intrastat_base/tax.py b/intrastat_base/models/account_tax.py similarity index 100% rename from intrastat_base/tax.py rename to intrastat_base/models/account_tax.py diff --git a/intrastat_base/intrastat_common.py b/intrastat_base/models/intrastat_common.py similarity index 90% rename from intrastat_base/intrastat_common.py rename to intrastat_base/models/intrastat_common.py index a18ea07..ae892c0 100644 --- a/intrastat_base/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -85,14 +85,16 @@ class IntrastatCommon(models.AbstractModel): return True @api.model - def _check_xml_schema(self, xml_root, xml_string, xsd_file): + def _check_xml_schema(self, xml_string, xsd_file): '''Validate the XML file against the XSD''' from lxml import etree + from StringIO import StringIO xsd_etree_obj = etree.parse( tools.file_open(xsd_file)) official_schema = etree.XMLSchema(xsd_etree_obj) try: - official_schema.assertValid(xml_root) + t = etree.parse(StringIO(xml_string)) + official_schema.assertValid(t) except Exception, e: # if the validation of the XSD fails, we arrive here logger = logging.getLogger(__name__) @@ -124,6 +126,13 @@ class IntrastatCommon(models.AbstractModel): 'datas_fname': filename}) return attach.id + @api.multi + def _unlink_attachments(self): + atts = self.env['ir.attachment'].search( + [('res_model', '=', self._name), + ('res_id', '=', self.id)]) + atts.unlink() + @api.model def _open_attach_view(self, attach_id, title='XML file'): '''Returns an action which opens the form view of the @@ -140,6 +149,20 @@ class IntrastatCommon(models.AbstractModel): } return action + @api.multi + def _generate_xml(self): + """ + Inherit this method in the localization module + to generate the INTRASTAT Declaration XML file + + Returns: + string with XML data + + Call the _check_xml_schema() method + before returning the XML string. + """ + return False + @api.one def send_reminder_email(self, mail_template_xmlid): mail_template = self.env.ref(mail_template_xmlid) diff --git a/intrastat_base/product.py b/intrastat_base/models/product_template.py similarity index 100% rename from intrastat_base/product.py rename to intrastat_base/models/product_template.py diff --git a/intrastat_base/company.py b/intrastat_base/models/res_company.py similarity index 100% rename from intrastat_base/company.py rename to intrastat_base/models/res_company.py index 9fea8e4..2206c76 100644 --- a/intrastat_base/company.py +++ b/intrastat_base/models/res_company.py @@ -27,16 +27,6 @@ from openerp.exceptions import ValidationError class ResCompany(models.Model): _inherit = "res.company" - @api.one - @api.depends( - 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') - def _compute_intrastat_email_list(self): - emails = [] - for user in self.intrastat_remind_user_ids: - if user.email: - emails.append(user.email) - self.intrastat_email_list = ','.join(emails) - intrastat_remind_user_ids = fields.Many2many( 'res.users', column1='company_id', column2='user_id', string="Users Receiving the Intrastat Reminder", @@ -46,6 +36,16 @@ class ResCompany(models.Model): compute='_compute_intrastat_email_list', string='List of emails of Users Receiving the Intrastat Reminder') + @api.one + @api.depends( + 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') + def _compute_intrastat_email_list(self): + emails = [] + for user in self.intrastat_remind_user_ids: + if user.email: + emails.append(user.email) + self.intrastat_email_list = ','.join(emails) + @api.one @api.constrains('intrastat_remind_user_ids') def _check_intrastat_remind_users(self): diff --git a/intrastat_base/country.py b/intrastat_base/models/res_country.py similarity index 100% rename from intrastat_base/country.py rename to intrastat_base/models/res_country.py diff --git a/intrastat_base/tax_view.xml b/intrastat_base/views/account_tax.xml similarity index 100% rename from intrastat_base/tax_view.xml rename to intrastat_base/views/account_tax.xml diff --git a/intrastat_base/intrastat_view.xml b/intrastat_base/views/intrastat.xml similarity index 94% rename from intrastat_base/intrastat_view.xml rename to intrastat_base/views/intrastat.xml index 4d9c22a..7b4cdf7 100644 --- a/intrastat_base/intrastat_view.xml +++ b/intrastat_base/views/intrastat.xml @@ -17,7 +17,7 @@ parent="account.menu_finance_configuration" sequence="50"/> - + intrastat.result_view_form intrastat.result.view diff --git a/intrastat_base/product_view.xml b/intrastat_base/views/product_template.xml similarity index 100% rename from intrastat_base/product_view.xml rename to intrastat_base/views/product_template.xml diff --git a/intrastat_base/company_view.xml b/intrastat_base/views/res_company.xml similarity index 100% rename from intrastat_base/company_view.xml rename to intrastat_base/views/res_company.xml diff --git a/intrastat_base/country_view.xml b/intrastat_base/views/res_country.xml similarity index 96% rename from intrastat_base/country_view.xml rename to intrastat_base/views/res_country.xml index d887a22..ac0f6f6 100644 --- a/intrastat_base/country_view.xml +++ b/intrastat_base/views/res_country.xml @@ -32,7 +32,7 @@ - + intrastat.base.country.search res.country diff --git a/intrastat_base/partner_view.xml b/intrastat_base/views/res_partner.xml similarity index 100% rename from intrastat_base/partner_view.xml rename to intrastat_base/views/res_partner.xml From 888ae33027cf2378ecb2704ac9e88c731e96098f Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 10 Nov 2015 21:36:50 +0100 Subject: [PATCH 11/90] [IMP] intrastat_base: A lot of imps: * Add product_origin_country_id on declaration/computation lines Copy incoterms and destination country from SO to invoice when invoicing from SO We need weight even when supplementary units is used Small cleanups and enhancements * Add support for accessory costs Add default values for intrastat transaction on company Code cleanup * If rounded weight is 0, put 1 Take into account the taxes for B2C Small code cleanup * Remove field exclude_from_intrastat Re-organise view of intrastat.product.declaration * Add option intrastat_accessory_costs on company Set more fields as invisible (localisation should put them visible if they need it) Fix handling of suppl. units when hs_code is empty on invoice line (but set on product) Small usability enhancements * Warning -> UserError * Inspired by the PR https://github.com/akretion/account-financial-reporting/pull/8 of Luc de Meyer * total_amount is a sum of integers, so it should be an integer Add transport mode in computation tree view * Demo VAT number should be on EU customers --- intrastat_base/__openerp__.py | 2 +- intrastat_base/demo/intrastat_demo.xml | 2 +- intrastat_base/models/__init__.py | 22 +------------- intrastat_base/models/account_tax.py | 2 +- intrastat_base/models/intrastat_common.py | 35 ++++++----------------- intrastat_base/models/product_template.py | 8 +----- intrastat_base/models/res_company.py | 2 +- intrastat_base/models/res_country.py | 2 +- intrastat_base/views/account_tax.xml | 5 ++-- intrastat_base/views/intrastat.xml | 2 +- intrastat_base/views/product_template.xml | 4 +-- 11 files changed, 22 insertions(+), 64 deletions(-) diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index f50f146..a9e92b0 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index 953d92b..422afa8 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -18,7 +18,7 @@ True - + BE0443167858 True diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index 18530f9..a571f6a 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -1,24 +1,4 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Report intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# -*- coding: utf-8 -*- from . import res_country from . import product_template diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index 197e51d..e11db59 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index ae892c0..3d44b7c 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo @@ -21,8 +21,7 @@ ############################################################################## from openerp import models, fields, api, tools, _ -from openerp.exceptions import Warning, ValidationError -from dateutil.relativedelta import relativedelta +from openerp.exceptions import Warning as UserError import logging logger = logging.getLogger(__name__) @@ -36,7 +35,7 @@ class IntrastatCommon(models.AbstractModel): @api.one @api.depends('declaration_line_ids.amount_company_currency') def _compute_numbers(self): - total_amount = 0.0 + total_amount = 0 # it is an integer num_lines = 0 for line in self.declaration_line_ids: total_amount += line.amount_company_currency @@ -44,34 +43,18 @@ class IntrastatCommon(models.AbstractModel): self.num_decl_lines = num_lines self.total_amount = total_amount - @api.one - @api.depends('start_date') - def _compute_dates(self): - start_date_dt = fields.Date.from_string(self.start_date) - self.end_date = fields.Date.to_string( - start_date_dt + relativedelta(day=31)) - self.year_month = start_date_dt.strftime('%Y-%m') - - @api.one - def _check_start_date(self): - '''Check that the start date is the first day of the month''' - datetime_to_check = fields.Date.from_string(self.start_date) - if datetime_to_check.day != 1: - raise ValidationError( - _('The start date must be the first day of the month')) - @api.one def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" if not self.company_id: - raise Warning(_("Company not yet set on intrastat report.")) + raise UserError(_("Company not yet set on intrastat report.")) company_obj = self.company_id if not company_obj.country_id: - raise Warning( + raise UserError( _("The country is not set on the company '%s'.") % company_obj.name) if company_obj.currency_id.name != 'EUR': - raise Warning( + raise UserError( _("The company currency must be 'EUR', but is currently '%s'.") % company_obj.currency_id.name) return True @@ -79,7 +62,7 @@ class IntrastatCommon(models.AbstractModel): @api.one def _check_generate_xml(self): if not self.company_id.partner_id.vat: - raise Warning( + raise UserError( _("The VAT number is not set for the partner '%s'.") % self.company_id.partner_id.name) return True @@ -102,7 +85,7 @@ class IntrastatCommon(models.AbstractModel): "The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) logger.warning(e) - raise Warning( + raise UserError( _("The generated XML file is not valid against the official " "XML Schema Definition. The generated XML file and the " "full error have been written in the server logs. " @@ -181,7 +164,7 @@ class IntrastatCommon(models.AbstractModel): def unlink(self): for intrastat in self: if intrastat.state == 'done': - raise Warning( + raise UserError( _('Cannot delete the declaration %s ' 'because it is in Done state') % self.year_month) return super(IntrastatCommon, self).unlink() diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 5373cb3..30132bc 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo @@ -27,12 +27,6 @@ from openerp.exceptions import ValidationError class ProductTemplate(models.Model): _inherit = "product.template" - exclude_from_intrastat = fields.Boolean( - string='Exclude from Intrastat reports', - help="If set to True, the product or service will not be " - "taken into account for Intrastat Product or Service reports. " - "So you should leave this field to False unless you have a " - "very good reason.") is_accessory_cost = fields.Boolean( string='Is accessory cost', help="Activate this option for shipping costs, packaging " diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 2206c76..1175d76 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 7a34e77..8703f10 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,4 +1,4 @@ -# -*- encoding: utf-8 -*- +# -*- coding: utf-8 -*- ############################################################################## # # Intrastat base module for Odoo diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index 5defe29..1e91bb5 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,7 +1,7 @@ @@ -16,7 +16,8 @@ - + + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 7b4cdf7..73762d0 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -11,7 +11,7 @@ diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index dc61ca5..1f4f73f 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -16,9 +16,9 @@ - + attrs="{'invisible': [('type', '!=', 'service')]}" + invisible="1"/> From 9adefd0b8da167d454939cc60766f907b434e327 Mon Sep 17 00:00:00 2001 From: Holger Brunn Date: Mon, 30 May 2016 13:02:55 +0200 Subject: [PATCH 12/90] [FIX] intrastat_base: this week's ci errors + wrong variable name --- intrastat_base/__openerp__.py | 2 +- intrastat_base/models/intrastat_common.py | 75 ++++++++++++----------- intrastat_base/models/product_template.py | 17 ++--- intrastat_base/models/res_company.py | 26 ++++---- 4 files changed, 64 insertions(+), 56 deletions(-) diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index a9e92b0..594ff8a 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Intrastat Reporting Base', - 'version': '1.2', + 'version': '8.0.1.2.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 3d44b7c..ff49c96 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -32,39 +32,43 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" - @api.one + @api.multi @api.depends('declaration_line_ids.amount_company_currency') def _compute_numbers(self): - total_amount = 0 # it is an integer - num_lines = 0 - for line in self.declaration_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - self.num_decl_lines = num_lines - self.total_amount = total_amount + for this in self: + total_amount = 0 # it is an integer + num_lines = 0 + for line in this.declaration_line_ids: + total_amount += line.amount_company_currency + num_lines += 1 + this.num_decl_lines = num_lines + this.total_amount = total_amount - @api.one + @api.multi def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" - if not self.company_id: - raise UserError(_("Company not yet set on intrastat report.")) - company_obj = self.company_id - if not company_obj.country_id: - raise UserError( - _("The country is not set on the company '%s'.") - % company_obj.name) - if company_obj.currency_id.name != 'EUR': - raise UserError( - _("The company currency must be 'EUR', but is currently '%s'.") - % company_obj.currency_id.name) + for this in self: + if not this.company_id: + raise UserError(_("Company not yet set on intrastat report.")) + company = this.company_id + if not company.country_id: + raise UserError( + _("The country is not set on the company '%s'.") + % company.name) + if company.currency_id.name != 'EUR': + raise UserError( + _("The company currency must be 'EUR', but is currently " + "'%s'.") + % company.currency_id.name) return True - @api.one + @api.multi def _check_generate_xml(self): - if not self.company_id.partner_id.vat: - raise UserError( - _("The VAT number is not set for the partner '%s'.") - % self.company_id.partner_id.name) + for this in self: + if not this.company_id.partner_id.vat: + raise UserError( + _("The VAT number is not set for the partner '%s'.") + % this.company_id.partner_id.name) return True @api.model @@ -146,18 +150,19 @@ class IntrastatCommon(models.AbstractModel): """ return False - @api.one + @api.multi def send_reminder_email(self, mail_template_xmlid): mail_template = self.env.ref(mail_template_xmlid) - if self.company_id.intrastat_remind_user_ids: - mail_template.send_mail(self.id) - logger.info( - 'Intrastat Reminder email has been sent (XMLID: %s).' - % mail_template_xmlid) - else: - logger.warning( - 'The list of users receiving the Intrastat Reminder is empty ' - 'on company %s' % self.company_id.name) + for this in self: + if this.company_id.intrastat_remind_user_ids: + mail_template.send_mail(this.id) + logger.info( + 'Intrastat Reminder email has been sent (XMLID: %s).' + % mail_template_xmlid) + else: + logger.warning( + 'The list of users receiving the Intrastat Reminder is ' + 'empty on company %s' % this.company_id.name) return True @api.multi diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 30132bc..07e0b2b 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -33,13 +33,14 @@ class ProductTemplate(models.Model): "costs and all services related to the sale of products. " "This option is used for Intrastat reports.") - @api.one + @api.multi @api.constrains('type', 'is_accessory_cost') def _check_accessory_cost(self): - if self.is_accessory_cost and self.type != 'service': - raise ValidationError( - _("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'" - % (self.name, self.type))) + for this in self: + if this.is_accessory_cost and this.type != 'service': + raise ValidationError( + _("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.name, this.type)) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 1175d76..291d846 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -36,21 +36,23 @@ class ResCompany(models.Model): compute='_compute_intrastat_email_list', string='List of emails of Users Receiving the Intrastat Reminder') - @api.one + @api.multi @api.depends( 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') def _compute_intrastat_email_list(self): - emails = [] - for user in self.intrastat_remind_user_ids: - if user.email: - emails.append(user.email) - self.intrastat_email_list = ','.join(emails) + for this in self: + emails = [] + for user in this.intrastat_remind_user_ids: + if user.email: + emails.append(user.email) + this.intrastat_email_list = ','.join(emails) - @api.one + @api.multi @api.constrains('intrastat_remind_user_ids') def _check_intrastat_remind_users(self): - for user in self.intrastat_remind_user_ids: - if not user.email: - raise ValidationError( - _("Missing e-mail address on user '%s'.") - % (user.name)) + for this in self: + for user in this.intrastat_remind_user_ids: + if not user.email: + raise ValidationError( + _("Missing e-mail address on user '%s'.") % + (user.name)) From bcc9cbd18f35fd683a1a7025f519f17d376cf2bf Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 21 Jun 2016 10:41:52 +0200 Subject: [PATCH 13/90] Cleaner view inheritance (works both in v8 and v9) --- intrastat_base/views/res_company.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intrastat_base/views/res_company.xml b/intrastat_base/views/res_company.xml index 1df7aed..0565f00 100644 --- a/intrastat_base/views/res_company.xml +++ b/intrastat_base/views/res_company.xml @@ -14,8 +14,8 @@ res.company - - + + From 89d1372475be8efa5b81663895e5b8964f04b3ef Mon Sep 17 00:00:00 2001 From: luc-demeyer Date: Mon, 3 Oct 2016 15:25:23 +0200 Subject: [PATCH 14/90] update intrastat_base --- intrastat_base/__init__.py | 23 +---------------------- intrastat_base/__openerp__.py | 2 +- intrastat_base/views/account_tax.xml | 3 +-- 3 files changed, 3 insertions(+), 25 deletions(-) diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index cd5b2df..a0fdc10 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -1,23 +1,2 @@ -# -*- encoding: utf-8 -*- -############################################################################## -# -# Report intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - +# -*- coding: utf-8 -*- from . import models diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py index 594ff8a..12a810b 100644 --- a/intrastat_base/__openerp__.py +++ b/intrastat_base/__openerp__.py @@ -22,7 +22,7 @@ { 'name': 'Intrastat Reporting Base', - 'version': '8.0.1.2.0', + 'version': '8.0.1.3.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index 1e91bb5..d38cee6 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -16,8 +16,7 @@ - - + From 1c4f2ade3d541b5741a93b83113da0db95282b95 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 4 Oct 2016 00:41:33 +0200 Subject: [PATCH 15/90] [IMP] intrastat_base: Update README.rst + rename variables + restore code lost in transition to github/OCA/intrastat --- intrastat_base/README.rst | 44 ++--- intrastat_base/i18n/fr_FR.po | 182 -------------------- intrastat_base/security/ir.model.access.csv | 2 - intrastat_base/views/res_partner.xml | 11 +- 4 files changed, 28 insertions(+), 211 deletions(-) delete mode 100644 intrastat_base/i18n/fr_FR.po delete mode 100644 intrastat_base/security/ir.model.access.csv diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 1a5cc85..284f240 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -2,14 +2,14 @@ :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 +============== +Intrastat Base +============== -===================== -Intrastat Base Module -===================== - -This module contains common functions for the Intrastat reporting and -should be used in combination with country-specific reporting modules -such as: +This module contains common functions for the intrastat reporting and +should be used in combination with the generic reporting module +*intrastat_product* and with the country-specific reporting modules such +as: - *l10n_fr_intrastat_service*: the module for the *Déclaration Européenne des Services* (DES) for France @@ -31,25 +31,28 @@ you should uninstall it first before installing this module. Usage ===== -To create H.S. codes, go to the menu *Sales > Configuration > Product Categories and Attributes > H.S. Codes*. +This module adds an intrastat property on countries and activates this property +on the 28 countries of the European Union. -Then you will be able to set the H.S. code on an product (under the *Information* tab) or on a product category. On the product form, you will also be able to set the *Country of Origin* of a product (for example, if the product is *made in China*, select *China* as *Country of Origin*). +With this module, the country field on partners becomes a required field. + +It adds an option *Exclude invoice line from intrastat if this tax is present* +on taxes. + +It adds a tab *Intrastat* on the company form view. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot :target: https://runbot.odoo-community.org/runbot/91/8.0 - Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback `here `_. - +Bugs are tracked on `GitHub Issues +`_. In case +of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and +welcomed feedback. Credits ======= @@ -62,9 +65,10 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png + +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. @@ -72,4 +76,4 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/intrastat_base/i18n/fr_FR.po b/intrastat_base/i18n/fr_FR.po deleted file mode 100644 index 1b3d759..0000000 --- a/intrastat_base/i18n/fr_FR.po +++ /dev/null @@ -1,182 +0,0 @@ -# Translation of Odoo Server. -# This file contains the translation of the following modules: -# * intrastat_base -# -msgid "" -msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" -"Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-27 18:43+0000\n" -"PO-Revision-Date: 2015-05-27 18:43+0000\n" -"Last-Translator: <>\n" -"Language-Team: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: \n" -"Plural-Forms: \n" - -#. module: intrastat_base -#: help:product.template,is_accessory_cost:0 -msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." -msgstr "Activez cette option pour les frais de port, les frais d'emballage et tous les services liés à la vente de produits physiques. Cette option est utilisée pour la DEB et la DES." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:165 -#, python-format -msgid "Cannot delete the declaration %s because it is in Done state" -msgstr "Impossible de supprimer la déclaration %s car elle est à l'état déclaré" - -#. module: intrastat_base -#: view:res.company:intrastat_base.view_company_form -msgid "Common Intrastat Settings" -msgstr "Paramètres communs DEB et DES" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_report_intrastat_common -msgid "Common functions for intrastat reports for products " -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_company -msgid "Companies" -msgstr "Sociétés" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:68 -#, python-format -msgid "Company not yet set on intrastat report." -msgstr "Société non configurée sur le rapport intrastat." - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_country -msgid "Country" -msgstr "Pays" - -#. module: intrastat_base -#: view:res.country:intrastat_base.view_country_search -#: field:res.country,intrastat:0 -msgid "EU Country" -msgstr "Pays UE" - -#. module: intrastat_base -#: field:product.template,exclude_from_intrastat:0 -msgid "Exclude from Intrastat reports" -msgstr "Exclure de la DEB et de la DES" - -#. module: intrastat_base -#: field:account.tax,exclude_from_intrastat_if_present:0 -msgid "Exclude invoice line from intrastat if this tax is present" -msgstr "Exclue la ligne de facture de la DEB/DES si cette taxe est présente" - -#. module: intrastat_base -#: field:report.intrastat.common,id:0 -msgid "ID" -msgstr "ID" - -#. module: intrastat_base -#: help:product.template,exclude_from_intrastat:0 -msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." -msgstr "Si l'option est activée, le produit ou service ne sera pris en compte ni pour la DEB ni pour la DES. Cette option doit donc rester désactivée sauf si vous avez une très bonne raison." - -#. module: intrastat_base -#: help:account.tax,exclude_from_intrastat_if_present:0 -msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." -msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture ne sera pas prise en compte lors de la génération de la DEB et de la DES depuis les factures." - -#. module: intrastat_base -#: view:product.template:intrastat_base.product_template_form_view -msgid "Intrastat Properties" -msgstr "Propriétés DEB/DES" - -#. module: intrastat_base -#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat Reporting" -msgstr "DEB et DES" - -#. module: intrastat_base -#: view:res.company:intrastat_base.view_company_form -msgid "Intrastat Settings" -msgstr "Configuration DEB/DES" - -#. module: intrastat_base -#: field:product.template,is_accessory_cost:0 -msgid "Is accessory cost" -msgstr "Frais accessoires" - -#. module: intrastat_base -#: help:res.company,intrastat_remind_user_ids:0 -msgid "List of OpenERP users who will receive a notification to remind them about the Intrastat declaration." -msgstr "Liste d'utilisateurs OpenERP qui recevront le rappel pour la DEB et/ou la DES." - -#. module: intrastat_base -#: code:addons/intrastat_base/company.py:55 -#, python-format -msgid "Missing e-mail address on user '%s'." -msgstr "Adresse e-mail manquante sur l'utilisateur '%s'." - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_product_template -msgid "Product Template" -msgstr "Modèle d'article" - -#. module: intrastat_base -#: view:res.country:intrastat_base.view_country_search -msgid "Search Countries" -msgstr "Recherche des pays" - -#. module: intrastat_base -#: help:res.country,intrastat:0 -msgid "Set to True for all European Union countries." -msgstr "A cocher pour tous les pays de l'Union Européenne." - -#. module: intrastat_base -#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template -msgid "Shipping costs" -msgstr "Frais de port" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_tax -msgid "Tax" -msgstr "Taxes" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:84 -#, python-format -msgid "The VAT number is not set for the partner '%s'." -msgstr "Le numéro de TVA n'est pas renseigné pour le partenaire '%s'." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:76 -#, python-format -msgid "The company currency must be 'EUR', but is currently '%s'." -msgstr "La monnaie de la société doit être 'EUR', mais est actuellement '%s'." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:72 -#, python-format -msgid "The country is not set on the company '%s'." -msgstr "Le pays n'est pas renseigné sur la société '%s'." - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:105 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." -msgstr "La validation du fichier XML avec le schéma XML officiel a échoué. Le fichier XML généré et le détail de l'erreur ont été écrits dans les logs du serveur. Voici le message d'erreur, qui peut vous donner une idée de la cause du problème : %s." - -#. module: intrastat_base -#: code:addons/intrastat_base/product.py:51 -#, python-format -msgid "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'" -msgstr "L'option 'Frais accessoires' ne doit être activée que sur les produits de type 'Service'. Vous avez activé cette option sur le produit '%s' qui est de type '%s'" - -#. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:62 -#, python-format -msgid "The start date must be the first day of the month" -msgstr "La date de début doit être le premier jour du mois" - -#. module: intrastat_base -#: field:res.company,intrastat_remind_user_ids:0 -msgid "Users Receiving the Intrastat Reminder" -msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" - diff --git a/intrastat_base/security/ir.model.access.csv b/intrastat_base/security/ir.model.access.csv deleted file mode 100644 index d7a2bf1..0000000 --- a/intrastat_base/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -"id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -"access_report_intrastat_common","Read access on report.intrastat.common","model_report_intrastat_common","base.group_user",1,0,0,0 diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 7dc9f4e..6184e8c 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -9,21 +9,18 @@ - + res.partner - - {'readonly': [('use_parent_address','=',True)], 'required': True} + + 1 - - {'required': True} + 1 - From e0ef36b54caa9ae6635605c4653dd787bbe26ffc Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 11 Oct 2016 14:59:28 +0200 Subject: [PATCH 16/90] [MIG] intrastat_base: Migration to v10 * Update README.rst: switch to new intrastat project * Move Intrastat menu entry to Accounting > Report instead of Accounting > Report > PDF Reports (because intrastat reports are not in PDF !) --- intrastat_base/README.rst | 4 +- intrastat_base/__manifest__.py | 28 +++ intrastat_base/__openerp__.py | 46 ----- intrastat_base/data/country_data.xml | 175 +++++++++--------- intrastat_base/demo/intrastat_demo.xml | 40 +--- intrastat_base/models/__init__.py | 1 + .../models/account_config_settings.py | 12 ++ intrastat_base/models/account_tax.py | 24 +-- intrastat_base/models/intrastat_common.py | 26 +-- intrastat_base/models/product_template.py | 26 +-- intrastat_base/models/res_company.py | 28 +-- intrastat_base/models/res_country.py | 24 +-- .../views/account_config_settings.xml | 23 +++ intrastat_base/views/account_tax.xml | 14 +- intrastat_base/views/intrastat.xml | 15 +- intrastat_base/views/product_template.xml | 16 +- intrastat_base/views/res_company.xml | 29 --- intrastat_base/views/res_country.xml | 12 +- intrastat_base/views/res_partner.xml | 13 +- 19 files changed, 206 insertions(+), 350 deletions(-) create mode 100644 intrastat_base/__manifest__.py delete mode 100644 intrastat_base/__openerp__.py create mode 100644 intrastat_base/models/account_config_settings.py create mode 100644 intrastat_base/views/account_config_settings.xml delete mode 100644 intrastat_base/views/res_company.xml diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 284f240..65531ec 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -43,13 +43,13 @@ It adds a tab *Intrastat* on the company form view. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/91/8.0 + :target: https://runbot.odoo-community.org/runbot/227/10.0 Bug Tracker =========== Bugs are tracked on `GitHub Issues -`_. In case +`_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed feedback. diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py new file mode 100644 index 0000000..c30463a --- /dev/null +++ b/intrastat_base/__manifest__.py @@ -0,0 +1,28 @@ +# -*- coding: utf-8 -*- +# © 2011-2016 Akretion (http://www.akretion.com) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Intrastat Reporting Base', + 'version': '10.0.1.0.0', + 'category': 'Intrastat', + 'license': 'AGPL-3', + 'summary': 'Base module for Intrastat reporting', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'http://www.akretion.com', + 'depends': ['base_vat'], + 'conflicts': ['report_intrastat'], + 'data': [ + 'data/country_data.xml', + 'views/product_template.xml', + 'views/res_partner.xml', + 'views/res_country.xml', + 'views/account_tax.xml', + 'views/account_config_settings.xml', + 'views/intrastat.xml', + ], + 'demo': [ + 'demo/intrastat_demo.xml', + ], + 'installable': True, +} diff --git a/intrastat_base/__openerp__.py b/intrastat_base/__openerp__.py deleted file mode 100644 index 12a810b..0000000 --- a/intrastat_base/__openerp__.py +++ /dev/null @@ -1,46 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2011-2015 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -{ - 'name': 'Intrastat Reporting Base', - 'version': '8.0.1.3.0', - 'category': 'Intrastat', - 'license': 'AGPL-3', - 'summary': 'Base module for Intrastat reporting', - 'author': 'Akretion,Odoo Community Association (OCA)', - 'website': 'http://www.akretion.com', - 'depends': ['base_vat'], - 'conflicts': ['report_intrastat'], - 'data': [ - 'data/country_data.xml', - 'views/product_template.xml', - 'views/res_partner.xml', - 'views/res_country.xml', - 'views/account_tax.xml', - 'views/res_company.xml', - 'views/intrastat.xml', - ], - 'demo': [ - 'demo/intrastat_demo.xml', - ], - 'installable': True, -} diff --git a/intrastat_base/data/country_data.xml b/intrastat_base/data/country_data.xml index c77f548..3c75a3a 100644 --- a/intrastat_base/data/country_data.xml +++ b/intrastat_base/data/country_data.xml @@ -1,90 +1,89 @@ - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index 422afa8..f53d397 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,57 +1,27 @@ - - - + FR58441019213 - - BE0828696437 - True - - - - BE0443167858 - True - - BE0884025633 True - - True - - - - True - - - - True - - - - True - - Shipping costs - SHIP + SHIP service 30 True - - + diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index a571f6a..fa36185 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -4,4 +4,5 @@ from . import res_country from . import product_template from . import account_tax from . import res_company +from . import account_config_settings from . import intrastat_common diff --git a/intrastat_base/models/account_config_settings.py b/intrastat_base/models/account_config_settings.py new file mode 100644 index 0000000..78a9fca --- /dev/null +++ b/intrastat_base/models/account_config_settings.py @@ -0,0 +1,12 @@ +# -*- coding: utf-8 -*- +# © 2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from odoo import models, fields + + +class AccountConfigSettings(models.TransientModel): + _inherit = 'account.config.settings' + + intrastat_remind_user_ids = fields.Many2many( + related='company_id.intrastat_remind_user_ids') diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index e11db59..f9997fc 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2011-2016 Akretion (http://www.akretion.com). +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class AccountTax(models.Model): diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index ff49c96..de3b04b 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/). -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2010-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, tools, _ -from openerp.exceptions import Warning as UserError +from odoo import models, fields, api, tools, _ +from odoo.exceptions import UserError import logging logger = logging.getLogger(__name__) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 07e0b2b..71cb987 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2010-2014 Akretion (http://www.akretion.com/) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2010-2016 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class ProductTemplate(models.Model): diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 291d846..5d4a4e7 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,27 +1,9 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2013-2014 Akretion (http://www.akretion.com) -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2013-2017 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api, _ -from openerp.exceptions import ValidationError +from odoo import models, fields, api, _ +from odoo.exceptions import ValidationError class ResCompany(models.Model): @@ -30,7 +12,7 @@ class ResCompany(models.Model): intrastat_remind_user_ids = fields.Many2many( 'res.users', column1='company_id', column2='user_id', string="Users Receiving the Intrastat Reminder", - help="List of OpenERP users who will receive a notification to " + help="List of Odoo users who will receive a notification to " "remind them about the Intrastat declaration.") intrastat_email_list = fields.Char( compute='_compute_intrastat_email_list', diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 8703f10..19f34f2 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,26 +1,8 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Intrastat base module for Odoo -# Copyright (C) 2011-2014 Akretion (http://www.akretion.com). -# @author Alexis de Lattre -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# © 2011-2014 Akretion (Alexis de Lattre ) +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import models, fields class ResCountry(models.Model): diff --git a/intrastat_base/views/account_config_settings.xml b/intrastat_base/views/account_config_settings.xml new file mode 100644 index 0000000..c890c40 --- /dev/null +++ b/intrastat_base/views/account_config_settings.xml @@ -0,0 +1,23 @@ + + + + + + + intrastat.account.config.settings.form + account.config.settings + + + + + + + + + + + + diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index d38cee6..a1e72cd 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,13 +1,10 @@ - - - + @@ -15,11 +12,10 @@ account.tax - + - - + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 73762d0..cc5a186 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,18 +1,16 @@ - - - + + parent="account.menu_finance_reports" sequence="50"/> @@ -32,5 +30,4 @@
-
- + diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 1f4f73f..6440407 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,13 +1,11 @@ - - - + + intrastat.base.product.template.form @@ -16,6 +14,8 @@ + @@ -24,5 +24,5 @@ - - + + diff --git a/intrastat_base/views/res_company.xml b/intrastat_base/views/res_company.xml deleted file mode 100644 index 0565f00..0000000 --- a/intrastat_base/views/res_company.xml +++ /dev/null @@ -1,29 +0,0 @@ - - - - - - - - - intrastat.company.form - res.company - - - - - - - - - - - - - - - diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index ac0f6f6..e9dec05 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,12 +1,11 @@ - - - + + @@ -46,5 +45,4 @@ - - + diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 6184e8c..7a9dfeb 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,13 +1,11 @@ - - - + @@ -24,5 +22,4 @@
- - + From e70446c7264f4547c23164a8706c19dbc8e68b53 Mon Sep 17 00:00:00 2001 From: Kumar Aberer Date: Fri, 9 Mar 2018 16:29:05 +0100 Subject: [PATCH 17/90] [MIG] intrastat_base: Migration to 11.0 --- intrastat_base/README.rst | 1 + intrastat_base/__manifest__.py | 9 +++--- intrastat_base/models/__init__.py | 2 +- intrastat_base/models/intrastat_common.py | 6 ++-- ...fig_settings.py => res_config_settings.py} | 5 ++-- .../views/account_config_settings.xml | 23 -------------- intrastat_base/views/res_config_settings.xml | 30 +++++++++++++++++++ 7 files changed, 43 insertions(+), 33 deletions(-) rename intrastat_base/models/{account_config_settings.py => res_config_settings.py} (65%) delete mode 100644 intrastat_base/views/account_config_settings.xml create mode 100644 intrastat_base/views/res_config_settings.xml diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 65531ec..09a4328 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -62,6 +62,7 @@ Contributors * Alexis de Lattre, Akretion * Luc De Meyer, Noviat +* Kumar Aberer, brain-tec AG Maintainer ---------- diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index c30463a..ba5a0f1 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,16 +1,17 @@ # -*- coding: utf-8 -*- # © 2011-2016 Akretion (http://www.akretion.com) +# © 2018 brain-tec AG (Kumar Aberer ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Intrastat Reporting Base', - 'version': '10.0.1.0.0', + 'version': '11.0.1.0.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', - 'author': 'Akretion,Odoo Community Association (OCA)', + 'author': 'Akretion,Odoo Community Association (OCA), brain-tec AG', 'website': 'http://www.akretion.com', - 'depends': ['base_vat'], + 'depends': ['base_vat', 'account'], 'conflicts': ['report_intrastat'], 'data': [ 'data/country_data.xml', @@ -18,7 +19,7 @@ 'views/res_partner.xml', 'views/res_country.xml', 'views/account_tax.xml', - 'views/account_config_settings.xml', + 'views/res_config_settings.xml', 'views/intrastat.xml', ], 'demo': [ diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index fa36185..b659505 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -4,5 +4,5 @@ from . import res_country from . import product_template from . import account_tax from . import res_company -from . import account_config_settings +from . import res_config_settings from . import intrastat_common diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index de3b04b..9508d80 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -57,14 +57,14 @@ class IntrastatCommon(models.AbstractModel): def _check_xml_schema(self, xml_string, xsd_file): '''Validate the XML file against the XSD''' from lxml import etree - from StringIO import StringIO + from io import StringIO xsd_etree_obj = etree.parse( tools.file_open(xsd_file)) official_schema = etree.XMLSchema(xsd_etree_obj) try: t = etree.parse(StringIO(xml_string)) official_schema.assertValid(t) - except Exception, e: + except Exception as e: # if the validation of the XSD fails, we arrive here logger = logging.getLogger(__name__) logger.warning( @@ -115,7 +115,7 @@ class IntrastatCommon(models.AbstractModel): 'nodestroy': True, 'target': 'current', 'res_id': attach_id, - } + } return action @api.multi diff --git a/intrastat_base/models/account_config_settings.py b/intrastat_base/models/res_config_settings.py similarity index 65% rename from intrastat_base/models/account_config_settings.py rename to intrastat_base/models/res_config_settings.py index 78a9fca..3457b8a 100644 --- a/intrastat_base/models/account_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- # © 2017 Akretion (Alexis de Lattre ) +# © 2018 brain-tec AG (Kumar Aberer ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import models, fields -class AccountConfigSettings(models.TransientModel): - _inherit = 'account.config.settings' +class ResConfigSettings(models.TransientModel): + _inherit = 'res.config.settings' intrastat_remind_user_ids = fields.Many2many( related='company_id.intrastat_remind_user_ids') diff --git a/intrastat_base/views/account_config_settings.xml b/intrastat_base/views/account_config_settings.xml deleted file mode 100644 index c890c40..0000000 --- a/intrastat_base/views/account_config_settings.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - - intrastat.account.config.settings.form - account.config.settings - - - - - - - - - - - - diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml new file mode 100644 index 0000000..cb9fd76 --- /dev/null +++ b/intrastat_base/views/res_config_settings.xml @@ -0,0 +1,30 @@ + + + + + + + intrastat.res.config.settings.form + res.config.settings + + + +

Intrastat

+
+
+
+
+
+
+
+
+
+ + +
From 7478470fe4c7bc082f3d21f944a767e0bc97d88b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rapha=C3=ABl=20Valyi?= Date: Fri, 27 Jul 2018 22:45:04 -0300 Subject: [PATCH 18/90] [IMP] *: removed utf-8 headers, changed icon and site * company model test, country model test as in v8 * png logo instead of svg, removed Python 2 utf-8 headers [UPD] squashed administrative commits --- intrastat_base/README.rst | 4 +- intrastat_base/__init__.py | 1 - intrastat_base/__manifest__.py | 5 +- intrastat_base/i18n/intrastat_base.pot | 148 ++++++++++++------- intrastat_base/models/__init__.py | 2 - intrastat_base/models/account_tax.py | 1 - intrastat_base/models/intrastat_common.py | 1 - intrastat_base/models/product_template.py | 1 - intrastat_base/models/res_company.py | 1 - intrastat_base/models/res_config_settings.py | 1 - intrastat_base/models/res_country.py | 1 - intrastat_base/tests/__init__.py | 1 + intrastat_base/tests/test_all.py | 22 +++ 13 files changed, 122 insertions(+), 67 deletions(-) create mode 100644 intrastat_base/tests/__init__.py create mode 100644 intrastat_base/tests/test_all.py diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 09a4328..2dece29 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -1,4 +1,4 @@ -.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg +.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 @@ -43,7 +43,7 @@ It adds a tab *Intrastat* on the company form view. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/227/10.0 + :target: https://runbot.odoo-community.org/runbot/227/11.0 Bug Tracker =========== diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index a0fdc10..0650744 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -1,2 +1 @@ -# -*- coding: utf-8 -*- from . import models diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index ba5a0f1..d584ab2 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2011-2016 Akretion (http://www.akretion.com) # © 2018 brain-tec AG (Kumar Aberer ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -9,8 +8,8 @@ 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', - 'author': 'Akretion,Odoo Community Association (OCA), brain-tec AG', - 'website': 'http://www.akretion.com', + 'author': 'Akretion,Odoo Community Association (OCA)', + 'website': 'https://github.com/OCA/intrastat', 'depends': ['base_vat', 'account'], 'conflicts': ['report_intrastat'], 'data': [ diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index fdc6996..e9e9889 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,10 +4,8 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 8.0\n" +"Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2015-05-27 18:43+0000\n" -"PO-Revision-Date: 2015-05-27 18:43+0000\n" "Last-Translator: <>\n" "Language-Team: \n" "MIME-Version: 1.0\n" @@ -16,23 +14,19 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: help:product.template,is_accessory_cost:0 +#: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:165 +#: code:addons/intrastat_base/models/intrastat_common.py:154 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" #. module: intrastat_base -#: view:res.company:intrastat_base.view_company_form -msgid "Common Intrastat Settings" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_report_intrastat_common +#: model:ir.model,name:intrastat_base.model_intrastat_common msgid "Common functions for intrastat reports for products " msgstr "" @@ -42,7 +36,7 @@ msgid "Companies" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:68 +#: code:addons/intrastat_base/models/intrastat_common.py:33 #, python-format msgid "Company not yet set on intrastat report." msgstr "" @@ -53,83 +47,126 @@ msgid "Country" msgstr "" #. module: intrastat_base -#: view:res.country:intrastat_base.view_country_search -#: field:res.country,intrastat:0 +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_uid +msgid "Created by" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_date +msgid "Created on" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_display_name +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_display_name +msgid "Display Name" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_country_intrastat +#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "EU Country" msgstr "" #. module: intrastat_base -#: field:product.template,exclude_from_intrastat:0 -msgid "Exclude from Intrastat reports" -msgstr "" - -#. module: intrastat_base -#: field:account.tax,exclude_from_intrastat_if_present:0 +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" #. module: intrastat_base -#: field:report.intrastat.common,id:0 +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_id msgid "ID" msgstr "" #. module: intrastat_base -#: help:product.template,exclude_from_intrastat:0 -msgid "If set to True, the product or service will not be taken into account for Intrastat Product or Service reports. So you should leave this field to False unless you have a very good reason." -msgstr "" - -#. module: intrastat_base -#: help:account.tax,exclude_from_intrastat_if_present:0 +#: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." msgstr "" #. module: intrastat_base -#: view:product.template:intrastat_base.product_template_form_view +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root +#: model:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +msgid "Intrastat" +msgstr "" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "" #. module: intrastat_base -#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root -msgid "Intrastat Reporting" +#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +msgid "Intrastat Result View" msgstr "" #. module: intrastat_base -#: view:res.company:intrastat_base.view_company_form -msgid "Intrastat Settings" -msgstr "" - -#. module: intrastat_base -#: field:product.template,is_accessory_cost:0 +#: model:ir.model.fields,field_description:intrastat_base.field_product_product_is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template_is_accessory_cost msgid "Is accessory cost" msgstr "" #. module: intrastat_base -#: help:res.company,intrastat_remind_user_ids:0 -msgid "List of OpenERP users who will receive a notification to remind them about the Intrastat declaration." +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common___last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view___last_update +msgid "Last Modified on" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/company.py:55 +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_uid +msgid "Last Updated by" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_date +msgid "Last Updated on" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_email_list +msgid "List of emails of Users Receiving the Intrastat Reminder" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/res_company.py:38 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_note +msgid "Notes" +msgstr "" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +msgid "Ok" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "" #. module: intrastat_base -#: view:res.country:intrastat_base.view_country_search +#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "Search Countries" msgstr "" #. module: intrastat_base -#: help:res.country,intrastat:0 +#: model:ir.model.fields,help:intrastat_base.field_res_country_intrastat msgid "Set to True for all European Union countries." msgstr "" #. module: intrastat_base +#: model:product.product,name:intrastat_base.shipping_costs_exclude #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template msgid "Shipping costs" msgstr "" @@ -140,43 +177,48 @@ msgid "Tax" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:84 +#: code:addons/intrastat_base/models/intrastat_common.py:51 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:76 +#: code:addons/intrastat_base/models/intrastat_common.py:41 #, python-format msgid "The company currency must be 'EUR', but is currently '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:72 +#: code:addons/intrastat_base/models/intrastat_common.py:37 #, python-format msgid "The country is not set on the company '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:105 +#: code:addons/intrastat_base/models/intrastat_common.py:74 #, python-format msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/product.py:51 +#: code:addons/intrastat_base/models/product_template.py:23 #, python-format msgid "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'" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/intrastat_common.py:62 -#, python-format -msgid "The start date must be the first day of the month" -msgstr "" - -#. module: intrastat_base -#: field:res.company,intrastat_remind_user_ids:0 +#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_result_view +msgid "intrastat.result.view" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "res.config.settings" +msgstr "" + diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index b659505..68e2955 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- - from . import res_country from . import product_template from . import account_tax diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index f9997fc..2235255 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2011-2016 Akretion (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 9508d80..ba508de 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2010-2016 Akretion (Alexis de Lattre ) # 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 71cb987..a0725f8 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2010-2016 Akretion (Alexis de Lattre ) # 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 5d4a4e7..4b110f0 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2013-2017 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index 3457b8a..4191666 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2017 Akretion (Alexis de Lattre ) # © 2018 brain-tec AG (Kumar Aberer ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 19f34f2..9b4868c 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # © 2011-2014 Akretion (Alexis de Lattre ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/tests/__init__.py b/intrastat_base/tests/__init__.py new file mode 100644 index 0000000..7836283 --- /dev/null +++ b/intrastat_base/tests/__init__.py @@ -0,0 +1 @@ +from . import test_all diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py new file mode 100644 index 0000000..fbc91ac --- /dev/null +++ b/intrastat_base/tests/test_all.py @@ -0,0 +1,22 @@ +from odoo.tests.common import TransactionCase + + +class TestIntrastatBase(TransactionCase): + """Tests for this module""" + + def test_10_countries(self): + # check if only EU countries have the 'intrastat' bit set + france = self.env.ref('base.fr') + self.assertTrue(france.intrastat) + brazil = self.env.ref('base.br') + self.assertFalse(brazil.intrastat) + + def test_20_company(self): + # add 'Demo user' to intrastat_remind_user_ids + demo_user = self.env.ref('base.user_demo') + demo_company = self.env.ref('base.main_company') + demo_company.write({ + 'intrastat_remind_user_ids': [(6, False, [demo_user.id])] + }) + # then check if intrastat_email_list contains the email of the user + self.assertEquals(demo_company.intrastat_email_list, demo_user.email) From f23dca9ff74f6b141cb0bb48ddc3346db4de299e Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Thu, 16 Aug 2018 14:32:19 +0200 Subject: [PATCH 19/90] [10.0][FIX] intrastat_common - remove check on EUR EU countries are subject to Intrastat, also EU countries outside of the EU zone. As a consequence the check on company currency == EUR must be removed from this module (the right place are the localization modules). --- intrastat_base/models/intrastat_common.py | 5 ----- 1 file changed, 5 deletions(-) diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index ba508de..45b9399 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -36,11 +36,6 @@ class IntrastatCommon(models.AbstractModel): raise UserError( _("The country is not set on the company '%s'.") % company.name) - if company.currency_id.name != 'EUR': - raise UserError( - _("The company currency must be 'EUR', but is currently " - "'%s'.") - % company.currency_id.name) return True @api.multi From cb33d00806f93b7436cfc113858a393e10dbe792 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 6 Dec 2018 19:34:56 +0100 Subject: [PATCH 20/90] Add new module product_harmonized_system_delivery (hide native hs_code field) Finalize port to v11 --- intrastat_base/models/account_tax.py | 10 ++++++++ intrastat_base/models/intrastat_common.py | 27 ++++++++++---------- intrastat_base/views/account_tax.xml | 4 +-- intrastat_base/views/res_config_settings.xml | 8 ++++-- 4 files changed, 32 insertions(+), 17 deletions(-) diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index 2235255..df81523 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -12,3 +12,13 @@ class AccountTax(models.Model): help="If this tax is present on an invoice line, this invoice " "line will be skipped when generating Intrastat Product or " "Service lines from invoices.") + + +class AccountTaxTemplate(models.Model): + _inherit = "account.tax.template" + + exclude_from_intrastat_if_present = fields.Boolean( + string='Exclude invoice line from intrastat if this tax is present', + help="If this tax is present on an invoice line, this invoice " + "line will be skipped when generating Intrastat Product or " + "Service lines from invoices.") diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 45b9399..bc13e5f 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -3,6 +3,8 @@ from odoo import models, fields, api, tools, _ from odoo.exceptions import UserError +import base64 +from lxml import etree import logging logger = logging.getLogger(__name__) @@ -48,29 +50,29 @@ class IntrastatCommon(models.AbstractModel): return True @api.model - def _check_xml_schema(self, xml_string, xsd_file): + def _check_xml_schema(self, xml_etree, xsd_file): '''Validate the XML file against the XSD''' - from lxml import etree - from io import StringIO xsd_etree_obj = etree.parse( tools.file_open(xsd_file)) official_schema = etree.XMLSchema(xsd_etree_obj) try: - t = etree.parse(StringIO(xml_string)) - official_schema.assertValid(t) + official_schema.assertValid(xml_etree) except Exception as e: # if the validation of the XSD fails, we arrive here logger = logging.getLogger(__name__) logger.warning( "The XML file is invalid against the XML Schema Definition") + xml_string = etree.tostring( + xml_etree, pretty_print=True, encoding='UTF-8', + xml_declaration=True).decode() logger.warning(xml_string) logger.warning(e) - raise UserError( - _("The generated XML file is not valid against the official " - "XML Schema Definition. The generated XML file and the " - "full error have been written in the server logs. " - "Here is the error, which may give you an idea on the " - "cause of the problem : %s.") + raise UserError(_( + "The generated XML file is not valid against the official " + "XML Schema Definition. The generated XML file and the " + "full error have been written in the server logs. " + "Here is the error, which may give you an idea on the " + "cause of the problem : %s.") % str(e)) return True @@ -79,13 +81,12 @@ class IntrastatCommon(models.AbstractModel): '''Attach the XML file to the report_intrastat_product/service object''' self.ensure_one() - import base64 filename = '%s_%s.xml' % (self.year_month, declaration_name) attach = self.env['ir.attachment'].create({ 'name': filename, 'res_id': self.id, 'res_model': self._name, - 'datas': base64.encodestring(xml_string), + 'datas': base64.b64encode(xml_string), 'datas_fname': filename}) return attach.id diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index a1e72cd..7f77213 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -12,9 +12,9 @@ account.tax - + - + diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index cb9fd76..de45030 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -17,8 +17,12 @@
-
From 067f36596884ccc2d4f3b2b7f4367de055cc7282 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 10 Dec 2018 15:07:40 +0100 Subject: [PATCH 21/90] [FIX+IMP] intrastat_*: Several things: * Add readonly on some fields when state of declaration is done * Division by zero in computation of accessory costs * Add FR translation * Fix strings * Minor code updates --- intrastat_base/i18n/fr.po | 227 ++++++++++++++++++++++ intrastat_base/models/product_template.py | 11 +- 2 files changed, 232 insertions(+), 6 deletions(-) create mode 100644 intrastat_base/i18n/fr.po diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po new file mode 100644 index 0000000..7cca1e3 --- /dev/null +++ b/intrastat_base/i18n/fr.po @@ -0,0 +1,227 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 11.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-12-29 09:52+0000\n" +"PO-Revision-Date: 2018-12-29 09:52+0000\n" +"Last-Translator: <>\n" +"Language-Team: \n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: \n" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost +msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +msgstr "Activer cette option pour les frais de port, les frais d'emballage et tous les services associés à la vente de produits. Cette option est utilisée pour la DEB et la DES." + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:150 +#, python-format +msgid "Cannot delete the declaration %s because it is in Done state" +msgstr "Impossible de supprimer la déclaration %s parce qu'elle est à l'état 'Terminé'." + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_common +msgid "Common functions for intrastat reports for products " +msgstr "Common functions for intrastat reports for products " + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:35 +#, python-format +msgid "Company not yet set on intrastat report." +msgstr "Société non configurée sur le rapport DEB/DES." + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_country +msgid "Country" +msgstr "Pays" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_uid +msgid "Created by" +msgstr "Créé par" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_date +msgid "Created on" +msgstr "Créé le" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_display_name +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_display_name +msgid "Display Name" +msgstr "Afficher le nom" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_country_intrastat +#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "EU Country" +msgstr "Membre de l'UE" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +msgid "Exclude invoice line from intrastat if this tax is present" +msgstr "Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_id +msgid "ID" +msgstr "ID" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture sera sautée lors de la génération de la DEB et de la DES à partir des factures." + +#. module: intrastat_base +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root +#: model:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +msgid "Intrastat" +msgstr "DEB/DES" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.product_template_form_view +msgid "Intrastat Properties" +msgstr "Propriétés DEB/DES" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +msgid "Intrastat Result View" +msgstr "Résultat DEB" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_product_product_is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template_is_accessory_cost +msgid "Is accessory cost" +msgstr "Est un frais accessoire" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common___last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view___last_update +msgid "Last Modified on" +msgstr "Dernière modification le" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_uid +msgid "Last Updated by" +msgstr "Dernière modification par" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_date +msgid "Last Updated on" +msgstr "Dernière modification le" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." +msgstr "Liste d'utilisateurs Odoo qui recevront un rappel pour la DEB/DES." + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_email_list +msgid "List of emails of Users Receiving the Intrastat Reminder" +msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/res_company.py:38 +#, python-format +msgid "Missing e-mail address on user '%s'." +msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_note +msgid "Notes" +msgstr "Notes" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +msgid "Ok" +msgstr "Ok" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product Template" +msgstr "Modèle d'article" + +#. module: intrastat_base +#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Search Countries" +msgstr "Recherche pays" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_res_country_intrastat +msgid "Set to True for all European Union countries." +msgstr "Cocher la case pour tous les pays de l'Union Européenne." + +#. module: intrastat_base +#: model:product.product,name:intrastat_base.shipping_costs_exclude +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "Frais de port" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_tax +msgid "Tax" +msgstr "Taxe" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_tax_template +msgid "Templates for Taxes" +msgstr "Modèles pour les taxes" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:48 +#, python-format +msgid "The VAT number is not set for the partner '%s'." +msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:39 +#, python-format +msgid "The country is not set on the company '%s'." +msgstr "Pays non renseigné sur la société '%s'." + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:70 +#, python-format +msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." +msgstr "Le fichier XML n'est pas valide au regard du schéma de définition XML. Le fichier XML généré et l'erreur complète ont été écrits dans les logs du serveur Odoo. Voici l'erreur, qui pourrait vous aiguiller sur la cause du problème : %s." + +#. module: intrastat_base +#: code:addons/intrastat_base/models/product_template.py:23 +#, python-format +msgid "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'" +msgstr "L'option 'Est un frais accessoire' ne doit être activée que sur des articles de service. Vous avez activé cette option pour l'article '%s' qui est de type '%s'" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +msgid "Users Receiving the Intrastat Reminder" +msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_result_view +msgid "intrastat.result.view" +msgstr "intrastat.result.view" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "res.config.settings" +msgstr "res.config.settings" + diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index a0725f8..0f714f0 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -19,9 +19,8 @@ class ProductTemplate(models.Model): def _check_accessory_cost(self): for this in self: if this.is_accessory_cost and this.type != 'service': - raise ValidationError( - _("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.name, this.type)) + raise ValidationError(_( + "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.name, this.type)) From 5c915b9303d67f416be8cbba477446b6a8a57f79 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 17 Apr 2019 20:48:49 +0200 Subject: [PATCH 22/90] [MIG] intrastat_product: Migration to 11.0 * Small fixes in intrastat_base * account_tax_template [UPD] Update intrastat_base.pot --- intrastat_base/__manifest__.py | 7 +-- intrastat_base/i18n/intrastat_base.pot | 33 +++++++------- intrastat_base/models/intrastat_common.py | 45 ++++++++++--------- intrastat_base/models/product_template.py | 15 ++++--- intrastat_base/models/res_company.py | 4 +- intrastat_base/models/res_config_settings.py | 6 +-- intrastat_base/models/res_country.py | 4 +- intrastat_base/static/description/icon.png | Bin 0 -> 9455 bytes intrastat_base/views/account_tax.xml | 4 +- intrastat_base/views/res_config_settings.xml | 13 +++--- 10 files changed, 67 insertions(+), 64 deletions(-) create mode 100644 intrastat_base/static/description/icon.png diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index d584ab2..b92710b 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,5 +1,6 @@ -# © 2011-2016 Akretion (http://www.akretion.com) -# © 2018 brain-tec AG (Kumar Aberer ) +# Copyright 2011-2016 Akretion (http://www.akretion.com) +# Copyright 2018 brain-tec AG (Kumar Aberer ) +# Copyright 2009-2019 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { @@ -8,7 +9,7 @@ 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', - 'author': 'Akretion,Odoo Community Association (OCA)', + 'author': 'Akretion,Noviat,Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/intrastat', 'depends': ['base_vat', 'account'], 'conflicts': ['report_intrastat'], diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index e9e9889..315e3f2 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -20,7 +20,7 @@ msgid "Activate this option for shipping costs, packaging costs and all services msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:154 +#: code:addons/intrastat_base/models/intrastat_common.py:151 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -36,7 +36,7 @@ msgid "Companies" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:33 +#: code:addons/intrastat_base/models/intrastat_common.py:39 #, python-format msgid "Company not yet set on intrastat report." msgstr "" @@ -70,6 +70,7 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" @@ -81,6 +82,7 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." msgstr "" @@ -177,35 +179,34 @@ msgid "Tax" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:51 +#: model:ir.model,name:intrastat_base.model_account_tax_template +msgid "Templates for Taxes" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:52 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:41 -#, python-format -msgid "The company currency must be 'EUR', but is currently '%s'." -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:37 +#: code:addons/intrastat_base/models/intrastat_common.py:43 #, python-format msgid "The country is not set on the company '%s'." msgstr "" -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:74 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." -msgstr "" - #. module: intrastat_base #: code:addons/intrastat_base/models/product_template.py:23 #, python-format msgid "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'" msgstr "" +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:73 +#, python-format +msgid "Unknown Error" +msgstr "" + #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids #: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index bc13e5f..048d5c5 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,12 +1,16 @@ -# © 2010-2016 Akretion (Alexis de Lattre ) +# Copyright 2010-2016 Akretion () +# Copyright 2009-2019 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, tools, _ -from odoo.exceptions import UserError -import base64 +from io import BytesIO from lxml import etree +from sys import exc_info +from traceback import format_exception import logging +from odoo import api, fields, models, tools, _ +from odoo.exceptions import UserError + logger = logging.getLogger(__name__) @@ -50,43 +54,40 @@ class IntrastatCommon(models.AbstractModel): return True @api.model - def _check_xml_schema(self, xml_etree, xsd_file): + def _check_xml_schema(self, xml_string, xsd_file): '''Validate the XML file against the XSD''' xsd_etree_obj = etree.parse( - tools.file_open(xsd_file)) + tools.file_open(xsd_file, mode='rb')) official_schema = etree.XMLSchema(xsd_etree_obj) try: - official_schema.assertValid(xml_etree) - except Exception as e: - # if the validation of the XSD fails, we arrive here - logger = logging.getLogger(__name__) + t = etree.parse(BytesIO(xml_string)) + official_schema.assertValid(t) + except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e: logger.warning( "The XML file is invalid against the XML Schema Definition") - xml_string = etree.tostring( - xml_etree, pretty_print=True, encoding='UTF-8', - xml_declaration=True).decode() logger.warning(xml_string) logger.warning(e) - raise UserError(_( - "The generated XML file is not valid against the official " - "XML Schema Definition. The generated XML file and the " - "full error have been written in the server logs. " - "Here is the error, which may give you an idea on the " - "cause of the problem : %s.") - % str(e)) - return True + usererror = '%s\n\n%s' % (e.__class__.__name__, str(e)) + raise UserError(usererror) + except Exception: + error = _("Unknown Error") + tb = ''.join(format_exception(*exc_info())) + error += '\n%s' % tb + logger.warning(error) + raise UserError(error) @api.multi def _attach_xml_file(self, xml_string, declaration_name): '''Attach the XML file to the report_intrastat_product/service object''' self.ensure_one() + import base64 filename = '%s_%s.xml' % (self.year_month, declaration_name) attach = self.env['ir.attachment'].create({ 'name': filename, 'res_id': self.id, 'res_model': self._name, - 'datas': base64.b64encode(xml_string), + 'datas': base64.encodestring(xml_string), 'datas_fname': filename}) return attach.id diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 0f714f0..bc3f6ca 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,7 +1,7 @@ -# © 2010-2016 Akretion (Alexis de Lattre ) +# Copyright 2010-2016 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import ValidationError @@ -19,8 +19,9 @@ class ProductTemplate(models.Model): def _check_accessory_cost(self): for this in self: if this.is_accessory_cost and this.type != 'service': - raise ValidationError(_( - "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.name, this.type)) + raise ValidationError( + _("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.name, this.type)) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 4b110f0..f67bcf5 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,7 +1,7 @@ -# © 2013-2017 Akretion (Alexis de Lattre ) +# Copyright 2013-2017 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields, api, _ +from odoo import api, fields, models, _ from odoo.exceptions import ValidationError diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index 4191666..14c62ec 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -1,8 +1,8 @@ -# © 2017 Akretion (Alexis de Lattre ) -# © 2018 brain-tec AG (Kumar Aberer ) +# Copyright 2017 Akretion (Alexis de Lattre ) +# Copyright 2018 brain-tec AG (Kumar Aberer ) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from odoo import models, fields +from odoo import fields, models class ResConfigSettings(models.TransientModel): diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 9b4868c..3af71f0 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,7 +1,7 @@ -# © 2011-2014 Akretion (Alexis de Lattre ) +# Copyright 2011-2014 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class ResCountry(models.Model): diff --git a/intrastat_base/static/description/icon.png b/intrastat_base/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..3a0328b516c4980e8e44cdb63fd945757ddd132d GIT binary patch literal 9455 zcmW++2RxMjAAjx~&dlBk9S+%}OXg)AGE&Cb*&}d0jUxM@u(PQx^-s)697TX`ehR4?GS^qbkof1cslKgkU)h65qZ9Oc=ml_0temigYLJfnz{IDzUf>bGs4N!v3=Z3jMq&A#7%rM5eQ#dc?k~! zVpnB`o+K7|Al`Q_U;eD$B zfJtP*jH`siUq~{KE)`jP2|#TUEFGRryE2`i0**z#*^6~AI|YzIWy$Cu#CSLW3q=GA z6`?GZymC;dCPk~rBS%eCb`5OLr;RUZ;D`}um=H)BfVIq%7VhiMr)_#G0N#zrNH|__ zc+blN2UAB0=617@>_u;MPHN;P;N#YoE=)R#i$k_`UAA>WWCcEVMh~L_ zj--gtp&|K1#58Yz*AHCTMziU1Jzt_jG0I@qAOHsk$2}yTmVkBp_eHuY$A9)>P6o~I z%aQ?!(GqeQ-Y+b0I(m9pwgi(IIZZzsbMv+9w{PFtd_<_(LA~0H(xz{=FhLB@(1&qHA5EJw1>>=%q2f&^X>IQ{!GJ4e9U z&KlB)z(84HmNgm2hg2C0>WM{E(DdPr+EeU_N@57;PC2&DmGFW_9kP&%?X4}+xWi)( z;)z%wI5>D4a*5XwD)P--sPkoY(a~WBw;E~AW`Yue4kFa^LM3X`8x|}ZUeMnqr}>kH zG%WWW>3ml$Yez?i%)2pbKPI7?5o?hydokgQyZsNEr{a|mLdt;X2TX(#B1j35xPnPW z*bMSSOauW>o;*=kO8ojw91VX!qoOQb)zHJ!odWB}d+*K?#sY_jqPdg{Sm2HdYzdEx zOGVPhVRTGPtv0o}RfVP;Nd(|CB)I;*t&QO8h zFfekr30S!-LHmV_Su-W+rEwYXJ^;6&3|L$mMC8*bQptyOo9;>Qb9Q9`ySe3%V$A*9 zeKEe+b0{#KWGp$F+tga)0RtI)nhMa-K@JS}2krK~n8vJ=Ngm?R!9G<~RyuU0d?nz# z-5EK$o(!F?hmX*2Yt6+coY`6jGbb7tF#6nHA zuKk=GGJ;ZwON1iAfG$E#Y7MnZVmrY|j0eVI(DN_MNFJmyZ|;w4tf@=CCDZ#5N_0K= z$;R~bbk?}TpfDjfB&aiQ$VA}s?P}xPERJG{kxk5~R`iRS(SK5d+Xs9swCozZISbnS zk!)I0>t=A<-^z(cmSFz3=jZ23u13X><0b)P)^1T_))Kr`e!-pb#q&J*Q`p+B6la%C zuVl&0duN<;uOsB3%T9Fp8t{ED108<+W(nOZd?gDnfNBC3>M8WE61$So|P zVvqH0SNtDTcsUdzaMDpT=Ty0pDHHNL@Z0w$Y`XO z2M-_r1S+GaH%pz#Uy0*w$Vdl=X=rQXEzO}d6J^R6zjM1u&c9vYLvLp?W7w(?np9x1 zE_0JSAJCPB%i7p*Wvg)pn5T`8k3-uR?*NT|J`eS#_#54p>!p(mLDvmc-3o0mX*mp_ zN*AeS<>#^-{S%W<*mz^!X$w_2dHWpcJ6^j64qFBft-o}o_Vx80o0>}Du;>kLts;$8 zC`7q$QI(dKYG`Wa8#wl@V4jVWBRGQ@1dr-hstpQL)Tl+aqVpGpbSfN>5i&QMXfiZ> zaA?T1VGe?rpQ@;+pkrVdd{klI&jVS@I5_iz!=UMpTsa~mBga?1r}aRBm1WS;TT*s0f0lY=JBl66Upy)-k4J}lh=P^8(SXk~0xW=T9v*B|gzIhN z>qsO7dFd~mgxAy4V?&)=5ieYq?zi?ZEoj)&2o)RLy=@hbCRcfT5jigwtQGE{L*8<@Yd{zg;CsL5mvzfDY}P-wos_6PfprFVaeqNE%h zKZhLtcQld;ZD+>=nqN~>GvROfueSzJD&BE*}XfU|H&(FssBqY=hPCt`d zH?@s2>I(|;fcW&YM6#V#!kUIP8$Nkdh0A(bEVj``-AAyYgwY~jB zT|I7Bf@%;7aL7Wf4dZ%VqF$eiaC38OV6oy3Z#TER2G+fOCd9Iaoy6aLYbPTN{XRPz z;U!V|vBf%H!}52L2gH_+j;`bTcQRXB+y9onc^wLm5wi3-Be}U>k_u>2Eg$=k!(l@I zcCg+flakT2Nej3i0yn+g+}%NYb?ta;R?(g5SnwsQ49U8Wng8d|{B+lyRcEDvR3+`O{zfmrmvFrL6acVP%yG98X zo&+VBg@px@i)%o?dG(`T;n*$S5*rnyiR#=wW}}GsAcfyQpE|>a{=$Hjg=-*_K;UtD z#z-)AXwSRY?OPefw^iI+ z)AXz#PfEjlwTes|_{sB?4(O@fg0AJ^g8gP}ex9Ucf*@_^J(s_5jJV}c)s$`Myn|Kd z$6>}#q^n{4vN@+Os$m7KV+`}c%4)4pv@06af4-x5#wj!KKb%caK{A&Y#Rfs z-po?Dcb1({W=6FKIUirH&(yg=*6aLCekcKwyfK^JN5{wcA3nhO(o}SK#!CINhI`-I z1)6&n7O&ZmyFMuNwvEic#IiOAwNkR=u5it{B9n2sAJV5pNhar=j5`*N!Na;c7g!l$ z3aYBqUkqqTJ=Re-;)s!EOeij=7SQZ3Hq}ZRds%IM*PtM$wV z@;rlc*NRK7i3y5BETSKuumEN`Xu_8GP1Ri=OKQ$@I^ko8>H6)4rjiG5{VBM>B|%`&&s^)jS|-_95&yc=GqjNo{zFkw%%HHhS~e=s zD#sfS+-?*t|J!+ozP6KvtOl!R)@@-z24}`9{QaVLD^9VCSR2b`b!KC#o;Ki<+wXB6 zx3&O0LOWcg4&rv4QG0)4yb}7BFSEg~=IR5#ZRj8kg}dS7_V&^%#Do==#`u zpy6{ox?jWuR(;pg+f@mT>#HGWHAJRRDDDv~@(IDw&R>9643kK#HN`!1vBJHnC+RM&yIh8{gG2q zA%e*U3|N0XSRa~oX-3EAneep)@{h2vvd3Xvy$7og(sayr@95+e6~Xvi1tUqnIxoIH zVWo*OwYElb#uyW{Imam6f2rGbjR!Y3`#gPqkv57dB6K^wRGxc9B(t|aYDGS=m$&S!NmCtrMMaUg(c zc2qC=2Z`EEFMW-me5B)24AqF*bV5Dr-M5ig(l-WPS%CgaPzs6p_gnCIvTJ=Y<6!gT zVt@AfYCzjjsMEGi=rDQHo0yc;HqoRNnNFeWZgcm?f;cp(6CNylj36DoL(?TS7eU#+ z7&mfr#y))+CJOXQKUMZ7QIdS9@#-}7y2K1{8)cCt0~-X0O!O?Qx#E4Og+;A2SjalQ zs7r?qn0H044=sDN$SRG$arw~n=+T_DNdSrarmu)V6@|?1-ZB#hRn`uilTGPJ@fqEy zGt(f0B+^JDP&f=r{#Y_wi#AVDf-y!RIXU^0jXsFpf>=Ji*TeqSY!H~AMbJdCGLhC) zn7Rx+sXw6uYj;WRYrLd^5IZq@6JI1C^YkgnedZEYy<&4(z%Q$5yv#Boo{AH8n$a zhb4Y3PWdr269&?V%uI$xMcUrMzl=;w<_nm*qr=c3Rl@i5wWB;e-`t7D&c-mcQl7x! zZWB`UGcw=Y2=}~wzrfLx=uet<;m3~=8I~ZRuzvMQUQdr+yTV|ATf1Uuomr__nDf=X zZ3WYJtHp_ri(}SQAPjv+Y+0=fH4krOP@S&=zZ-t1jW1o@}z;xk8 z(Nz1co&El^HK^NrhVHa-_;&88vTU>_J33=%{if;BEY*J#1n59=07jrGQ#IP>@u#3A z;!q+E1Rj3ZJ+!4bq9F8PXJ@yMgZL;>&gYA0%_Kbi8?S=XGM~dnQZQ!yBSgcZhY96H zrWnU;k)qy`rX&&xlDyA%(a1Hhi5CWkmg(`Gb%m(HKi-7Z!LKGRP_B8@`7&hdDy5n= z`OIxqxiVfX@OX1p(mQu>0Ai*v_cTMiw4qRt3~NBvr9oBy0)r>w3p~V0SCm=An6@3n)>@z!|o-$HvDK z|3D2ZMJkLE5loMKl6R^ez@Zz%S$&mbeoqH5`Bb){Ei21q&VP)hWS2tjShfFtGE+$z zzCR$P#uktu+#!w)cX!lWN1XU%K-r=s{|j?)Akf@q#3b#{6cZCuJ~gCxuMXRmI$nGtnH+-h z+GEi!*X=AP<|fG`1>MBdTb?28JYc=fGvAi2I<$B(rs$;eoJCyR6_bc~p!XR@O-+sD z=eH`-ye})I5ic1eL~TDmtfJ|8`0VJ*Yr=hNCd)G1p2MMz4C3^Mj?7;!w|Ly%JqmuW zlIEW^Ft%z?*|fpXda>Jr^1noFZEwFgVV%|*XhH@acv8rdGxeEX{M$(vG{Zw+x(ei@ zmfXb22}8-?Fi`vo-YVrTH*C?a8%M=Hv9MqVH7H^J$KsD?>!SFZ;ZsvnHr_gn=7acz z#W?0eCdVhVMWN12VV^$>WlQ?f;P^{(&pYTops|btm6aj>_Uz+hqpGwB)vWp0Cf5y< zft8-je~nn?W11plq}N)4A{l8I7$!ks_x$PXW-2XaRFswX_BnF{R#6YIwMhAgd5F9X zGmwdadS6(a^fjHtXg8=l?Rc0Sm%hk6E9!5cLVloEy4eh(=FwgP`)~I^5~pBEWo+F6 zSf2ncyMurJN91#cJTy_u8Y}@%!bq1RkGC~-bV@SXRd4F{R-*V`bS+6;W5vZ(&+I<9$;-V|eNfLa5n-6% z2(}&uGRF;p92eS*sE*oR$@pexaqr*meB)VhmIg@h{uzkk$9~qh#cHhw#>O%)b@+(| z^IQgqzuj~Sk(J;swEM-3TrJAPCq9k^^^`q{IItKBRXYe}e0Tdr=Huf7da3$l4PdpwWDop%^}n;dD#K4s#DYA8SHZ z&1!riV4W4R7R#C))JH1~axJ)RYnM$$lIR%6fIVA@zV{XVyx}C+a-Dt8Y9M)^KU0+H zR4IUb2CJ{Hg>CuaXtD50jB(_Tcx=Z$^WYu2u5kubqmwp%drJ6 z?Fo40g!Qd<-l=TQxqHEOuPX0;^z7iX?Ke^a%XT<13TA^5`4Xcw6D@Ur&VT&CUe0d} z1GjOVF1^L@>O)l@?bD~$wzgf(nxX1OGD8fEV?TdJcZc2KoUe|oP1#=$$7ee|xbY)A zDZq+cuTpc(fFdj^=!;{k03C69lMQ(|>uhRfRu%+!k&YOi-3|1QKB z z?n?eq1XP>p-IM$Z^C;2L3itnbJZAip*Zo0aw2bs8@(s^~*8T9go!%dHcAz2lM;`yp zD=7&xjFV$S&5uDaiScyD?B-i1ze`+CoRtz`Wn+Zl&#s4&}MO{@N!ufrzjG$B79)Y2d3tBk&)TxUTw@QS0TEL_?njX|@vq?Uz(nBFK5Pq7*xj#u*R&i|?7+6# z+|r_n#SW&LXhtheZdah{ZVoqwyT{D>MC3nkFF#N)xLi{p7J1jXlmVeb;cP5?e(=f# zuT7fvjSbjS781v?7{)-X3*?>tq?)Yd)~|1{BDS(pqC zC}~H#WXlkUW*H5CDOo<)#x7%RY)A;ShGhI5s*#cRDA8YgqG(HeKDx+#(ZQ?386dv! zlXCO)w91~Vw4AmOcATuV653fa9R$fyK8ul%rG z-wfS zihugoZyr38Im?Zuh6@RcF~t1anQu7>#lPpb#}4cOA!EM11`%f*07RqOVkmX{p~KJ9 z^zP;K#|)$`^Rb{rnHGH{~>1(fawV0*Z#)}M`m8-?ZJV<+e}s9wE# z)l&az?w^5{)`S(%MRzxdNqrs1n*-=jS^_jqE*5XDrA0+VE`5^*p3CuM<&dZEeCjoz zR;uu_H9ZPZV|fQq`Cyw4nscrVwi!fE6ciMmX$!_hN7uF;jjKG)d2@aC4ropY)8etW=xJvni)8eHi`H$%#zn^WJ5NLc-rqk|u&&4Z6fD_m&JfSI1Bvb?b<*n&sfl0^t z=HnmRl`XrFvMKB%9}>PaA`m-fK6a0(8=qPkWS5bb4=v?XcWi&hRY?O5HdulRi4?fN zlsJ*N-0Qw+Yic@s0(2uy%F@ib;GjXt01Fmx5XbRo6+n|pP(&nodMoap^z{~q ziEeaUT@Mxe3vJSfI6?uLND(CNr=#^W<1b}jzW58bIfyWTDle$mmS(|x-0|2UlX+9k zQ^EX7Nw}?EzVoBfT(-LT|=9N@^hcn-_p&sqG z&*oVs2JSU+N4ZD`FhCAWaS;>|wH2G*Id|?pa#@>tyxX`+4HyIArWDvVrX)2WAOQff z0qyHu&-S@i^MS-+j--!pr4fPBj~_8({~e1bfcl0wI1kaoN>mJL6KUPQm5N7lB(ui1 zE-o%kq)&djzWJ}ob<-GfDlkB;F31j-VHKvQUGQ3sp`CwyGJk_i!y^sD0fqC@$9|jO zOqN!r!8-p==F@ZVP=U$qSpY(gQ0)59P1&t@y?5rvg<}E+GB}26NYPp4f2YFQrQtot5mn3wu_qprZ=>Ig-$ zbW26Ws~IgY>}^5w`vTB(G`PTZaDiGBo5o(tp)qli|NeV( z@H_=R8V39rt5J5YB2Ky?4eJJ#b`_iBe2ot~6%7mLt5t8Vwi^Jy7|jWXqa3amOIoRb zOr}WVFP--DsS`1WpN%~)t3R!arKF^Q$e12KEqU36AWwnCBICpH4XCsfnyrHr>$I$4 z!DpKX$OKLWarN7nv@!uIA+~RNO)l$$w}p(;b>mx8pwYvu;dD_unryX_NhT8*Tj>BTrTTL&!?O+%Rv;b?B??gSzdp?6Uug9{ zd@V08Z$BdI?fpoCS$)t4mg4rT8Q_I}h`0d-vYZ^|dOB*Q^S|xqTV*vIg?@fVFSmMpaw0qtTRbx} z({Pg?#{2`sc9)M5N$*N|4;^t$+QP?#mov zGVC@I*lBVrOU-%2y!7%)fAKjpEFsgQc4{amtiHb95KQEwvf<(3T<9-Zm$xIew#P22 zc2Ix|App^>v6(3L_MCU0d3W##AB0M~3D00EWoKZqsJYT(#@w$Y_H7G22M~ApVFTRHMI_3be)Lkn#0F*V8Pq zc}`Cjy$bE;FJ6H7p=0y#R>`}-m4(0F>%@P|?7fx{=R^uFdISRnZ2W_xQhD{YuR3t< z{6yxu=4~JkeA;|(J6_nv#>Nvs&FuLA&PW^he@t(UwFFE8)|a!R{`E`K`i^ZnyE4$k z;(749Ix|oi$c3QbEJ3b~D_kQsPz~fIUKym($a_7dJ?o+40*OLl^{=&oq$<#Q(yyrp z{J-FAniyAw9tPbe&IhQ|a`DqFTVQGQ&Gq3!C2==4x{6EJwiPZ8zub-iXoUtkJiG{} zPaR&}_fn8_z~(=;5lD-aPWD3z8PZS@AaUiomF!G8I}Mf>e~0g#BelA-5#`cj;O5>N Xviia!U7SGha1wx#SCgwmn*{w2TRX*I literal 0 HcmV?d00001 diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index 7f77213..a1e72cd 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -12,9 +12,9 @@ account.tax - + - + diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index de45030..f472061 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -15,14 +15,13 @@

Intrastat

-
+
+
-
-
-
-
+
+
From f8dc396c163c97ebac974701672b61b89e7d2591 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 20 May 2019 20:40:35 +0000 Subject: [PATCH 23/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-11.0/intrastat-extrastat-11.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-11-0/intrastat-extrastat-11-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 72 ++++++++++++++++++++++++++++----------- 1 file changed, 52 insertions(+), 20 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 7cca1e3..7c3aeda 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -1,6 +1,6 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * intrastat_base +# * intrastat_base # msgid "" msgstr "" @@ -10,6 +10,7 @@ msgstr "" "PO-Revision-Date: 2018-12-29 09:52+0000\n" "Last-Translator: <>\n" "Language-Team: \n" +"Language: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" @@ -18,14 +19,21 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost #: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost -msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." -msgstr "Activer cette option pour les frais de port, les frais d'emballage et tous les services associés à la vente de produits. Cette option est utilisée pour la DEB et la DES." +msgid "" +"Activate this option for shipping costs, packaging costs and all services " +"related to the sale of products. This option is used for Intrastat reports." +msgstr "" +"Activer cette option pour les frais de port, les frais d'emballage et tous " +"les services associés à la vente de produits. Cette option est utilisée pour " +"la DEB et la DES." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:150 +#: code:addons/intrastat_base/models/intrastat_common.py:151 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" -msgstr "Impossible de supprimer la déclaration %s parce qu'elle est à l'état 'Terminé'." +msgstr "" +"Impossible de supprimer la déclaration %s parce qu'elle est à l'état " +"'Terminé'." #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_intrastat_common @@ -38,7 +46,7 @@ msgid "Companies" msgstr "Sociétés" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:35 +#: code:addons/intrastat_base/models/intrastat_common.py:39 #, python-format msgid "Company not yet set on intrastat report." msgstr "Société non configurée sur le rapport DEB/DES." @@ -74,7 +82,8 @@ msgstr "Membre de l'UE" #: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present #: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" -msgstr "Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" +msgstr "" +"Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id @@ -85,8 +94,13 @@ msgstr "ID" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present #: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present -msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." -msgstr "Si cette taxe est présente sur une ligne de facture, cette ligne de facture sera sautée lors de la génération de la DEB et de la DES à partir des factures." +msgid "" +"If this tax is present on an invoice line, this invoice line will be skipped " +"when generating Intrastat Product or Service lines from invoices." +msgstr "" +"Si cette taxe est présente sur une ligne de facture, cette ligne de facture " +"sera sautée lors de la génération de la DEB et de la DES à partir des " +"factures." #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root @@ -130,7 +144,9 @@ msgstr "Dernière modification le" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids #: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids -msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." +msgid "" +"List of Odoo users who will receive a notification to remind them about the " +"Intrastat declaration." msgstr "Liste d'utilisateurs Odoo qui recevront un rappel pour la DEB/DES." #. module: intrastat_base @@ -186,28 +202,34 @@ msgid "Templates for Taxes" msgstr "Modèles pour les taxes" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:48 +#: code:addons/intrastat_base/models/intrastat_common.py:52 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:39 +#: code:addons/intrastat_base/models/intrastat_common.py:43 #, python-format msgid "The country is not set on the company '%s'." msgstr "Pays non renseigné sur la société '%s'." -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:70 -#, python-format -msgid "The generated XML file is not valid against the official XML Schema Definition. The generated XML file and the full error have been written in the server logs. Here is the error, which may give you an idea on the cause of the problem : %s." -msgstr "Le fichier XML n'est pas valide au regard du schéma de définition XML. Le fichier XML généré et l'erreur complète ont été écrits dans les logs du serveur Odoo. Voici l'erreur, qui pourrait vous aiguiller sur la cause du problème : %s." - #. module: intrastat_base #: code:addons/intrastat_base/models/product_template.py:23 #, python-format -msgid "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'" -msgstr "L'option 'Est un frais accessoire' ne doit être activée que sur des articles de service. Vous avez activé cette option pour l'article '%s' qui est de type '%s'" +msgid "" +"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'" +msgstr "" +"L'option 'Est un frais accessoire' ne doit être activée que sur des articles " +"de service. Vous avez activé cette option pour l'article '%s' qui est de " +"type '%s'" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:73 +#, python-format +msgid "Unknown Error" +msgstr "" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids @@ -225,3 +247,13 @@ msgstr "intrastat.result.view" msgid "res.config.settings" msgstr "res.config.settings" +#~ msgid "" +#~ "The generated XML file is not valid against the official XML Schema " +#~ "Definition. The generated XML file and the full error have been written " +#~ "in the server logs. Here is the error, which may give you an idea on the " +#~ "cause of the problem : %s." +#~ msgstr "" +#~ "Le fichier XML n'est pas valide au regard du schéma de définition XML. Le " +#~ "fichier XML généré et l'erreur complète ont été écrits dans les logs du " +#~ "serveur Odoo. Voici l'erreur, qui pourrait vous aiguiller sur la cause du " +#~ "problème : %s." From 9f75facf282a27c88b4f8cc420ca049e9135457e Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 27 May 2019 19:45:06 +0200 Subject: [PATCH 24/90] Prepare v12 branch --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index b92710b..c372a09 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -25,5 +25,5 @@ 'demo': [ 'demo/intrastat_demo.xml', ], - 'installable': True, + 'installable': False, } From b2b300aa4b85908a684ba66383c674d0a9c44c8b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 28 May 2019 19:09:32 +0200 Subject: [PATCH 25/90] [MIG] Migrate all modules from v11 to v12 [UPD] Update intrastat_base.pot --- intrastat_base/__manifest__.py | 6 +- intrastat_base/demo/intrastat_demo.xml | 5 +- intrastat_base/i18n/intrastat_base.pot | 121 ++++++++++++------- intrastat_base/models/account_tax.py | 2 +- intrastat_base/models/intrastat_common.py | 11 +- intrastat_base/models/product_template.py | 1 - intrastat_base/models/res_company.py | 5 +- intrastat_base/models/res_config_settings.py | 2 +- intrastat_base/models/res_country.py | 3 +- intrastat_base/readme/CONTRIBUTORS.rst | 4 + intrastat_base/readme/DESCRIPTION.rst | 11 ++ intrastat_base/readme/INSTALL.rst | 5 + intrastat_base/readme/USAGE.rst | 9 ++ intrastat_base/views/account_tax.xml | 3 +- intrastat_base/views/intrastat.xml | 4 +- intrastat_base/views/product_template.xml | 3 +- intrastat_base/views/res_config_settings.xml | 7 +- intrastat_base/views/res_country.xml | 10 +- intrastat_base/views/res_partner.xml | 2 +- 19 files changed, 135 insertions(+), 79 deletions(-) create mode 100644 intrastat_base/readme/CONTRIBUTORS.rst create mode 100644 intrastat_base/readme/DESCRIPTION.rst create mode 100644 intrastat_base/readme/INSTALL.rst create mode 100644 intrastat_base/readme/USAGE.rst diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index c372a09..0113306 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,14 +5,14 @@ { 'name': 'Intrastat Reporting Base', - 'version': '11.0.1.0.0', + 'version': '12.0.1.0.0', 'category': 'Intrastat', 'license': 'AGPL-3', 'summary': 'Base module for Intrastat reporting', 'author': 'Akretion,Noviat,Odoo Community Association (OCA)', 'website': 'https://github.com/OCA/intrastat', 'depends': ['base_vat', 'account'], - 'conflicts': ['report_intrastat'], + 'excludes': ['account_intrastat'], 'data': [ 'data/country_data.xml', 'views/product_template.xml', @@ -25,5 +25,5 @@ 'demo': [ 'demo/intrastat_demo.xml', ], - 'installable': False, + 'installable': True, } diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index f53d397..181a244 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,6 +1,7 @@ @@ -10,7 +11,7 @@ FR58441019213 - + BE0884025633 True diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 315e3f2..00e44dc 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 11.0\n" +"Project-Id-Version: Odoo Server 12.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: <>\n" "Language-Team: \n" @@ -14,13 +14,13 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:151 +#: code:addons/intrastat_base/models/intrastat_common.py:143 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -36,134 +36,159 @@ msgid "Companies" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:39 +#: code:addons/intrastat_base/models/intrastat_common.py:38 #, python-format msgid "Company not yet set on intrastat report." msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "Config Settings" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid msgid "Created by" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_date msgid "Created on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_display_name +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Currency" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name msgid "Display Name" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_country_intrastat -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model:ir.model.fields,field_description:intrastat_base.field_res_country__intrastat +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "EU Country" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_id +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Group By" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id msgid "ID" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." msgstr "" #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root -#: model:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Intrastat Result View" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,field_description:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost msgid "Is accessory cost" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common___last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view___last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update msgid "Last Modified on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_uid msgid "Last Updated by" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_date msgid "Last Updated on" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_email_list +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/res_company.py:38 +#: code:addons/intrastat_base/models/res_company.py:37 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_note +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Name or Code" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note msgid "Notes" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Ok" msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_result_view +msgid "Pop-up to show errors on intrastat report generation" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "Search Countries" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_country_intrastat +#: model:ir.model.fields,help:intrastat_base.field_res_country__intrastat msgid "Set to True for all European Union countries." msgstr "" @@ -184,42 +209,44 @@ msgid "Templates for Taxes" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:52 +#: code:addons/intrastat_base/models/intrastat_common.py:50 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:43 +#: code:addons/intrastat_base/models/intrastat_common.py:42 #, python-format msgid "The country is not set on the company '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/product_template.py:23 +#: code:addons/intrastat_base/models/product_template.py:22 #, python-format msgid "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'" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:73 +#: model:product.product,uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "Unit(s)" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:71 #, python-format msgid "Unknown Error" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_result_view -msgid "intrastat.result.view" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_config_settings -msgid "res.config.settings" +#: model:product.product,weight_uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,weight_uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "kg" msgstr "" diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index df81523..79f5c72 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,4 +1,4 @@ -# © 2011-2016 Akretion (http://www.akretion.com). +# Copyright 2011-2019 Akretion France (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import models, fields diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 048d5c5..1b9e36a 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -5,6 +5,7 @@ from io import BytesIO from lxml import etree from sys import exc_info +import base64 from traceback import format_exception import logging @@ -19,7 +20,6 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" - @api.multi @api.depends('declaration_line_ids.amount_company_currency') def _compute_numbers(self): for this in self: @@ -31,7 +31,6 @@ class IntrastatCommon(models.AbstractModel): this.num_decl_lines = num_lines this.total_amount = total_amount - @api.multi def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" for this in self: @@ -44,7 +43,6 @@ class IntrastatCommon(models.AbstractModel): % company.name) return True - @api.multi def _check_generate_xml(self): for this in self: if not this.company_id.partner_id.vat: @@ -76,12 +74,10 @@ class IntrastatCommon(models.AbstractModel): logger.warning(error) raise UserError(error) - @api.multi def _attach_xml_file(self, xml_string, declaration_name): '''Attach the XML file to the report_intrastat_product/service object''' self.ensure_one() - import base64 filename = '%s_%s.xml' % (self.year_month, declaration_name) attach = self.env['ir.attachment'].create({ 'name': filename, @@ -91,7 +87,6 @@ class IntrastatCommon(models.AbstractModel): 'datas_fname': filename}) return attach.id - @api.multi def _unlink_attachments(self): atts = self.env['ir.attachment'].search( [('res_model', '=', self._name), @@ -114,7 +109,6 @@ class IntrastatCommon(models.AbstractModel): } return action - @api.multi def _generate_xml(self): """ Inherit this method in the localization module @@ -128,7 +122,6 @@ class IntrastatCommon(models.AbstractModel): """ return False - @api.multi def send_reminder_email(self, mail_template_xmlid): mail_template = self.env.ref(mail_template_xmlid) for this in self: @@ -143,7 +136,6 @@ class IntrastatCommon(models.AbstractModel): 'empty on company %s' % this.company_id.name) return True - @api.multi def unlink(self): for intrastat in self: if intrastat.state == 'done': @@ -158,6 +150,7 @@ class IntrastatResultView(models.TransientModel): Transient Model to display Intrastat Report results """ _name = 'intrastat.result.view' + _description = 'Pop-up to show errors on intrastat report generation' note = fields.Text( string='Notes', readonly=True, diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index bc3f6ca..804aa59 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -14,7 +14,6 @@ class ProductTemplate(models.Model): "costs and all services related to the sale of products. " "This option is used for Intrastat reports.") - @api.multi @api.constrains('type', 'is_accessory_cost') def _check_accessory_cost(self): for this in self: diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index f67bcf5..05c3d15 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,5 @@ -# Copyright 2013-2017 Akretion () +# Copyright 2013-2017 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, _ @@ -17,7 +18,6 @@ class ResCompany(models.Model): compute='_compute_intrastat_email_list', string='List of emails of Users Receiving the Intrastat Reminder') - @api.multi @api.depends( 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') def _compute_intrastat_email_list(self): @@ -28,7 +28,6 @@ class ResCompany(models.Model): emails.append(user.email) this.intrastat_email_list = ','.join(emails) - @api.multi @api.constrains('intrastat_remind_user_ids') def _check_intrastat_remind_users(self): for this in self: diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index 14c62ec..51bec6c 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -9,4 +9,4 @@ class ResConfigSettings(models.TransientModel): _inherit = 'res.config.settings' intrastat_remind_user_ids = fields.Many2many( - related='company_id.intrastat_remind_user_ids') + related='company_id.intrastat_remind_user_ids', readonly=False) diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 3af71f0..74f0685 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,4 +1,5 @@ -# Copyright 2011-2014 Akretion () +# Copyright 2011-2019 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/readme/CONTRIBUTORS.rst b/intrastat_base/readme/CONTRIBUTORS.rst new file mode 100644 index 0000000..6a9e1c1 --- /dev/null +++ b/intrastat_base/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Alexis de Lattre, Akretion +* Luc De Meyer, Noviat +* Kumar Aberer, brain-tec AG +* Andrea Stirpe diff --git a/intrastat_base/readme/DESCRIPTION.rst b/intrastat_base/readme/DESCRIPTION.rst new file mode 100644 index 0000000..179c7eb --- /dev/null +++ b/intrastat_base/readme/DESCRIPTION.rst @@ -0,0 +1,11 @@ +This module contains common functions for the intrastat reporting and +should be used in combination with the generic reporting module +*intrastat_product* and with the country-specific reporting modules such +as: + +- *l10n_fr_intrastat_service*: + the module for the *Déclaration Européenne des Services* (DES) for France +- *l10n_fr_intrastat_product*: + the module for the *Déclaration d'Echange de Biens* (DEB) for France +- *l10n_be_intrastat_product*: + the module for the Intrastat Declaration for Belgium. diff --git a/intrastat_base/readme/INSTALL.rst b/intrastat_base/readme/INSTALL.rst new file mode 100644 index 0000000..2f4f69f --- /dev/null +++ b/intrastat_base/readme/INSTALL.rst @@ -0,0 +1,5 @@ +WARNING: + +This module conflicts with the module *account_intrastat* from Odoo Enterprise. +If you have already installed the module *account_intrastat*, +you should uninstall it first before installing this module. diff --git a/intrastat_base/readme/USAGE.rst b/intrastat_base/readme/USAGE.rst new file mode 100644 index 0000000..32dbe07 --- /dev/null +++ b/intrastat_base/readme/USAGE.rst @@ -0,0 +1,9 @@ +This module adds an intrastat property on countries and activates this property +on the countries of the European Union. + +With this module, the country field on partners becomes a required field. + +It adds an option *Exclude invoice line from intrastat if this tax is present* +on taxes. + +It adds an *Intrastat* section on the *Invoicing* configuration page. diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index a1e72cd..222f71b 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,6 +1,7 @@ diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index cc5a186..3381e0c 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 6440407..fff74e1 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,6 +1,7 @@ diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index f472061..ec5ea7d 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -1,7 +1,8 @@ @@ -21,7 +22,7 @@
+
diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index e9dec05..3ecc2fd 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,6 +1,6 @@ @@ -36,10 +36,14 @@ res.country - + + + domain="[('intrastat', '=', True)]" /> + + + diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 7a9dfeb..5f31add 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,6 +1,6 @@ From d624b45bafd6a18d108144255699e609cfc45993 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 16 Jun 2019 11:04:22 +0000 Subject: [PATCH 26/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-12.0/intrastat-extrastat-12.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-intrastat_base/ [UPD] README.rst [UPD] README.rst --- intrastat_base/README.rst | 79 +++- intrastat_base/i18n/fr.po | 124 +++-- intrastat_base/static/description/index.html | 452 +++++++++++++++++++ 3 files changed, 584 insertions(+), 71 deletions(-) create mode 100644 intrastat_base/static/description/index.html diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 2dece29..777cf4d 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -1,10 +1,29 @@ -.. image:: https://img.shields.io/badge/license-AGPL--3-blue.png - :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html - :alt: License: AGPL-3 +======================== +Intrastat Reporting Base +======================== -============== -Intrastat Base -============== +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github + :target: https://github.com/OCA/intrastat-extrastat/tree/12.0/intrastat_base + :alt: OCA/intrastat-extrastat +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-intrastat_base + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/227/12.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module @@ -18,63 +37,73 @@ as: - *l10n_be_intrastat_product*: the module for the Intrastat Declaration for Belgium. +**Table of contents** + +.. contents:: + :local: Installation ============ WARNING: -This module conflicts with the module *report_intrastat* from the official addons. -If you have already installed the module *report_intrastat*, +This module conflicts with the module *account_intrastat* from Odoo Enterprise. +If you have already installed the module *account_intrastat*, you should uninstall it first before installing this module. Usage ===== This module adds an intrastat property on countries and activates this property -on the 28 countries of the European Union. +on the countries of the European Union. With this module, the country field on partners becomes a required field. It adds an option *Exclude invoice line from intrastat if this tax is present* on taxes. -It adds a tab *Intrastat* on the company form view. - -.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas - :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/227/11.0 +It adds an *Intrastat* section on the *Invoicing* configuration page. Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case -of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and -welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. Credits ======= +Authors +~~~~~~~ + +* Akretion +* Noviat + Contributors ------------- +~~~~~~~~~~~~ * Alexis de Lattre, Akretion * Luc De Meyer, Noviat * Kumar Aberer, brain-tec AG +* Andrea Stirpe -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the OCA. .. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association :target: https://odoo-community.org -This module is maintained by the OCA. - OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -To contribute to this module, please visit https://odoo-community.org. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 7c3aeda..2f074a6 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -17,8 +17,8 @@ msgstr "" "Plural-Forms: \n" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,help:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost msgid "" "Activate this option for shipping costs, packaging costs and all services " "related to the sale of products. This option is used for Intrastat reports." @@ -28,7 +28,7 @@ msgstr "" "la DEB et la DES." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:151 +#: code:addons/intrastat_base/models/intrastat_common.py:143 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -46,54 +46,71 @@ msgid "Companies" msgstr "Sociétés" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:39 +#: code:addons/intrastat_base/models/intrastat_common.py:38 #, python-format msgid "Company not yet set on intrastat report." msgstr "Société non configurée sur le rapport DEB/DES." +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +#, fuzzy +#| msgid "res.config.settings" +msgid "Config Settings" +msgstr "res.config.settings" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_country msgid "Country" msgstr "Pays" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid msgid "Created by" msgstr "Créé par" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_create_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_date msgid "Created on" msgstr "Créé le" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_display_name +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Currency" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name msgid "Display Name" msgstr "Afficher le nom" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_country_intrastat -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model:ir.model.fields,field_description:intrastat_base.field_res_country__intrastat +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "EU Country" msgstr "Membre de l'UE" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "Exclude invoice line from intrastat if this tax is present" msgstr "" "Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common_id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_id +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Group By" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id msgid "ID" msgstr "ID" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_tax_exclude_from_intrastat_if_present -#: model:ir.model.fields,help:intrastat_base.field_account_tax_template_exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax__exclude_from_intrastat_if_present +#: model:ir.model.fields,help:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present msgid "" "If this tax is present on an invoice line, this invoice line will be skipped " "when generating Intrastat Product or Service lines from invoices." @@ -105,83 +122,93 @@ msgstr "" #. module: intrastat_base #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root -#: model:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "DEB/DES" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view msgid "Intrastat Properties" msgstr "Propriétés DEB/DES" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Intrastat Result View" msgstr "Résultat DEB" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_product_product_is_accessory_cost -#: model:ir.model.fields,field_description:intrastat_base.field_product_template_is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost msgid "Is accessory cost" msgstr "Est un frais accessoire" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common___last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view___last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update msgid "Last Modified on" msgstr "Dernière modification le" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_uid +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_uid msgid "Last Updated by" msgstr "Dernière modification par" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_write_date +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_date msgid "Last Updated on" msgstr "Dernière modification le" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,help:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "" "List of Odoo users who will receive a notification to remind them about the " "Intrastat declaration." msgstr "Liste d'utilisateurs Odoo qui recevront un rappel pour la DEB/DES." #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_email_list +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" #. module: intrastat_base -#: code:addons/intrastat_base/models/res_company.py:38 +#: code:addons/intrastat_base/models/res_company.py:37 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view_note +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search +msgid "Name or Code" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note msgid "Notes" msgstr "Notes" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form +#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form msgid "Ok" msgstr "Ok" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_intrastat_result_view +msgid "Pop-up to show errors on intrastat report generation" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "Modèle d'article" #. module: intrastat_base -#: model:ir.ui.view,arch_db:intrastat_base.res_country_view_search +#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search msgid "Search Countries" msgstr "Recherche pays" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_country_intrastat +#: model:ir.model.fields,help:intrastat_base.field_res_country__intrastat msgid "Set to True for all European Union countries." msgstr "Cocher la case pour tous les pays de l'Union Européenne." @@ -202,19 +229,19 @@ msgid "Templates for Taxes" msgstr "Modèles pour les taxes" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:52 +#: code:addons/intrastat_base/models/intrastat_common.py:50 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:43 +#: code:addons/intrastat_base/models/intrastat_common.py:42 #, python-format msgid "The country is not set on the company '%s'." msgstr "Pays non renseigné sur la société '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/models/product_template.py:23 +#: code:addons/intrastat_base/models/product_template.py:22 #, python-format msgid "" "The option 'Is accessory cost?' should only be activated on 'Service' " @@ -226,26 +253,31 @@ msgstr "" "type '%s'" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:73 +#: model:product.product,uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "Unit(s)" +msgstr "" + +#. module: intrastat_base +#: code:addons/intrastat_base/models/intrastat_common.py:71 #, python-format msgid "Unknown Error" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_company_intrastat_remind_user_ids -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings_intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_result_view -msgid "intrastat.result.view" -msgstr "intrastat.result.view" +#: model:product.product,weight_uom_name:intrastat_base.shipping_costs_exclude +#: model:product.template,weight_uom_name:intrastat_base.shipping_costs_exclude_product_template +msgid "kg" +msgstr "" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_config_settings -msgid "res.config.settings" -msgstr "res.config.settings" +#~ msgid "intrastat.result.view" +#~ msgstr "intrastat.result.view" #~ msgid "" #~ "The generated XML file is not valid against the official XML Schema " diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html new file mode 100644 index 0000000..b3e9e21 --- /dev/null +++ b/intrastat_base/static/description/index.html @@ -0,0 +1,452 @@ + + + + + + +Intrastat Reporting Base + + + +
+

Intrastat Reporting Base

+ + +

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

+

This module contains common functions for the intrastat reporting and +should be used in combination with the generic reporting module +intrastat_product and with the country-specific reporting modules such +as:

+
    +
  • l10n_fr_intrastat_service: +the module for the Déclaration Européenne des Services (DES) for France
  • +
  • l10n_fr_intrastat_product: +the module for the Déclaration d’Echange de Biens (DEB) for France
  • +
  • l10n_be_intrastat_product: +the module for the Intrastat Declaration for Belgium.
  • +
+

Table of contents

+ +
+

Installation

+

WARNING:

+

This module conflicts with the module account_intrastat from Odoo Enterprise. +If you have already installed the module account_intrastat, +you should uninstall it first before installing this module.

+
+
+

Usage

+

This module adds an intrastat property on countries and activates this property +on the countries of the European Union.

+

With this module, the country field on partners becomes a required field.

+

It adds an option Exclude invoice line from intrastat if this tax is present +on taxes.

+

It adds an Intrastat section on the Invoicing configuration page.

+
+
+

Bug Tracker

+

Bugs are tracked on GitHub Issues. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • Akretion
  • +
  • Noviat
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use.

+

This module is part of the OCA/intrastat-extrastat project on GitHub.

+

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

+
+
+
+ + From 54912ec352e2edaa1da6c2d8b73e65f3e50e6cd3 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 14 Jan 2020 18:15:30 +0100 Subject: [PATCH 27/90] [MIG] intrastat_base: Migration to 13.0 --- intrastat_base/__manifest__.py | 4 ++-- intrastat_base/demo/intrastat_demo.xml | 1 - intrastat_base/views/res_config_settings.xml | 2 +- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 0113306..15ef179 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,11 +1,11 @@ # Copyright 2011-2016 Akretion (http://www.akretion.com) # Copyright 2018 brain-tec AG (Kumar Aberer ) -# Copyright 2009-2019 Noviat (http://www.noviat.com) +# Copyright 2009-2020 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { 'name': 'Intrastat Reporting Base', - 'version': '12.0.1.0.0', + 'version': '13.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 181a244..d5354c1 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -13,7 +13,6 @@ BE0884025633 - True diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index ec5ea7d..c62345e 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -13,7 +13,7 @@ res.config.settings - +

Intrastat

From e03ed434cf4619c5df862ebb8cb32d519268b9a9 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 14 Jan 2020 18:47:50 +0100 Subject: [PATCH 28/90] pre-commit --- intrastat_base/__manifest__.py | 40 ++++--- intrastat_base/models/account_tax.py | 12 +- intrastat_base/models/intrastat_common.py | 109 ++++++++++--------- intrastat_base/models/product_template.py | 20 ++-- intrastat_base/models/res_company.py | 25 +++-- intrastat_base/models/res_config_settings.py | 5 +- intrastat_base/models/res_country.py | 6 +- intrastat_base/tests/test_all.py | 12 +- 8 files changed, 121 insertions(+), 108 deletions(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 15ef179..3615941 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -4,26 +4,24 @@ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { - 'name': 'Intrastat Reporting Base', - 'version': '13.0.1.0.0', - 'category': 'Intrastat', - 'license': 'AGPL-3', - 'summary': 'Base module for Intrastat reporting', - 'author': 'Akretion,Noviat,Odoo Community Association (OCA)', - 'website': 'https://github.com/OCA/intrastat', - 'depends': ['base_vat', 'account'], - 'excludes': ['account_intrastat'], - 'data': [ - 'data/country_data.xml', - 'views/product_template.xml', - 'views/res_partner.xml', - 'views/res_country.xml', - 'views/account_tax.xml', - 'views/res_config_settings.xml', - 'views/intrastat.xml', + "name": "Intrastat Reporting Base", + "version": "13.0.1.0.0", + "category": "Intrastat", + "license": "AGPL-3", + "summary": "Base module for Intrastat reporting", + "author": "Akretion,Noviat,Odoo Community Association (OCA)", + "website": "https://github.com/OCA/intrastat", + "depends": ["base_vat", "account"], + "excludes": ["account_intrastat"], + "data": [ + "data/country_data.xml", + "views/product_template.xml", + "views/res_partner.xml", + "views/res_country.xml", + "views/account_tax.xml", + "views/res_config_settings.xml", + "views/intrastat.xml", ], - 'demo': [ - 'demo/intrastat_demo.xml', - ], - 'installable': True, + "demo": ["demo/intrastat_demo.xml"], + "installable": True, } diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index 79f5c72..35966a7 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,24 +1,26 @@ # Copyright 2011-2019 Akretion France (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import models, fields +from odoo import fields, models class AccountTax(models.Model): _inherit = "account.tax" exclude_from_intrastat_if_present = fields.Boolean( - string='Exclude invoice line from intrastat if this tax is present', + string="Exclude invoice line from intrastat if this tax is present", help="If this tax is present on an invoice line, this invoice " "line will be skipped when generating Intrastat Product or " - "Service lines from invoices.") + "Service lines from invoices.", + ) class AccountTaxTemplate(models.Model): _inherit = "account.tax.template" exclude_from_intrastat_if_present = fields.Boolean( - string='Exclude invoice line from intrastat if this tax is present', + string="Exclude invoice line from intrastat if this tax is present", help="If this tax is present on an invoice line, this invoice " "line will be skipped when generating Intrastat Product or " - "Service lines from invoices.") + "Service lines from invoices.", + ) diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 1b9e36a..2fe12ce 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -2,14 +2,15 @@ # Copyright 2009-2019 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from io import BytesIO -from lxml import etree -from sys import exc_info import base64 -from traceback import format_exception import logging +from io import BytesIO +from sys import exc_info +from traceback import format_exception -from odoo import api, fields, models, tools, _ +from lxml import etree + +from odoo import _, api, fields, models, tools from odoo.exceptions import UserError logger = logging.getLogger(__name__) @@ -20,7 +21,7 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" - @api.depends('declaration_line_ids.amount_company_currency') + @api.depends("declaration_line_ids.amount_company_currency") def _compute_numbers(self): for this in self: total_amount = 0 # it is an integer @@ -39,8 +40,8 @@ class IntrastatCommon(models.AbstractModel): company = this.company_id if not company.country_id: raise UserError( - _("The country is not set on the company '%s'.") - % company.name) + _("The country is not set on the company '%s'.") % company.name + ) return True def _check_generate_xml(self): @@ -48,64 +49,66 @@ class IntrastatCommon(models.AbstractModel): if not this.company_id.partner_id.vat: raise UserError( _("The VAT number is not set for the partner '%s'.") - % this.company_id.partner_id.name) + % this.company_id.partner_id.name + ) return True @api.model def _check_xml_schema(self, xml_string, xsd_file): - '''Validate the XML file against the XSD''' - xsd_etree_obj = etree.parse( - tools.file_open(xsd_file, mode='rb')) + """Validate the XML file against the XSD""" + xsd_etree_obj = etree.parse(tools.file_open(xsd_file, mode="rb")) official_schema = etree.XMLSchema(xsd_etree_obj) try: t = etree.parse(BytesIO(xml_string)) official_schema.assertValid(t) except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e: - logger.warning( - "The XML file is invalid against the XML Schema Definition") + logger.warning("The XML file is invalid against the XML Schema Definition") logger.warning(xml_string) logger.warning(e) - usererror = '%s\n\n%s' % (e.__class__.__name__, str(e)) + usererror = "{}\n\n{}".format(e.__class__.__name__, str(e)) raise UserError(usererror) except Exception: error = _("Unknown Error") - tb = ''.join(format_exception(*exc_info())) - error += '\n%s' % tb + tb = "".join(format_exception(*exc_info())) + error += "\n%s" % tb logger.warning(error) raise UserError(error) def _attach_xml_file(self, xml_string, declaration_name): - '''Attach the XML file to the report_intrastat_product/service - object''' + """Attach the XML file to the report_intrastat_product/service + object""" self.ensure_one() - filename = '%s_%s.xml' % (self.year_month, declaration_name) - attach = self.env['ir.attachment'].create({ - 'name': filename, - 'res_id': self.id, - 'res_model': self._name, - 'datas': base64.encodestring(xml_string), - 'datas_fname': filename}) + filename = "{}_{}.xml".format(self.year_month, declaration_name) + attach = self.env["ir.attachment"].create( + { + "name": filename, + "res_id": self.id, + "res_model": self._name, + "datas": base64.encodestring(xml_string), + "datas_fname": filename, + } + ) return attach.id def _unlink_attachments(self): - atts = self.env['ir.attachment'].search( - [('res_model', '=', self._name), - ('res_id', '=', self.id)]) + atts = self.env["ir.attachment"].search( + [("res_model", "=", self._name), ("res_id", "=", self.id)] + ) atts.unlink() @api.model - def _open_attach_view(self, attach_id, title='XML file'): - '''Returns an action which opens the form view of the - corresponding attachement''' + def _open_attach_view(self, attach_id, title="XML file"): + """Returns an action which opens the form view of the + corresponding attachement""" action = { - 'name': title, - 'view_type': 'form', - 'view_mode': 'form', - 'res_model': 'ir.attachment', - 'type': 'ir.actions.act_window', - 'nodestroy': True, - 'target': 'current', - 'res_id': attach_id, + "name": title, + "view_type": "form", + "view_mode": "form", + "res_model": "ir.attachment", + "type": "ir.actions.act_window", + "nodestroy": True, + "target": "current", + "res_id": attach_id, } return action @@ -128,20 +131,23 @@ class IntrastatCommon(models.AbstractModel): if this.company_id.intrastat_remind_user_ids: mail_template.send_mail(this.id) logger.info( - 'Intrastat Reminder email has been sent (XMLID: %s).' - % mail_template_xmlid) + "Intrastat Reminder email has been sent (XMLID: %s)." + % mail_template_xmlid + ) else: logger.warning( - 'The list of users receiving the Intrastat Reminder is ' - 'empty on company %s' % this.company_id.name) + "The list of users receiving the Intrastat Reminder is " + "empty on company %s" % this.company_id.name + ) return True def unlink(self): for intrastat in self: - if intrastat.state == 'done': + if intrastat.state == "done": raise UserError( - _('Cannot delete the declaration %s ' - 'because it is in Done state') % self.year_month) + _("Cannot delete the declaration %s " "because it is in Done state") + % self.year_month + ) return super(IntrastatCommon, self).unlink() @@ -149,9 +155,10 @@ class IntrastatResultView(models.TransientModel): """ Transient Model to display Intrastat Report results """ - _name = 'intrastat.result.view' - _description = 'Pop-up to show errors on intrastat report generation' + + _name = "intrastat.result.view" + _description = "Pop-up to show errors on intrastat report generation" note = fields.Text( - string='Notes', readonly=True, - default=lambda self: self._context.get('note')) + string="Notes", readonly=True, default=lambda self: self._context.get("note") + ) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index 804aa59..d5cb3b4 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,7 +1,7 @@ # Copyright 2010-2016 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -9,18 +9,22 @@ class ProductTemplate(models.Model): _inherit = "product.template" is_accessory_cost = fields.Boolean( - string='Is accessory cost', + 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.") + "This option is used for Intrastat reports.", + ) - @api.constrains('type', 'is_accessory_cost') + @api.constrains("type", "is_accessory_cost") def _check_accessory_cost(self): for this in self: - if this.is_accessory_cost and this.type != 'service': + if this.is_accessory_cost and this.type != "service": raise ValidationError( - _("The option 'Is accessory cost?' should only be " + _( + "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.name, this.type)) + "'%s'" + ) + % (this.name, this.type) + ) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 05c3d15..63a0936 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -2,7 +2,7 @@ # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import api, fields, models, _ +from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -10,29 +10,32 @@ class ResCompany(models.Model): _inherit = "res.company" intrastat_remind_user_ids = fields.Many2many( - 'res.users', column1='company_id', column2='user_id', + "res.users", + column1="company_id", + column2="user_id", string="Users Receiving the Intrastat Reminder", help="List of Odoo users who will receive a notification to " - "remind them about the Intrastat declaration.") + "remind them about the Intrastat declaration.", + ) intrastat_email_list = fields.Char( - compute='_compute_intrastat_email_list', - string='List of emails of Users Receiving the Intrastat Reminder') + compute="_compute_intrastat_email_list", + string="List of emails of Users Receiving the Intrastat Reminder", + ) - @api.depends( - 'intrastat_remind_user_ids', 'intrastat_remind_user_ids.email') + @api.depends("intrastat_remind_user_ids", "intrastat_remind_user_ids.email") def _compute_intrastat_email_list(self): for this in self: emails = [] for user in this.intrastat_remind_user_ids: if user.email: emails.append(user.email) - this.intrastat_email_list = ','.join(emails) + this.intrastat_email_list = ",".join(emails) - @api.constrains('intrastat_remind_user_ids') + @api.constrains("intrastat_remind_user_ids") def _check_intrastat_remind_users(self): for this in self: for user in this.intrastat_remind_user_ids: if not user.email: raise ValidationError( - _("Missing e-mail address on user '%s'.") % - (user.name)) + _("Missing e-mail address on user '%s'.") % (user.name) + ) diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index 51bec6c..c208d79 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -6,7 +6,8 @@ from odoo import fields, models class ResConfigSettings(models.TransientModel): - _inherit = 'res.config.settings' + _inherit = "res.config.settings" intrastat_remind_user_ids = fields.Many2many( - related='company_id.intrastat_remind_user_ids', readonly=False) + related="company_id.intrastat_remind_user_ids", readonly=False + ) diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index 74f0685..cbf2482 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -6,8 +6,8 @@ from odoo import fields, models class ResCountry(models.Model): - _inherit = 'res.country' + _inherit = "res.country" intrastat = fields.Boolean( - string='EU Country', - help="Set to True for all European Union countries.") + string="EU Country", help="Set to True for all European Union countries." + ) diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index fbc91ac..18d64d4 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -6,17 +6,15 @@ class TestIntrastatBase(TransactionCase): def test_10_countries(self): # check if only EU countries have the 'intrastat' bit set - france = self.env.ref('base.fr') + france = self.env.ref("base.fr") self.assertTrue(france.intrastat) - brazil = self.env.ref('base.br') + brazil = self.env.ref("base.br") self.assertFalse(brazil.intrastat) def test_20_company(self): # add 'Demo user' to intrastat_remind_user_ids - demo_user = self.env.ref('base.user_demo') - demo_company = self.env.ref('base.main_company') - demo_company.write({ - 'intrastat_remind_user_ids': [(6, False, [demo_user.id])] - }) + demo_user = self.env.ref("base.user_demo") + demo_company = self.env.ref("base.main_company") + demo_company.write({"intrastat_remind_user_ids": [(6, False, [demo_user.id])]}) # then check if intrastat_email_list contains the email of the user self.assertEquals(demo_company.intrastat_email_list, demo_user.email) From 9f6c1d7f4e8efb7e67a42335031ad4aa47db0ef5 Mon Sep 17 00:00:00 2001 From: oca-travis Date: Fri, 17 Jan 2020 14:14:27 +0000 Subject: [PATCH 29/90] [UPD] Update intrastat_base.pot --- intrastat_base/i18n/intrastat_base.pot | 46 ++++++++++++++------------ 1 file changed, 24 insertions(+), 22 deletions(-) diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 00e44dc..40d82d2 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -1,12 +1,12 @@ # Translation of Odoo Server. # This file contains the translation of the following modules: -# * intrastat_base +# * intrastat_base # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 12.0\n" +"Project-Id-Version: Odoo Server 13.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: <>\n" +"Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" @@ -16,11 +16,13 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost -msgid "Activate this option for shipping costs, packaging costs and all services related to the sale of products. This option is used for Intrastat reports." +msgid "" +"Activate this option for shipping costs, packaging costs and all services " +"related to the sale of products. This option is used for Intrastat reports." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:143 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -36,7 +38,7 @@ msgid "Companies" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:38 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Company not yet set on intrastat report." msgstr "" @@ -98,7 +100,9 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_tax__exclude_from_intrastat_if_present #: model:ir.model.fields,help:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present -msgid "If this tax is present on an invoice line, this invoice line will be skipped when generating Intrastat Product or Service lines from invoices." +msgid "" +"If this tax is present on an invoice line, this invoice line will be skipped" +" when generating Intrastat Product or Service lines from invoices." msgstr "" #. module: intrastat_base @@ -143,7 +147,9 @@ msgstr "" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids #: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids -msgid "List of Odoo users who will receive a notification to remind them about the Intrastat declaration." +msgid "" +"List of Odoo users who will receive a notification to remind them about the " +"Intrastat declaration." msgstr "" #. module: intrastat_base @@ -152,7 +158,7 @@ msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/res_company.py:37 +#: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" @@ -209,31 +215,34 @@ msgid "Templates for Taxes" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:50 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:42 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "The country is not set on the company '%s'." msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/product_template.py:22 +#: code:addons/intrastat_base/models/product_template.py:0 #, python-format -msgid "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'" +msgid "" +"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'" msgstr "" #. module: intrastat_base #: model:product.product,uom_name:intrastat_base.shipping_costs_exclude #: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "Unit(s)" +msgid "Units" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:71 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Unknown Error" msgstr "" @@ -243,10 +252,3 @@ msgstr "" #: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "" - -#. module: intrastat_base -#: model:product.product,weight_uom_name:intrastat_base.shipping_costs_exclude -#: model:product.template,weight_uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "kg" -msgstr "" - From 21acd084acc11d13aacab71ec115d2f7ef48c3c2 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 17 Jan 2020 14:19:50 +0000 Subject: [PATCH 30/90] [UPD] README.rst --- intrastat_base/README.rst | 10 +++++----- intrastat_base/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 777cf4d..5c8888f 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -14,13 +14,13 @@ Intrastat Reporting Base :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/12.0/intrastat_base + :target: https://github.com/OCA/intrastat-extrastat/tree/13.0/intrastat_base :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-12-0/intrastat-extrastat-12-0-intrastat_base + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-13-0/intrastat-extrastat-13-0-intrastat_base :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/12.0 + :target: https://runbot.odoo-community.org/runbot/227/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -70,7 +70,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,6 +104,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html index b3e9e21..b12b2e2 100644 --- a/intrastat_base/static/description/index.html +++ b/intrastat_base/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module intrastat_product and with the country-specific reporting modules such @@ -415,7 +415,7 @@ on taxes.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -443,7 +443,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/intrastat-extrastat project on GitHub.

+

This module is part of the OCA/intrastat-extrastat project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From e06445b29bf12e1b8f35fdf473a73dedc45ff66d Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Fri, 31 Jan 2020 17:47:46 +0000 Subject: [PATCH 31/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-13.0/intrastat-extrastat-13.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-13-0/intrastat-extrastat-13-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 2f074a6..73707c0 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -28,7 +28,7 @@ msgstr "" "la DEB et la DES." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:143 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Cannot delete the declaration %s because it is in Done state" msgstr "" @@ -46,7 +46,7 @@ msgid "Companies" msgstr "Sociétés" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:38 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Company not yet set on intrastat report." msgstr "Société non configurée sur le rapport DEB/DES." @@ -172,7 +172,7 @@ msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" #. module: intrastat_base -#: code:addons/intrastat_base/models/res_company.py:37 +#: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." @@ -229,19 +229,19 @@ msgid "Templates for Taxes" msgstr "Modèles pour les taxes" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:50 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "The VAT number is not set for the partner '%s'." msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:42 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "The country is not set on the company '%s'." msgstr "Pays non renseigné sur la société '%s'." #. module: intrastat_base -#: code:addons/intrastat_base/models/product_template.py:22 +#: code:addons/intrastat_base/models/product_template.py:0 #, python-format msgid "" "The option 'Is accessory cost?' should only be activated on 'Service' " @@ -255,11 +255,11 @@ msgstr "" #. module: intrastat_base #: model:product.product,uom_name:intrastat_base.shipping_costs_exclude #: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "Unit(s)" +msgid "Units" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:71 +#: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Unknown Error" msgstr "" @@ -270,12 +270,6 @@ msgstr "" msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" -#. module: intrastat_base -#: model:product.product,weight_uom_name:intrastat_base.shipping_costs_exclude -#: model:product.template,weight_uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "kg" -msgstr "" - #~ msgid "intrastat.result.view" #~ msgstr "intrastat.result.view" From 28dfcf1f2dfaf10550b76113b350384b2cf6458a Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Wed, 26 Feb 2020 22:16:50 +0100 Subject: [PATCH 32/90] [MIG] intrastat_product: Migration to 13.0 --- intrastat_base/demo/intrastat_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index d5354c1..f8adbb7 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -17,7 +17,7 @@ Shipping costs - SHIP + SHIP_S service 30 From 90af063d4dc6846c25cd707931f14cc19fcde015 Mon Sep 17 00:00:00 2001 From: Luc De Meyer Date: Tue, 3 Mar 2020 20:54:13 +0100 Subject: [PATCH 33/90] [13.0][FIX]attach_xml_file --- intrastat_base/models/intrastat_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 2fe12ce..00ac4b1 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -85,7 +85,7 @@ class IntrastatCommon(models.AbstractModel): "res_id": self.id, "res_model": self._name, "datas": base64.encodestring(xml_string), - "datas_fname": filename, + "store_fname": filename, } ) return attach.id From a5079a17496641bdc4fd6c803fe89a0cbfcf9e34 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Tue, 3 Mar 2020 20:25:45 +0000 Subject: [PATCH 34/90] intrastat_base 13.0.1.1.0 --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 3615941..ec74e37 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Intrastat Reporting Base", - "version": "13.0.1.0.0", + "version": "13.0.1.1.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", From 8d46ff9472dc6f1842beb3f0fe040faeb9eb435f Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 14 Mar 2020 12:01:50 +0100 Subject: [PATCH 35/90] pre-commit update --- intrastat_base/data/country_data.xml | 60 ++++++------- intrastat_base/demo/intrastat_demo.xml | 36 ++++---- intrastat_base/views/account_tax.xml | 25 +++--- intrastat_base/views/intrastat.xml | 48 +++++----- intrastat_base/views/product_template.xml | 37 ++++---- intrastat_base/views/res_config_settings.xml | 20 +++-- intrastat_base/views/res_country.xml | 92 ++++++++++---------- intrastat_base/views/res_partner.xml | 35 ++++---- 8 files changed, 174 insertions(+), 179 deletions(-) diff --git a/intrastat_base/data/country_data.xml b/intrastat_base/data/country_data.xml index 3c75a3a..cb950e6 100644 --- a/intrastat_base/data/country_data.xml +++ b/intrastat_base/data/country_data.xml @@ -1,89 +1,87 @@ - + - - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index f8adbb7..5a93379 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,27 +1,23 @@ - + - - - - FR58441019213 - - - - BE0884025633 - - - - Shipping costs - SHIP_S - service - - 30 - True - - + + FR58441019213 + + + + BE0884025633 + + + Shipping costs + SHIP_S + service + + 30 + True + diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index 222f71b..0479a6f 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,22 +1,19 @@ - + - - - - - intrastat.base.tax - account.tax - - - - + + + intrastat.base.tax + account.tax + + + + + - - - + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 3381e0c..92bfba2 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,33 +1,35 @@ - + - - - - - - + + - intrastat.result_view_form - intrastat.result.view - -
- - - -
-
-
-
+ intrastat.result_view_form + intrastat.result.view + +
+ + + +
+
+
+
-
diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index fff74e1..4dc5b90 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,29 +1,26 @@ - + - - - - - intrastat.base.product.template.form - product.template - - - - - - + + - - - - - +
+
diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index c62345e..3c1340b 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -1,27 +1,31 @@ - + - - intrastat.res.config.settings.form res.config.settings - +

Intrastat

-
+
-
@@ -29,6 +33,4 @@ - - diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index 3ecc2fd..c0e1626 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,52 +1,56 @@ - + - - - - - - intrastat.base.country.tree - res.country - - - - + + + intrastat.base.country.tree + res.country + + + + + - - - - - intrastat.base.country.form - res.country - - - - + + + intrastat.base.country.form + res.country + + + + + - - - - - - intrastat.base.country.search - res.country - - - - - - - - - - - - - - + + + + intrastat.base.country.search + res.country + + + + + + + + + + + + diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 5f31add..8c2f652 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,25 +1,24 @@ - + - - - - - res.partner - - - - 1 - - - 1 - - - - + + + res.partner + + + + 1 + + + 1 + + + From e32f7a740049c1820afa2835c727f8dc0505b52b Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Mon, 8 Jun 2020 22:39:46 +0200 Subject: [PATCH 36/90] intrastat_product: Add xml_attachment_id field intrastat_product: add mail.activity.mixin and widget in form view product_harmonized_system: remove archive button (use Action menu) All modules: - use super() instead of super(class, self) - Update domain_force in multi-company ir.rule to v13 standard --- intrastat_base/models/intrastat_common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 00ac4b1..45ad7c6 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -148,7 +148,7 @@ class IntrastatCommon(models.AbstractModel): _("Cannot delete the declaration %s " "because it is in Done state") % self.year_month ) - return super(IntrastatCommon, self).unlink() + return super().unlink() class IntrastatResultView(models.TransientModel): From 5a8fa55b39921291b59097a66385ab6fbe31b18a Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 16 Aug 2020 11:27:26 +0000 Subject: [PATCH 37/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-13.0/intrastat-extrastat-13.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-13-0/intrastat-extrastat-13-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 1 - 1 file changed, 1 deletion(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 73707c0..c95b44d 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -54,7 +54,6 @@ msgstr "Société non configurée sur le rapport DEB/DES." #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_config_settings #, fuzzy -#| msgid "res.config.settings" msgid "Config Settings" msgstr "res.config.settings" From 71dd29854a24884118ad99846a4ce27c3e395ef4 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 14 Oct 2020 22:19:30 +0200 Subject: [PATCH 38/90] [MIG] intrastat_base from v13 to v14 Up-port PR #98 --- intrastat_base/__manifest__.py | 7 ++++--- intrastat_base/demo/intrastat_demo.xml | 4 ++-- intrastat_base/models/account_tax.py | 2 +- intrastat_base/models/intrastat_common.py | 5 ++--- intrastat_base/models/product_template.py | 4 ++-- intrastat_base/models/res_company.py | 5 +++-- intrastat_base/models/res_config_settings.py | 5 +++-- intrastat_base/models/res_country.py | 2 +- intrastat_base/security/ir.model.access.csv | 2 ++ intrastat_base/tests/test_all.py | 2 +- intrastat_base/views/account_tax.xml | 7 +++---- intrastat_base/views/intrastat.xml | 6 +++--- intrastat_base/views/product_template.xml | 6 +++--- intrastat_base/views/res_config_settings.xml | 4 ++-- intrastat_base/views/res_country.xml | 3 ++- intrastat_base/views/res_partner.xml | 2 +- 16 files changed, 35 insertions(+), 31 deletions(-) create mode 100644 intrastat_base/security/ir.model.access.csv diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index ec74e37..4d0f6d2 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -1,11 +1,11 @@ -# Copyright 2011-2016 Akretion (http://www.akretion.com) -# Copyright 2018 brain-tec AG (Kumar Aberer ) +# Copyright 2011-2020 Akretion (http://www.akretion.com) +# Copyright 2018-2020 brain-tec AG (Kumar Aberer ) # Copyright 2009-2020 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). { "name": "Intrastat Reporting Base", - "version": "13.0.1.1.0", + "version": "14.0.1.0.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", @@ -14,6 +14,7 @@ "depends": ["base_vat", "account"], "excludes": ["account_intrastat"], "data": [ + "security/ir.model.access.csv", "data/country_data.xml", "views/product_template.xml", "views/res_partner.xml", diff --git a/intrastat_base/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml index 5a93379..6e6cd90 100644 --- a/intrastat_base/demo/intrastat_demo.xml +++ b/intrastat_base/demo/intrastat_demo.xml @@ -1,6 +1,6 @@ @@ -18,6 +18,6 @@ service 30 - True + diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py index 35966a7..ebe693b 100644 --- a/intrastat_base/models/account_tax.py +++ b/intrastat_base/models/account_tax.py @@ -1,4 +1,4 @@ -# Copyright 2011-2019 Akretion France (http://www.akretion.com). +# Copyright 2011-2020 Akretion France (http://www.akretion.com). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import fields, models diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 45ad7c6..057cc8b 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -1,5 +1,5 @@ -# Copyright 2010-2016 Akretion () -# Copyright 2009-2019 Noviat (http://www.noviat.com) +# Copyright 2010-2020 Akretion () +# Copyright 2009-2020 Noviat (http://www.noviat.com) # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import base64 @@ -102,7 +102,6 @@ class IntrastatCommon(models.AbstractModel): corresponding attachement""" action = { "name": title, - "view_type": "form", "view_mode": "form", "res_model": "ir.attachment", "type": "ir.actions.act_window", diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index d5cb3b4..d63656c 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -1,4 +1,4 @@ -# Copyright 2010-2016 Akretion () +# Copyright 2010-2020 Akretion () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). from odoo import _, api, fields, models @@ -26,5 +26,5 @@ class ProductTemplate(models.Model): "this option for the product '%s' which is of type " "'%s'" ) - % (this.name, this.type) + % (this.display_name, this.type) ) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index 63a0936..eefce32 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -1,4 +1,4 @@ -# Copyright 2013-2017 Akretion France (http://www.akretion.com/) +# Copyright 2013-2020 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). @@ -10,7 +10,8 @@ class ResCompany(models.Model): _inherit = "res.company" intrastat_remind_user_ids = fields.Many2many( - "res.users", + comodel_name="res.users", + relation="company_intrastat_reminder_user_rel", column1="company_id", column2="user_id", string="Users Receiving the Intrastat Reminder", diff --git a/intrastat_base/models/res_config_settings.py b/intrastat_base/models/res_config_settings.py index c208d79..25e1b37 100644 --- a/intrastat_base/models/res_config_settings.py +++ b/intrastat_base/models/res_config_settings.py @@ -1,5 +1,6 @@ -# Copyright 2017 Akretion (Alexis de Lattre ) -# Copyright 2018 brain-tec AG (Kumar Aberer ) +# Copyright 2017-2020 Akretion France (http://www.akretion.com/) +# Copyright 2018-2020 brain-tec AG (Kumar Aberer ) +# @author: Alexis de Lattre # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). from odoo import fields, models diff --git a/intrastat_base/models/res_country.py b/intrastat_base/models/res_country.py index cbf2482..10743b7 100644 --- a/intrastat_base/models/res_country.py +++ b/intrastat_base/models/res_country.py @@ -1,4 +1,4 @@ -# Copyright 2011-2019 Akretion France (http://www.akretion.com/) +# Copyright 2011-2020 Akretion France (http://www.akretion.com/) # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). diff --git a/intrastat_base/security/ir.model.access.csv b/intrastat_base/security/ir.model.access.csv new file mode 100644 index 0000000..fbe710c --- /dev/null +++ b/intrastat_base/security/ir.model.access.csv @@ -0,0 +1,2 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_intrastat_result_view,Access on intrastat.result.view,model_intrastat_result_view,account.group_account_user,1,1,1,0 diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index 18d64d4..62b1787 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -17,4 +17,4 @@ class TestIntrastatBase(TransactionCase): demo_company = self.env.ref("base.main_company") demo_company.write({"intrastat_remind_user_ids": [(6, False, [demo_user.id])]}) # then check if intrastat_email_list contains the email of the user - self.assertEquals(demo_company.intrastat_email_list, demo_user.email) + self.assertEqual(demo_company.intrastat_email_list, demo_user.email) diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml index 0479a6f..a135bb5 100644 --- a/intrastat_base/views/account_tax.xml +++ b/intrastat_base/views/account_tax.xml @@ -1,19 +1,18 @@ - intrastat.base.tax account.tax - + - + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index 92bfba2..ca14bae 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -1,7 +1,7 @@ @@ -27,7 +27,7 @@
-
diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml index 4dc5b90..4854cdd 100644 --- a/intrastat_base/views/product_template.xml +++ b/intrastat_base/views/product_template.xml @@ -1,6 +1,6 @@ @@ -11,9 +11,9 @@ - + + localisation module to set invisible="0" --> diff --git a/intrastat_base/views/res_country.xml b/intrastat_base/views/res_country.xml index c0e1626..5ce3edb 100644 --- a/intrastat_base/views/res_country.xml +++ b/intrastat_base/views/res_country.xml @@ -1,6 +1,7 @@ diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml index 8c2f652..3b1d193 100644 --- a/intrastat_base/views/res_partner.xml +++ b/intrastat_base/views/res_partner.xml @@ -1,6 +1,6 @@ From 0b984f61fa378b76525cc7be841f24d593231bc0 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 15 Oct 2020 00:51:36 +0200 Subject: [PATCH 39/90] intrastat_base: remove methods in intrastat.common that are not useful any more Rename variables to avoid misunderstanding between string and bytes --- intrastat_base/models/intrastat_common.py | 43 +++++++---------------- 1 file changed, 13 insertions(+), 30 deletions(-) diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 057cc8b..a78ae4d 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -21,16 +21,10 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" - @api.depends("declaration_line_ids.amount_company_currency") - def _compute_numbers(self): - for this in self: - total_amount = 0 # it is an integer - num_lines = 0 - for line in this.declaration_line_ids: - total_amount += line.amount_company_currency - num_lines += 1 - this.num_decl_lines = num_lines - this.total_amount = total_amount + # The method _compute_numbers has been removed + # because it was using a loop on lines, which is slow -> we should + # use read_group() instead, but then the code depends on + # the line object, so it can't be factorized here def _check_generate_lines(self): """Check wether all requirements are met for generating lines.""" @@ -54,16 +48,16 @@ class IntrastatCommon(models.AbstractModel): return True @api.model - def _check_xml_schema(self, xml_string, xsd_file): + def _check_xml_schema(self, xml_bytes, xsd_file): """Validate the XML file against the XSD""" xsd_etree_obj = etree.parse(tools.file_open(xsd_file, mode="rb")) official_schema = etree.XMLSchema(xsd_etree_obj) try: - t = etree.parse(BytesIO(xml_string)) + t = etree.parse(BytesIO(xml_bytes)) official_schema.assertValid(t) except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e: logger.warning("The XML file is invalid against the XML Schema Definition") - logger.warning(xml_string) + logger.warning(xml_bytes) logger.warning(e) usererror = "{}\n\n{}".format(e.__class__.__name__, str(e)) raise UserError(usererror) @@ -74,7 +68,7 @@ class IntrastatCommon(models.AbstractModel): logger.warning(error) raise UserError(error) - def _attach_xml_file(self, xml_string, declaration_name): + def _attach_xml_file(self, xml_bytes, declaration_name): """Attach the XML file to the report_intrastat_product/service object""" self.ensure_one() @@ -84,8 +78,7 @@ class IntrastatCommon(models.AbstractModel): "name": filename, "res_id": self.id, "res_model": self._name, - "datas": base64.encodestring(xml_string), - "store_fname": filename, + "datas": base64.encodebytes(xml_bytes), } ) return attach.id @@ -96,20 +89,10 @@ class IntrastatCommon(models.AbstractModel): ) atts.unlink() - @api.model - def _open_attach_view(self, attach_id, title="XML file"): - """Returns an action which opens the form view of the - corresponding attachement""" - action = { - "name": title, - "view_mode": "form", - "res_model": "ir.attachment", - "type": "ir.actions.act_window", - "nodestroy": True, - "target": "current", - "res_id": attach_id, - } - return action + # Method _open_attach_view() removed + # Let's handle attachments like in l10n_fr_intrastat_service v14 + # with the field attachment_id on the declaration and the download + # link directly on the form view of the declaration. def _generate_xml(self): """ From 336e6692f82312ee190e6048883df476fda3320c Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Thu, 19 Nov 2020 16:45:00 +0000 Subject: [PATCH 40/90] [UPD] README.rst --- intrastat_base/README.rst | 10 +++++----- intrastat_base/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 5c8888f..c36da45 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -14,13 +14,13 @@ Intrastat Reporting Base :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/13.0/intrastat_base + :target: https://github.com/OCA/intrastat-extrastat/tree/14.0/intrastat_base :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-13-0/intrastat-extrastat-13-0-intrastat_base + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-intrastat_base :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/13.0 + :target: https://runbot.odoo-community.org/runbot/227/14.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -70,7 +70,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -104,6 +104,6 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html index b12b2e2..a3d9873 100644 --- a/intrastat_base/static/description/index.html +++ b/intrastat_base/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module intrastat_product and with the country-specific reporting modules such @@ -415,7 +415,7 @@ on taxes.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -443,7 +443,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

-

This module is part of the OCA/intrastat-extrastat project on GitHub.

+

This module is part of the OCA/intrastat-extrastat project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

From 2794b4e643dacfbf7c1b3aa4ac32b0cffb6959ed Mon Sep 17 00:00:00 2001 From: oca-git-bot Date: Fri, 11 Dec 2020 19:45:30 +0100 Subject: [PATCH 41/90] [IMP] update dotfiles [ci skip] --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 4d0f6d2..84fb29b 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -10,7 +10,7 @@ "license": "AGPL-3", "summary": "Base module for Intrastat reporting", "author": "Akretion,Noviat,Odoo Community Association (OCA)", - "website": "https://github.com/OCA/intrastat", + "website": "https://github.com/OCA/intrastat-extrastat", "depends": ["base_vat", "account"], "excludes": ["account_intrastat"], "data": [ From 6ee28d32fcaa99681465b12b8cc86816c48075b1 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 5 Jan 2021 16:16:36 +0100 Subject: [PATCH 42/90] intrastat_base: use fiscal position, following suggestion on issue #110 Improve layout of config page --- intrastat_base/__init__.py | 1 + intrastat_base/__manifest__.py | 2 +- intrastat_base/models/__init__.py | 3 +- .../models/account_fiscal_position.py | 30 +++++++++++++++++++ intrastat_base/models/account_tax.py | 26 ---------------- .../views/account_fiscal_position.xml | 28 +++++++++++++++++ intrastat_base/views/account_tax.xml | 18 ----------- intrastat_base/views/res_config_settings.xml | 4 +-- intrastat_base/wizards/__init__.py | 1 + .../res_config_settings.py | 0 10 files changed, 64 insertions(+), 49 deletions(-) create mode 100644 intrastat_base/models/account_fiscal_position.py delete mode 100644 intrastat_base/models/account_tax.py create mode 100644 intrastat_base/views/account_fiscal_position.xml delete mode 100644 intrastat_base/views/account_tax.xml create mode 100644 intrastat_base/wizards/__init__.py rename intrastat_base/{models => wizards}/res_config_settings.py (100%) diff --git a/intrastat_base/__init__.py b/intrastat_base/__init__.py index 0650744..aee8895 100644 --- a/intrastat_base/__init__.py +++ b/intrastat_base/__init__.py @@ -1 +1,2 @@ from . import models +from . import wizards diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 84fb29b..c66fb40 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -19,9 +19,9 @@ "views/product_template.xml", "views/res_partner.xml", "views/res_country.xml", - "views/account_tax.xml", "views/res_config_settings.xml", "views/intrastat.xml", + "views/account_fiscal_position.xml", ], "demo": ["demo/intrastat_demo.xml"], "installable": True, diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index 68e2955..9d1273d 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -1,6 +1,5 @@ from . import res_country from . import product_template -from . import account_tax from . import res_company -from . import res_config_settings from . import intrastat_common +from . import account_fiscal_position diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py new file mode 100644 index 0000000..baacbdd --- /dev/null +++ b/intrastat_base/models/account_fiscal_position.py @@ -0,0 +1,30 @@ +# Copyright 2020 Akretion France (http://www.akretion.com/) +# @author: +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +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." + ) + + +class AccountFiscalPositionTemplate(models.Model): + _inherit = "account.fiscal.position.template" + + intrastat = fields.Boolean(string="Intrastat") + + +class AccountChartTemplate(models.Model): + _inherit = "account.chart.template" + + def _get_fp_vals(self, company, position): + vals = super()._get_fp_vals(company, position) + vals['intrastat'] = position.intrastat + return vals diff --git a/intrastat_base/models/account_tax.py b/intrastat_base/models/account_tax.py deleted file mode 100644 index ebe693b..0000000 --- a/intrastat_base/models/account_tax.py +++ /dev/null @@ -1,26 +0,0 @@ -# Copyright 2011-2020 Akretion France (http://www.akretion.com). -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -from odoo import fields, models - - -class AccountTax(models.Model): - _inherit = "account.tax" - - exclude_from_intrastat_if_present = fields.Boolean( - string="Exclude invoice line from intrastat if this tax is present", - help="If this tax is present on an invoice line, this invoice " - "line will be skipped when generating Intrastat Product or " - "Service lines from invoices.", - ) - - -class AccountTaxTemplate(models.Model): - _inherit = "account.tax.template" - - exclude_from_intrastat_if_present = fields.Boolean( - string="Exclude invoice line from intrastat if this tax is present", - help="If this tax is present on an invoice line, this invoice " - "line will be skipped when generating Intrastat Product or " - "Service lines from invoices.", - ) diff --git a/intrastat_base/views/account_fiscal_position.xml b/intrastat_base/views/account_fiscal_position.xml new file mode 100644 index 0000000..1a4edec --- /dev/null +++ b/intrastat_base/views/account_fiscal_position.xml @@ -0,0 +1,28 @@ + + + + + intrastat.account.fiscal.position.form + account.fiscal.position + + + + + + + + + intrastat.account.fiscal.position.tree + account.fiscal.position + + + + + + + + diff --git a/intrastat_base/views/account_tax.xml b/intrastat_base/views/account_tax.xml deleted file mode 100644 index a135bb5..0000000 --- a/intrastat_base/views/account_tax.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - intrastat.base.tax - account.tax - - - - - - - - diff --git a/intrastat_base/views/res_config_settings.xml b/intrastat_base/views/res_config_settings.xml index 934dfd7..04c4b97 100644 --- a/intrastat_base/views/res_config_settings.xml +++ b/intrastat_base/views/res_config_settings.xml @@ -14,13 +14,13 @@

Intrastat

-
+

Usage

-

This module adds an intrastat property on countries and activates this property -on the countries of the European Union.

+

This module adds an intrastat property on fiscal positions.

With this module, the country field on partners becomes a required field.

-

It adds an option Exclude invoice line from intrastat if this tax is present -on taxes.

It adds an Intrastat section on the Invoicing configuration page.

From 050a97b61951618ca28bb6d3659a4335277e7f44 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 1 Feb 2021 10:30:33 +0000 Subject: [PATCH 48/90] intrastat_base 14.0.2.0.0 --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 61b342f..031abb3 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Intrastat Reporting Base", - "version": "14.0.1.0.0", + "version": "14.0.2.0.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", From be4cdd4b7d961906335a11997453b291502de519 Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Mon, 1 Feb 2021 10:30:44 +0000 Subject: [PATCH 49/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 163 +++++++++++++++++++++----------------- 1 file changed, 91 insertions(+), 72 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index c95b44d..45a4af8 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -16,6 +16,11 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_chart_template +msgid "Account Chart Template" +msgstr "" + #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost @@ -45,23 +50,12 @@ msgstr "Common functions for intrastat reports for products " msgid "Companies" msgstr "Sociétés" -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "Company not yet set on intrastat report." -msgstr "Société non configurée sur le rapport DEB/DES." - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_config_settings #, fuzzy msgid "Config Settings" msgstr "res.config.settings" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_country -msgid "Country" -msgstr "Pays" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid msgid "Created by" @@ -73,62 +67,52 @@ msgid "Created on" msgstr "Créé le" #. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search -msgid "Currency" -msgstr "" - -#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_account_move__display_name #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__display_name +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__display_name msgid "Display Name" msgstr "Afficher le nom" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_res_country__intrastat -#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search -msgid "EU Country" -msgstr "Membre de l'UE" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax__exclude_from_intrastat_if_present -#: model:ir.model.fields,field_description:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present -msgid "Exclude invoice line from intrastat if this tax is present" -msgstr "" -"Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" - -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search -msgid "Group By" +#: model:ir.model,name:intrastat_base.model_account_fiscal_position +msgid "Fiscal Position" msgstr "" #. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__id +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__id +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__id +#: model:ir.model.fields,field_description:intrastat_base.field_account_move__id #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__id +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__id +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__id msgid "ID" msgstr "ID" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_tax__exclude_from_intrastat_if_present -#: model:ir.model.fields,help:intrastat_base.field_account_tax_template__exclude_from_intrastat_if_present -msgid "" -"If this tax is present on an invoice line, this invoice line will be skipped " -"when generating Intrastat Product or Service lines from invoices." -msgstr "" -"Si cette taxe est présente sur une ligne de facture, cette ligne de facture " -"sera sautée lors de la génération de la DEB et de la DES à partir des " -"factures." - -#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__intrastat #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root +#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view #: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "DEB/DES" #. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view -msgid "Intrastat Properties" -msgstr "Propriétés DEB/DES" +#: model:ir.model.fields,field_description:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,field_description:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,field_description:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "Intrastat Fiscal Position" +msgstr "" #. module: intrastat_base #: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form @@ -142,8 +126,20 @@ msgid "Is accessory cost" msgstr "Est un frais accessoire" #. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_account_move____last_update #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_product_template____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_res_company____last_update +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings____last_update msgid "Last Modified on" msgstr "Dernière modification le" @@ -176,11 +172,6 @@ msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search -msgid "Name or Code" -msgstr "" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note msgid "Notes" @@ -202,14 +193,14 @@ msgid "Product Template" msgstr "Modèle d'article" #. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.res_country_view_search -msgid "Search Countries" -msgstr "Recherche pays" - -#. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_res_country__intrastat -msgid "Set to True for all European Union countries." -msgstr "Cocher la case pour tous les pays de l'Union Européenne." +#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "" +"Set to True if the invoices with this fiscal position should be taken into " +"account for the generation of the intrastat reports." +msgstr "" #. module: intrastat_base #: model:product.product,name:intrastat_base.shipping_costs_exclude @@ -218,14 +209,9 @@ msgid "Shipping costs" msgstr "Frais de port" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_tax -msgid "Tax" -msgstr "Taxe" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_tax_template -msgid "Templates for Taxes" -msgstr "Modèles pour les taxes" +#: model:ir.model,name:intrastat_base.model_account_fiscal_position_template +msgid "Template for Fiscal Position" +msgstr "" #. module: intrastat_base #: code:addons/intrastat_base/models/intrastat_common.py:0 @@ -233,12 +219,6 @@ msgstr "Modèles pour les taxes" msgid "The VAT number is not set for the partner '%s'." msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "The country is not set on the company '%s'." -msgstr "Pays non renseigné sur la société '%s'." - #. module: intrastat_base #: code:addons/intrastat_base/models/product_template.py:0 #, python-format @@ -269,6 +249,45 @@ msgstr "" msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" +#~ msgid "Company not yet set on intrastat report." +#~ msgstr "Société non configurée sur le rapport DEB/DES." + +#~ msgid "Country" +#~ msgstr "Pays" + +#~ msgid "EU Country" +#~ msgstr "Membre de l'UE" + +#~ msgid "Exclude invoice line from intrastat if this tax is present" +#~ msgstr "" +#~ "Ligne de facture exclue de la DEB et de la DES si cette taxe est présente" + +#~ msgid "" +#~ "If this tax is present on an invoice line, this invoice line will be " +#~ "skipped when generating Intrastat Product or Service lines from invoices." +#~ msgstr "" +#~ "Si cette taxe est présente sur une ligne de facture, cette ligne de " +#~ "facture sera sautée lors de la génération de la DEB et de la DES à partir " +#~ "des factures." + +#~ msgid "Intrastat Properties" +#~ msgstr "Propriétés DEB/DES" + +#~ msgid "Search Countries" +#~ msgstr "Recherche pays" + +#~ msgid "Set to True for all European Union countries." +#~ msgstr "Cocher la case pour tous les pays de l'Union Européenne." + +#~ msgid "Tax" +#~ msgstr "Taxe" + +#~ msgid "Templates for Taxes" +#~ msgstr "Modèles pour les taxes" + +#~ msgid "The country is not set on the company '%s'." +#~ msgstr "Pays non renseigné sur la société '%s'." + #~ msgid "intrastat.result.view" #~ msgstr "intrastat.result.view" From 797ed20de2a0321f4d58d9fc94994729765f0256 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Sun, 4 Jul 2021 19:43:47 +0000 Subject: [PATCH 50/90] Translated using Weblate (French) Currently translated at 100.0% (34 of 34 strings) Translation: intrastat-extrastat-14.0/intrastat-extrastat-14.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-intrastat_base/fr/ --- intrastat_base/i18n/fr.po | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 45a4af8..b6f72ac 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -7,19 +7,20 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-29 09:52+0000\n" -"PO-Revision-Date: 2018-12-29 09:52+0000\n" -"Last-Translator: <>\n" +"PO-Revision-Date: 2021-07-04 21:48+0000\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" -"Language: \n" +"Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" -"Plural-Forms: \n" +"Plural-Forms: nplurals=2; plural=n > 1;\n" +"X-Generator: Weblate 4.3.2\n" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_chart_template msgid "Account Chart Template" -msgstr "" +msgstr "Modèle de plan comptable" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost @@ -43,7 +44,7 @@ msgstr "" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_intrastat_common msgid "Common functions for intrastat reports for products " -msgstr "Common functions for intrastat reports for products " +msgstr "Fonctions communes pour les rapports intrastat des produits " #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_company @@ -52,9 +53,8 @@ msgstr "Sociétés" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_config_settings -#, fuzzy msgid "Config Settings" -msgstr "res.config.settings" +msgstr "Configuration" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid @@ -82,7 +82,7 @@ msgstr "Afficher le nom" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" -msgstr "" +msgstr "Position fiscale" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__id @@ -112,7 +112,7 @@ msgstr "DEB/DES" #: model:ir.model.fields,field_description:intrastat_base.field_account_move__intrastat_fiscal_position #: model:ir.model.fields,field_description:intrastat_base.field_account_payment__intrastat_fiscal_position msgid "Intrastat Fiscal Position" -msgstr "" +msgstr "Position fiscale intrastat" #. module: intrastat_base #: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form @@ -128,7 +128,7 @@ msgstr "Est un frais accessoire" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_move msgid "Journal Entry" -msgstr "" +msgstr "Pièce comptable" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template____last_update @@ -186,6 +186,7 @@ msgstr "Ok" #: model:ir.model,name:intrastat_base.model_intrastat_result_view msgid "Pop-up to show errors on intrastat report generation" msgstr "" +"Pop-up qui affiche les erreurs lors de la génération du rapport intrastat" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template @@ -201,6 +202,8 @@ msgid "" "Set to True if the invoices with this fiscal position should be taken into " "account for the generation of the intrastat reports." msgstr "" +"Activer si les factures ayant cette position fiscale doivent être " +"sélectionnées pour la génération des rapports intrastat." #. module: intrastat_base #: model:product.product,name:intrastat_base.shipping_costs_exclude @@ -211,7 +214,7 @@ msgstr "Frais de port" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position_template msgid "Template for Fiscal Position" -msgstr "" +msgstr "Modèle de position fiscale" #. module: intrastat_base #: code:addons/intrastat_base/models/intrastat_common.py:0 @@ -235,13 +238,13 @@ msgstr "" #: model:product.product,uom_name:intrastat_base.shipping_costs_exclude #: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template msgid "Units" -msgstr "" +msgstr "Unités" #. module: intrastat_base #: code:addons/intrastat_base/models/intrastat_common.py:0 #, python-format msgid "Unknown Error" -msgstr "" +msgstr "Erreur inconnue" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids From fe118f3528a918b5f2aead7ae5639dd6dc46f9de Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sat, 23 Oct 2021 18:46:52 +0200 Subject: [PATCH 51/90] [14.0][IMP] intrastat_*: Improve tests and code --- intrastat_base/models/intrastat_common.py | 86 ++++++++++++++++++++- intrastat_base/tests/__init__.py | 1 + intrastat_base/tests/common.py | 64 +++++++++++++++ intrastat_base/tests/data/mail_template.xml | 59 ++++++++++++++ intrastat_base/tests/models.py | 9 +++ intrastat_base/tests/test_all.py | 69 +++++++++++++++-- 6 files changed, 281 insertions(+), 7 deletions(-) create mode 100644 intrastat_base/tests/common.py create mode 100644 intrastat_base/tests/data/mail_template.xml create mode 100644 intrastat_base/tests/models.py diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py index 94dc5a0..4b37057 100644 --- a/intrastat_base/models/intrastat_common.py +++ b/intrastat_base/models/intrastat_common.py @@ -10,7 +10,7 @@ from traceback import format_exception from lxml import etree from odoo import _, api, fields, models, tools -from odoo.exceptions import UserError +from odoo.exceptions import UserError, ValidationError logger = logging.getLogger(__name__) @@ -20,6 +20,90 @@ class IntrastatCommon(models.AbstractModel): _description = "Common functions for intrastat reports for products " "and services" + company_id = fields.Many2one( + comodel_name="res.company", + string="Company", + required=True, + states={"done": [("readonly", True)]}, + default=lambda self: self._default_company_id(), + ) + company_country_code = fields.Char( + compute="_compute_company_country_code", + string="Company Country Code", + readonly=True, + store=True, + help="Used in views and methods of localization modules.", + ) + state = fields.Selection( + selection=[("draft", "Draft"), ("done", "Done")], + string="State", + readonly=True, + tracking=True, + copy=False, + default="draft", + help="State of the declaration. When the state is set to 'Done', " + "the parameters become read-only.", + ) + note = fields.Text( + string="Notes", help="You can add some comments here if you want." + ) + + year = fields.Char( + string="Year", required=True, states={"done": [("readonly", True)]} + ) + month = fields.Selection( + selection=[ + ("01", "01"), + ("02", "02"), + ("03", "03"), + ("04", "04"), + ("05", "05"), + ("06", "06"), + ("07", "07"), + ("08", "08"), + ("09", "09"), + ("10", "10"), + ("11", "11"), + ("12", "12"), + ], + string="Month", + required=True, + states={"done": [("readonly", True)]}, + ) + year_month = fields.Char( + compute="_compute_year_month", + string="Period", + readonly=True, + tracking=True, + store=True, + help="Year and month of the declaration.", + ) + + @api.model + def _default_company_id(self): + return self.env.company + + @api.depends("company_id") + def _compute_company_country_code(self): + for this in self: + if this.company_id: + if not this.company_id.country_id: + raise ValidationError(_("You must set company's country !")) + this.company_country_code = this.company_id.country_id.code.lower() + + @api.depends("year", "month") + def _compute_year_month(self): + for this in self: + if this.year and this.month: + this.year_month = "-".join([this.year, this.month]) + + @api.model + @api.constrains("year") + def _check_year(self): + for this in self: + if len(this.year) != 4 or this.year[0] != "2": + raise ValidationError(_("Invalid Year !")) + # The method _compute_numbers has been removed # because it was using a loop on lines, which is slow -> we should # use read_group() instead, but then the code depends on diff --git a/intrastat_base/tests/__init__.py b/intrastat_base/tests/__init__.py index 7836283..a2afb4b 100644 --- a/intrastat_base/tests/__init__.py +++ b/intrastat_base/tests/__init__.py @@ -1 +1,2 @@ +from . import common from . import test_all diff --git a/intrastat_base/tests/common.py b/intrastat_base/tests/common.py new file mode 100644 index 0000000..640c62a --- /dev/null +++ b/intrastat_base/tests/common.py @@ -0,0 +1,64 @@ +# Copyright 2021 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo_test_helper import FakeModelLoader + +from odoo.modules.module import get_resource_path +from odoo.tools import convert_file + + +class IntrastatCommon(object): + @classmethod + def _load_xml(cls, module, filepath): + convert_file( + cls.env.cr, + module, + get_resource_path(module, filepath), + {}, + mode="init", + noupdate=False, + kind="test", + ) + + @classmethod + def _load_test_declaration(cls): + cls.loader = FakeModelLoader(cls.env, cls.__module__) + cls.loader.backup_registry() + + # The fake class is imported here !! After the backup_registry + from .models import IntrastatDeclarationTest + + cls.loader.update_registry((IntrastatDeclarationTest,)) + + @classmethod + def _create_declaration(cls, vals=None): + values = { + "company_id": cls.declaration_test_obj._default_company_id().id, + "year": "2021", + "month": "03", + } + if vals is not None: + values.update(vals) + cls.declaration = cls.declaration_test_obj.create(values) + + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True)) + cls.chart_template_obj = cls.env["account.chart.template"] + cls.mail_obj = cls.env["mail.mail"] + + cls.demo_user = cls.env.ref("base.user_demo") + cls.demo_company = cls.env.ref("base.main_company") + + cls.shipping_cost = cls.env.ref("intrastat_base.shipping_costs_exclude") + cls._load_test_declaration() + cls.declaration_test_obj = cls.env["intrastat.declaration.test"] + cls._load_xml("intrastat_base", "tests/data/mail_template.xml") + cls.mail_template_id = ( + "intrastat_base.base_intrastat_product_reminder_email_template" + ) + + @classmethod + def tearDownClass(cls): + cls.loader.restore_registry() + super().tearDownClass() diff --git a/intrastat_base/tests/data/mail_template.xml b/intrastat_base/tests/data/mail_template.xml new file mode 100644 index 0000000..b3313f2 --- /dev/null +++ b/intrastat_base/tests/data/mail_template.xml @@ -0,0 +1,59 @@ + + + + + Intrastat Product Reminder + + + ${object.company_id.email or 'odoo@example.com'} + ${object.company_id.intrastat_email_list} + ${object.type} DEB ${object.year_month} for ${object.company_id.name} + + + +

I would like to remind you that we are approaching the deadline for the DEB for month ${object.year_month}.

+ +

As there were no ${object.type} DEB for that month in Odoo, a draft DEB has been generated automatically by Odoo.

+ +% if ctx.get('exception'): +

When trying to generate the lines of the ${object.declaration_type} DEB, the following error was encountered:

+ +

${ctx.get('error_msg')}

+ +

You should solve this error, then go to the menu "Invoicing > Reporting > Intrastat > DEB", open the ${object.declaration_type} declaration for month ${object.year_month} and click on the button "Generate lines from invoices".

+ +% else: +% if object.num_lines and object.num_lines > 0: +

This draft ${object.type} DEB contains ${object.num_decl_lines} ${object.num_decl_lines == 1 and 'line' or 'lines'}.

+% else: +

This draft ${object.type} DEB generated automatically by Odoo doesn't contain any line.

+% endif + +

Go and check this declaration in Odoo in the menu "Invoicing > Reporting > Intrastat > DEB".

+ +% endif + +

+-- +Automatic e-mail sent by Odoo. +

+
+]]> + + + diff --git a/intrastat_base/tests/models.py b/intrastat_base/tests/models.py new file mode 100644 index 0000000..e543530 --- /dev/null +++ b/intrastat_base/tests/models.py @@ -0,0 +1,9 @@ +# Copyright 2021 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class IntrastatDeclarationTest(models.Model): + _inherit = ["mail.thread", "mail.activity.mixin", "intrastat.common"] + _name = "intrastat.declaration.test" diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index f05fc49..f25e1dc 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -1,13 +1,70 @@ -from odoo.tests.common import TransactionCase +from odoo.exceptions import UserError, ValidationError +from odoo.tests.common import SavepointCase + +from .common import IntrastatCommon -class TestIntrastatBase(TransactionCase): +class TestIntrastatBase(IntrastatCommon): """Tests for this module""" def test_company(self): # add 'Demo user' to intrastat_remind_user_ids - demo_user = self.env.ref("base.user_demo") - demo_company = self.env.ref("base.main_company") - demo_company.write({"intrastat_remind_user_ids": [(6, False, [demo_user.id])]}) + self.demo_company.write( + {"intrastat_remind_user_ids": [(6, False, [self.demo_user.id])]} + ) # then check if intrastat_email_list contains the email of the user - self.assertEqual(demo_company.intrastat_email_list, demo_user.email) + self.assertEqual(self.demo_company.intrastat_email_list, self.demo_user.email) + + def test_no_email(self): + self.demo_user.email = False + with self.assertRaises(ValidationError): + self.demo_company.write( + {"intrastat_remind_user_ids": [(6, False, [self.demo_user.id])]} + ) + + def test_accessory(self): + with self.assertRaises(ValidationError): + self.shipping_cost.type = "consu" + + def test_declaration_no_country(self): + self.demo_company.country_id = False + with self.assertRaises(ValidationError): + self._create_declaration() + self.declaration.flush() + + def test_declaration_no_vat(self): + self.demo_company.partner_id.vat = False + with self.assertRaises(UserError): + self._create_declaration() + self.declaration.flush() + self.declaration._check_generate_xml() + + def test_declaration_send_mail(self): + self._create_declaration() + mail_before = self.mail_obj.search([]) + self.declaration.send_reminder_email(self.mail_template_id) + mail_after = self.mail_obj.search([]) - mail_before + self.assertEqual(0, len(mail_after)) + self.demo_company.write( + {"intrastat_remind_user_ids": [(6, False, [self.demo_user.id])]} + ) + self.declaration.send_reminder_email(self.mail_template_id) + mail_after = self.mail_obj.search([]) - mail_before + self.assertEqual(1, len(mail_after)) + self.assertIn( + mail_after.email_to, + self.demo_user.email, + ) + + def test_declaration_state(self): + self._create_declaration() + self.declaration.unlink() + + self._create_declaration() + self.declaration.state = "done" + with self.assertRaises(UserError): + self.declaration.unlink() + + +class TestIntrastat(TestIntrastatBase, SavepointCase): + """ Test Intrastat """ From 0faa945a24721a026b1b8f1ce0f8e05492ae2ccb Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sat, 23 Oct 2021 20:23:45 +0200 Subject: [PATCH 52/90] [14.0][IMP] intrastat_base: Split models files --- intrastat_base/models/account_chart_template.py | 17 +++++++++++++++++ .../models/account_fiscal_position.py | 15 --------------- .../models/account_fiscal_position_template.py | 14 ++++++++++++++ 3 files changed, 31 insertions(+), 15 deletions(-) create mode 100644 intrastat_base/models/account_chart_template.py create mode 100644 intrastat_base/models/account_fiscal_position_template.py diff --git a/intrastat_base/models/account_chart_template.py b/intrastat_base/models/account_chart_template.py new file mode 100644 index 0000000..939e9e2 --- /dev/null +++ b/intrastat_base/models/account_chart_template.py @@ -0,0 +1,17 @@ +# Copyright 2020 Akretion France (http://www.akretion.com/) +# @author: +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import models + + +class AccountChartTemplate(models.Model): + _inherit = "account.chart.template" + + def _get_fp_vals(self, company, position): + """ + Get fiscal position chart template instrastat value + to create fiscal position + """ + vals = super()._get_fp_vals(company, position) + vals["intrastat"] = position.intrastat + return vals diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py index fe3ebfb..0c56e59 100644 --- a/intrastat_base/models/account_fiscal_position.py +++ b/intrastat_base/models/account_fiscal_position.py @@ -13,18 +13,3 @@ class AccountFiscalPosition(models.Model): help="Set to True if the invoices with this fiscal position should " "be taken into account for the generation of the intrastat reports.", ) - - -class AccountFiscalPositionTemplate(models.Model): - _inherit = "account.fiscal.position.template" - - intrastat = fields.Boolean(string="Intrastat") - - -class AccountChartTemplate(models.Model): - _inherit = "account.chart.template" - - def _get_fp_vals(self, company, position): - vals = super()._get_fp_vals(company, position) - vals["intrastat"] = position.intrastat - return vals diff --git a/intrastat_base/models/account_fiscal_position_template.py b/intrastat_base/models/account_fiscal_position_template.py new file mode 100644 index 0000000..9085f53 --- /dev/null +++ b/intrastat_base/models/account_fiscal_position_template.py @@ -0,0 +1,14 @@ +# Copyright 2020 Akretion France (http://www.akretion.com/) +# @author: +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo import fields, models + + +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", + ) From e08641e52eadfd669a182704625958d2a3061b2a Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sat, 23 Oct 2021 20:24:19 +0200 Subject: [PATCH 53/90] [14.0][IMP] intrastat_*: CONTRIBUTORS.rst --- intrastat_base/__manifest__.py | 2 +- intrastat_base/readme/CONTRIBUTORS.rst | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 031abb3..e12e23d 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -9,7 +9,7 @@ "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", - "author": "Akretion,Noviat,Odoo Community Association (OCA)", + "author": "ACSONE SA/NV, Akretion,Noviat,Odoo Community Association (OCA)", "website": "https://github.com/OCA/intrastat-extrastat", "depends": ["base_vat", "account"], "excludes": ["account_intrastat"], diff --git a/intrastat_base/readme/CONTRIBUTORS.rst b/intrastat_base/readme/CONTRIBUTORS.rst index 6a9e1c1..af9ef52 100644 --- a/intrastat_base/readme/CONTRIBUTORS.rst +++ b/intrastat_base/readme/CONTRIBUTORS.rst @@ -2,3 +2,4 @@ * Luc De Meyer, Noviat * Kumar Aberer, brain-tec AG * Andrea Stirpe +* Denis Roussel From 3ff1bca7e00801ae740a543932b6a0bc282a462b Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sun, 24 Oct 2021 12:24:14 +0200 Subject: [PATCH 54/90] [14.0][IMP] intrastat_*: Add tests for base and for sale flows --- intrastat_base/tests/common.py | 5 ----- intrastat_base/tests/test_all.py | 9 +++++++++ 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/intrastat_base/tests/common.py b/intrastat_base/tests/common.py index 640c62a..58a2491 100644 --- a/intrastat_base/tests/common.py +++ b/intrastat_base/tests/common.py @@ -52,11 +52,6 @@ class IntrastatCommon(object): cls.shipping_cost = cls.env.ref("intrastat_base.shipping_costs_exclude") cls._load_test_declaration() - cls.declaration_test_obj = cls.env["intrastat.declaration.test"] - cls._load_xml("intrastat_base", "tests/data/mail_template.xml") - cls.mail_template_id = ( - "intrastat_base.base_intrastat_product_reminder_email_template" - ) @classmethod def tearDownClass(cls): diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index f25e1dc..cc7b203 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -7,6 +7,15 @@ from .common import IntrastatCommon class TestIntrastatBase(IntrastatCommon): """Tests for this module""" + @classmethod + def setUpClass(cls): + super().setUpClass() + cls.declaration_test_obj = cls.env["intrastat.declaration.test"] + cls._load_xml("intrastat_base", "tests/data/mail_template.xml") + cls.mail_template_id = ( + "intrastat_base.base_intrastat_product_reminder_email_template" + ) + def test_company(self): # add 'Demo user' to intrastat_remind_user_ids self.demo_company.write( From 0a1acf1b79add0130586dc707a5736fbee9a5a81 Mon Sep 17 00:00:00 2001 From: Denis Roussel Date: Sun, 24 Oct 2021 13:58:47 +0200 Subject: [PATCH 55/90] [14.0][IMP] intrastat_product: Add description for fake model --- intrastat_base/tests/models.py | 1 + 1 file changed, 1 insertion(+) diff --git a/intrastat_base/tests/models.py b/intrastat_base/tests/models.py index e543530..302914c 100644 --- a/intrastat_base/tests/models.py +++ b/intrastat_base/tests/models.py @@ -7,3 +7,4 @@ from odoo import models class IntrastatDeclarationTest(models.Model): _inherit = ["mail.thread", "mail.activity.mixin", "intrastat.common"] _name = "intrastat.declaration.test" + _description = "Intrastat Declaration Test" From 6fd1cd3081ba336e81c6ee511e2c26b6d9ce7102 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 15 Dec 2021 12:49:02 +0100 Subject: [PATCH 56/90] intrastat_base: Remove intrastat.common class --- intrastat_base/__manifest__.py | 1 - intrastat_base/models/__init__.py | 2 +- intrastat_base/models/intrastat_common.py | 216 -------------------- intrastat_base/models/res_company.py | 34 ++- intrastat_base/security/ir.model.access.csv | 2 - intrastat_base/tests/common.py | 43 ---- intrastat_base/tests/data/mail_template.xml | 59 ------ intrastat_base/tests/test_all.py | 51 +---- intrastat_base/views/intrastat.xml | 14 -- 9 files changed, 34 insertions(+), 388 deletions(-) delete mode 100644 intrastat_base/models/intrastat_common.py delete mode 100644 intrastat_base/security/ir.model.access.csv delete mode 100644 intrastat_base/tests/data/mail_template.xml diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index e12e23d..e414249 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -14,7 +14,6 @@ "depends": ["base_vat", "account"], "excludes": ["account_intrastat"], "data": [ - "security/ir.model.access.csv", "views/product_template.xml", "views/res_partner.xml", "views/res_config_settings.xml", diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index eff3d68..cea19b9 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -1,5 +1,5 @@ from . import product_template from . import res_company -from . import intrastat_common from . import account_fiscal_position +from . import account_fiscal_position_template from . import account_move diff --git a/intrastat_base/models/intrastat_common.py b/intrastat_base/models/intrastat_common.py deleted file mode 100644 index 4b37057..0000000 --- a/intrastat_base/models/intrastat_common.py +++ /dev/null @@ -1,216 +0,0 @@ -# Copyright 2010-2020 Akretion () -# Copyright 2009-2020 Noviat (http://www.noviat.com) -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). - -import logging -from io import BytesIO -from sys import exc_info -from traceback import format_exception - -from lxml import etree - -from odoo import _, api, fields, models, tools -from odoo.exceptions import UserError, ValidationError - -logger = logging.getLogger(__name__) - - -class IntrastatCommon(models.AbstractModel): - _name = "intrastat.common" - _description = "Common functions for intrastat reports for products " - "and services" - - company_id = fields.Many2one( - comodel_name="res.company", - string="Company", - required=True, - states={"done": [("readonly", True)]}, - default=lambda self: self._default_company_id(), - ) - company_country_code = fields.Char( - compute="_compute_company_country_code", - string="Company Country Code", - readonly=True, - store=True, - help="Used in views and methods of localization modules.", - ) - state = fields.Selection( - selection=[("draft", "Draft"), ("done", "Done")], - string="State", - readonly=True, - tracking=True, - copy=False, - default="draft", - help="State of the declaration. When the state is set to 'Done', " - "the parameters become read-only.", - ) - note = fields.Text( - string="Notes", help="You can add some comments here if you want." - ) - - year = fields.Char( - string="Year", required=True, states={"done": [("readonly", True)]} - ) - month = fields.Selection( - selection=[ - ("01", "01"), - ("02", "02"), - ("03", "03"), - ("04", "04"), - ("05", "05"), - ("06", "06"), - ("07", "07"), - ("08", "08"), - ("09", "09"), - ("10", "10"), - ("11", "11"), - ("12", "12"), - ], - string="Month", - required=True, - states={"done": [("readonly", True)]}, - ) - year_month = fields.Char( - compute="_compute_year_month", - string="Period", - readonly=True, - tracking=True, - store=True, - help="Year and month of the declaration.", - ) - - @api.model - def _default_company_id(self): - return self.env.company - - @api.depends("company_id") - def _compute_company_country_code(self): - for this in self: - if this.company_id: - if not this.company_id.country_id: - raise ValidationError(_("You must set company's country !")) - this.company_country_code = this.company_id.country_id.code.lower() - - @api.depends("year", "month") - def _compute_year_month(self): - for this in self: - if this.year and this.month: - this.year_month = "-".join([this.year, this.month]) - - @api.model - @api.constrains("year") - def _check_year(self): - for this in self: - if len(this.year) != 4 or this.year[0] != "2": - raise ValidationError(_("Invalid Year !")) - - # The method _compute_numbers has been removed - # because it was using a loop on lines, which is slow -> we should - # use read_group() instead, but then the code depends on - # the line object, so it can't be factorized here - - def _check_generate_xml(self): - for this in self: - if not this.company_id.partner_id.vat: - raise UserError( - _("The VAT number is not set for the partner '%s'.") - % this.company_id.partner_id.name - ) - - @api.model - def _check_xml_schema(self, xml_bytes, xsd_file): - """Validate the XML file against the XSD""" - xsd_etree_obj = etree.parse(tools.file_open(xsd_file, mode="rb")) - official_schema = etree.XMLSchema(xsd_etree_obj) - try: - t = etree.parse(BytesIO(xml_bytes)) - official_schema.assertValid(t) - except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e: - logger.warning("The XML file is invalid against the XML Schema Definition") - logger.warning(xml_bytes) - logger.warning(e) - usererror = "{}\n\n{}".format(e.__class__.__name__, str(e)) - raise UserError(usererror) - except Exception: - error = _("Unknown Error") - tb = "".join(format_exception(*exc_info())) - error += "\n%s" % tb - logger.warning(error) - raise UserError(error) - - def _attach_xml_file(self, xml_bytes, declaration_name): - """Attach the XML file to the report_intrastat_product/service - object""" - self.ensure_one() - filename = "{}_{}.xml".format(self.year_month, declaration_name) - attach = self.env["ir.attachment"].create( - { - "name": filename, - "res_id": self.id, - "res_model": self._name, - "raw": xml_bytes, - } - ) - return attach.id - - def _unlink_attachments(self): - atts = self.env["ir.attachment"].search( - [("res_model", "=", self._name), ("res_id", "=", self.id)] - ) - atts.unlink() - - # Method _open_attach_view() removed - # Let's handle attachments like in l10n_fr_intrastat_service v14 - # with the field attachment_id on the declaration and the download - # link directly on the form view of the declaration. - - def _generate_xml(self): - """ - Inherit this method in the localization module - to generate the INTRASTAT Declaration XML file - - Returns: - string with XML data - - Call the _check_xml_schema() method - before returning the XML string. - """ - return False - - def send_reminder_email(self, mail_template_xmlid): - mail_template = self.env.ref(mail_template_xmlid) - for this in self: - if this.company_id.intrastat_remind_user_ids: - mail_template.send_mail(this.id) - logger.info( - "Intrastat Reminder email has been sent (XMLID: %s)." - % mail_template_xmlid - ) - else: - logger.warning( - "The list of users receiving the Intrastat Reminder is " - "empty on company %s" % this.company_id.name - ) - return True - - def unlink(self): - for intrastat in self: - if intrastat.state == "done": - raise UserError( - _("Cannot delete the declaration %s " "because it is in Done state") - % self.year_month - ) - return super().unlink() - - -class IntrastatResultView(models.TransientModel): - """ - Transient Model to display Intrastat Report results - """ - - _name = "intrastat.result.view" - _description = "Pop-up to show errors on intrastat report generation" - - note = fields.Text( - string="Notes", readonly=True, default=lambda self: self._context.get("note") - ) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py index eefce32..7a2dbc9 100644 --- a/intrastat_base/models/res_company.py +++ b/intrastat_base/models/res_company.py @@ -2,8 +2,17 @@ # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import _, api, fields, models -from odoo.exceptions import ValidationError +import logging +from io import BytesIO +from sys import exc_info +from traceback import format_exception + +from lxml import etree + +from odoo import _, api, fields, models, tools +from odoo.exceptions import UserError, ValidationError + +logger = logging.getLogger(__name__) class ResCompany(models.Model): @@ -40,3 +49,24 @@ class ResCompany(models.Model): raise ValidationError( _("Missing e-mail address on user '%s'.") % (user.name) ) + + @api.model + def _intrastat_check_xml_schema(self, xml_bytes, xsd_file): + """Validate the XML file against the XSD""" + xsd_etree_obj = etree.parse(tools.file_open(xsd_file, mode="rb")) + official_schema = etree.XMLSchema(xsd_etree_obj) + try: + t = etree.parse(BytesIO(xml_bytes)) + official_schema.assertValid(t) + except (etree.XMLSchemaParseError, etree.DocumentInvalid) as e: + logger.warning("The XML file is invalid against the XML Schema Definition") + logger.warning(xml_bytes) + logger.warning(e) + usererror = "{}\n\n{}".format(e.__class__.__name__, str(e)) + raise UserError(usererror) + except Exception: + error = _("Unknown Error") + tb = "".join(format_exception(*exc_info())) + error += "\n%s" % tb + logger.warning(error) + raise UserError(error) diff --git a/intrastat_base/security/ir.model.access.csv b/intrastat_base/security/ir.model.access.csv deleted file mode 100644 index fbe710c..0000000 --- a/intrastat_base/security/ir.model.access.csv +++ /dev/null @@ -1,2 +0,0 @@ -id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_intrastat_result_view,Access on intrastat.result.view,model_intrastat_result_view,account.group_account_user,1,1,1,0 diff --git a/intrastat_base/tests/common.py b/intrastat_base/tests/common.py index 58a2491..ac1fbf3 100644 --- a/intrastat_base/tests/common.py +++ b/intrastat_base/tests/common.py @@ -1,45 +1,8 @@ # Copyright 2021 ACSONE SA/NV # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo_test_helper import FakeModelLoader - -from odoo.modules.module import get_resource_path -from odoo.tools import convert_file class IntrastatCommon(object): - @classmethod - def _load_xml(cls, module, filepath): - convert_file( - cls.env.cr, - module, - get_resource_path(module, filepath), - {}, - mode="init", - noupdate=False, - kind="test", - ) - - @classmethod - def _load_test_declaration(cls): - cls.loader = FakeModelLoader(cls.env, cls.__module__) - cls.loader.backup_registry() - - # The fake class is imported here !! After the backup_registry - from .models import IntrastatDeclarationTest - - cls.loader.update_registry((IntrastatDeclarationTest,)) - - @classmethod - def _create_declaration(cls, vals=None): - values = { - "company_id": cls.declaration_test_obj._default_company_id().id, - "year": "2021", - "month": "03", - } - if vals is not None: - values.update(vals) - cls.declaration = cls.declaration_test_obj.create(values) - @classmethod def setUpClass(cls): super().setUpClass() @@ -51,9 +14,3 @@ class IntrastatCommon(object): cls.demo_company = cls.env.ref("base.main_company") cls.shipping_cost = cls.env.ref("intrastat_base.shipping_costs_exclude") - cls._load_test_declaration() - - @classmethod - def tearDownClass(cls): - cls.loader.restore_registry() - super().tearDownClass() diff --git a/intrastat_base/tests/data/mail_template.xml b/intrastat_base/tests/data/mail_template.xml deleted file mode 100644 index b3313f2..0000000 --- a/intrastat_base/tests/data/mail_template.xml +++ /dev/null @@ -1,59 +0,0 @@ - - - - - Intrastat Product Reminder - - - ${object.company_id.email or 'odoo@example.com'} - ${object.company_id.intrastat_email_list} - ${object.type} DEB ${object.year_month} for ${object.company_id.name} - - - -

I would like to remind you that we are approaching the deadline for the DEB for month ${object.year_month}.

- -

As there were no ${object.type} DEB for that month in Odoo, a draft DEB has been generated automatically by Odoo.

- -% if ctx.get('exception'): -

When trying to generate the lines of the ${object.declaration_type} DEB, the following error was encountered:

- -

${ctx.get('error_msg')}

- -

You should solve this error, then go to the menu "Invoicing > Reporting > Intrastat > DEB", open the ${object.declaration_type} declaration for month ${object.year_month} and click on the button "Generate lines from invoices".

- -% else: -% if object.num_lines and object.num_lines > 0: -

This draft ${object.type} DEB contains ${object.num_decl_lines} ${object.num_decl_lines == 1 and 'line' or 'lines'}.

-% else: -

This draft ${object.type} DEB generated automatically by Odoo doesn't contain any line.

-% endif - -

Go and check this declaration in Odoo in the menu "Invoicing > Reporting > Intrastat > DEB".

- -% endif - -

--- -Automatic e-mail sent by Odoo. -

-
-]]> - - - diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index cc7b203..40b414f 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -1,5 +1,4 @@ -from odoo.exceptions import UserError, ValidationError -from odoo.tests.common import SavepointCase +from odoo.exceptions import ValidationError from .common import IntrastatCommon @@ -10,11 +9,6 @@ class TestIntrastatBase(IntrastatCommon): @classmethod def setUpClass(cls): super().setUpClass() - cls.declaration_test_obj = cls.env["intrastat.declaration.test"] - cls._load_xml("intrastat_base", "tests/data/mail_template.xml") - cls.mail_template_id = ( - "intrastat_base.base_intrastat_product_reminder_email_template" - ) def test_company(self): # add 'Demo user' to intrastat_remind_user_ids @@ -34,46 +28,3 @@ class TestIntrastatBase(IntrastatCommon): def test_accessory(self): with self.assertRaises(ValidationError): self.shipping_cost.type = "consu" - - def test_declaration_no_country(self): - self.demo_company.country_id = False - with self.assertRaises(ValidationError): - self._create_declaration() - self.declaration.flush() - - def test_declaration_no_vat(self): - self.demo_company.partner_id.vat = False - with self.assertRaises(UserError): - self._create_declaration() - self.declaration.flush() - self.declaration._check_generate_xml() - - def test_declaration_send_mail(self): - self._create_declaration() - mail_before = self.mail_obj.search([]) - self.declaration.send_reminder_email(self.mail_template_id) - mail_after = self.mail_obj.search([]) - mail_before - self.assertEqual(0, len(mail_after)) - self.demo_company.write( - {"intrastat_remind_user_ids": [(6, False, [self.demo_user.id])]} - ) - self.declaration.send_reminder_email(self.mail_template_id) - mail_after = self.mail_obj.search([]) - mail_before - self.assertEqual(1, len(mail_after)) - self.assertIn( - mail_after.email_to, - self.demo_user.email, - ) - - def test_declaration_state(self): - self._create_declaration() - self.declaration.unlink() - - self._create_declaration() - self.declaration.state = "done" - with self.assertRaises(UserError): - self.declaration.unlink() - - -class TestIntrastat(TestIntrastatBase, SavepointCase): - """ Test Intrastat """ diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml index ca14bae..4784270 100644 --- a/intrastat_base/views/intrastat.xml +++ b/intrastat_base/views/intrastat.xml @@ -18,18 +18,4 @@ parent="account.menu_finance_configuration" sequence="50" /> - - intrastat.result_view_form - intrastat.result.view - -
- - - -
-
-
-
-
From 4ecca94b3a72e42844ea994ee32239c642d55ed6 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 16 Dec 2021 16:43:46 +0100 Subject: [PATCH 57/90] [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 ++-- 14 files changed, 38 insertions(+), 28 deletions(-) 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). From 45c9b4da2379c4d5566c2f69e6825c0ac10d2be2 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Mon, 30 May 2022 11:59:55 +0000 Subject: [PATCH 58/90] [UPD] Update intrastat_base.pot --- intrastat_base/i18n/intrastat_base.pot | 112 ++----------------------- 1 file changed, 9 insertions(+), 103 deletions(-) diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 6fa9236..7efde16 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 14.0\n" +"Project-Id-Version: Odoo Server 15.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -13,11 +13,6 @@ msgstr "" "Content-Transfer-Encoding: \n" "Plural-Forms: \n" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_chart_template -msgid "Account Chart Template" -msgstr "" - #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost @@ -27,14 +22,10 @@ msgid "" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "Cannot delete the declaration %s because it is in Done state" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_common -msgid "Common functions for intrastat reports for products " +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat +msgid "" +"Check this if you want to generate intrastat declarations withthe created " +"fiscal position" msgstr "" #. module: intrastat_base @@ -47,47 +38,11 @@ msgstr "" msgid "Config Settings" msgstr "" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid -msgid "Created by" -msgstr "" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_date -msgid "Created on" -msgstr "" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_move__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_product_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_res_company__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__display_name -msgid "Display Name" -msgstr "" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" msgstr "" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_move__id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id -#: model:ir.model.fields,field_description:intrastat_base.field_product_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_res_company__id -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__id -msgid "ID" -msgstr "" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__intrastat #: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__intrastat @@ -105,15 +60,10 @@ msgstr "" msgid "Intrastat Fiscal Position" msgstr "" -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form -msgid "Intrastat Result View" -msgstr "" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost -msgid "Is accessory cost" +msgid "Is Accessory Cost" msgstr "" #. module: intrastat_base @@ -121,29 +71,6 @@ msgstr "" msgid "Journal Entry" msgstr "" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_move____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_product_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_res_company____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings____last_update -msgid "Last Modified on" -msgstr "" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_uid -msgid "Last Updated by" -msgstr "" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_date -msgid "Last Updated on" -msgstr "" - #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids #: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids @@ -163,21 +90,6 @@ msgstr "" msgid "Missing e-mail address on user '%s'." msgstr "" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note -msgid "Notes" -msgstr "" - -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form -msgid "Ok" -msgstr "" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_result_view -msgid "Pop-up to show errors on intrastat report generation" -msgstr "" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" @@ -204,19 +116,13 @@ msgstr "" msgid "Template for Fiscal Position" msgstr "" -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "The VAT number is not set for the partner '%s'." -msgstr "" - #. module: intrastat_base #: code:addons/intrastat_base/models/product_template.py:0 #, python-format msgid "" "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'" +"products. You have activated this option for the product '{product_name}' " +"which is configured with type '{product_type}'." msgstr "" #. module: intrastat_base @@ -226,7 +132,7 @@ msgid "Units" msgstr "" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 +#: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Unknown Error" msgstr "" From 8b2a8c424f621534c5e6bce44e1ee771ed6232a2 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Mon, 30 May 2022 12:02:53 +0000 Subject: [PATCH 59/90] [UPD] README.rst --- intrastat_base/README.rst | 23 +++++++++++++++----- intrastat_base/static/description/index.html | 10 ++++++--- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 1b56569..86532cd 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -14,13 +14,13 @@ Intrastat Reporting Base :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/14.0/intrastat_base + :target: https://github.com/OCA/intrastat-extrastat/tree/15.0/intrastat_base :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-14-0/intrastat-extrastat-14-0-intrastat_base + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-15-0/intrastat-extrastat-15-0-intrastat_base :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/14.0 + :target: https://runbot.odoo-community.org/runbot/227/15.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -66,7 +66,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -76,6 +76,7 @@ Credits Authors ~~~~~~~ +* ACSONE SA/NV * Akretion * Noviat @@ -86,6 +87,7 @@ Contributors * Luc De Meyer, Noviat * Kumar Aberer, brain-tec AG * Andrea Stirpe +* Denis Roussel Maintainers ~~~~~~~~~~~ @@ -100,6 +102,17 @@ OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +.. |maintainer-alexis-via| image:: https://github.com/alexis-via.png?size=40px + :target: https://github.com/alexis-via + :alt: alexis-via +.. |maintainer-luc-demeyer| image:: https://github.com/luc-demeyer.png?size=40px + :target: https://github.com/luc-demeyer + :alt: luc-demeyer + +Current `maintainers `__: + +|maintainer-alexis-via| |maintainer-luc-demeyer| + +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html index 3bd1878..afc4c9a 100644 --- a/intrastat_base/static/description/index.html +++ b/intrastat_base/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module intrastat_product and with the country-specific reporting modules such @@ -412,7 +412,7 @@ you should uninstall it first before installing this module.

Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

+feedback.

Do not contact contributors directly about support or help with technical issues.

@@ -420,6 +420,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

Authors

    +
  • ACSONE SA/NV
  • Akretion
  • Noviat
@@ -431,6 +432,7 @@ If you spotted it first, help us smashing it by providing a detailed and welcome
  • Luc De Meyer, Noviat <info@noviat.com>
  • Kumar Aberer, brain-tec AG <kumar.aberer@braintec-group.com>
  • Andrea Stirpe <a.stirpe@onestein.nl>
  • +
  • Denis Roussel <denis.roussel@acsone.eu>
  • @@ -440,7 +442,9 @@ If you spotted it first, help us smashing it by providing a detailed and welcome

    OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use.

    -

    This module is part of the OCA/intrastat-extrastat project on GitHub.

    +

    Current maintainers:

    +

    alexis-via luc-demeyer

    +

    This module is part of the OCA/intrastat-extrastat project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    From a9b3317252001d173ab1fbb6089bbf844b967494 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADctor=20Mart=C3=ADnez?= Date: Tue, 14 Jun 2022 10:34:31 +0200 Subject: [PATCH 60/90] [IMP] intrastat_base: Brexit support TT37486 --- intrastat_base/models/__init__.py | 1 + intrastat_base/models/res_partner.py | 67 ++++++++++++++++++++++++++++ 2 files changed, 68 insertions(+) create mode 100644 intrastat_base/models/res_partner.py diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py index cea19b9..cc10e08 100644 --- a/intrastat_base/models/__init__.py +++ b/intrastat_base/models/__init__.py @@ -3,3 +3,4 @@ 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/res_partner.py b/intrastat_base/models/res_partner.py new file mode 100644 index 0000000..ed692b8 --- /dev/null +++ b/intrastat_base/models/res_partner.py @@ -0,0 +1,67 @@ +# 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 From 733c59f32f0e327efac50156f131471b2446fe5e Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sun, 24 Jul 2022 12:04:27 +0000 Subject: [PATCH 61/90] [UPD] Update intrastat_base.pot --- intrastat_base/i18n/intrastat_base.pot | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 7efde16..2db5f2d 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -38,6 +38,11 @@ msgstr "" msgid "Config Settings" msgstr "" +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_partner +msgid "Contact" +msgstr "" + #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" @@ -95,6 +100,12 @@ msgstr "" msgid "Product Template" msgstr "" +#. module: intrastat_base +#: code:addons/intrastat_base/models/res_partner.py:0 +#, python-format +msgid "Programming Error when calling '_get_intrastat_country_code()" +msgstr "" + #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position #: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat From a16f817cd75c7f50091b4459ed41273c9d95b1dc Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 24 Jul 2022 12:07:37 +0000 Subject: [PATCH 62/90] intrastat_base 15.0.1.0.1 --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index a9d6fe8..17c5d0b 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Intrastat Reporting Base", - "version": "15.0.1.0.0", + "version": "15.0.1.0.1", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", From 8c9a2fda004ef9f58b512474d5496841f6ff027b Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 24 Jul 2022 12:07:50 +0000 Subject: [PATCH 63/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-15.0/intrastat-extrastat-15.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-15-0/intrastat-extrastat-15-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 185 ++++++++++++++++---------------------- 1 file changed, 78 insertions(+), 107 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index b6f72ac..d1db811 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -17,11 +17,6 @@ msgstr "" "Plural-Forms: nplurals=2; plural=n > 1;\n" "X-Generator: Weblate 4.3.2\n" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_account_chart_template -msgid "Account Chart Template" -msgstr "Modèle de plan comptable" - #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost @@ -34,17 +29,11 @@ msgstr "" "la DEB et la DES." #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "Cannot delete the declaration %s because it is in Done state" +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat +msgid "" +"Check this if you want to generate intrastat declarations withthe created " +"fiscal position" msgstr "" -"Impossible de supprimer la déclaration %s parce qu'elle est à l'état " -"'Terminé'." - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_common -msgid "Common functions for intrastat reports for products " -msgstr "Fonctions communes pour les rapports intrastat des produits " #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_company @@ -57,46 +46,15 @@ msgid "Config Settings" msgstr "Configuration" #. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_uid -msgid "Created by" -msgstr "Créé par" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__create_date -msgid "Created on" -msgstr "Créé le" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_account_move__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_product_template__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_res_company__display_name -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__display_name -msgid "Display Name" -msgstr "Afficher le nom" +#: model:ir.model,name:intrastat_base.model_res_partner +msgid "Contact" +msgstr "" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" msgstr "Position fiscale" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_account_move__id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common__id -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__id -#: model:ir.model.fields,field_description:intrastat_base.field_product_template__id -#: model:ir.model.fields,field_description:intrastat_base.field_res_company__id -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__id -msgid "ID" -msgstr "ID" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__intrastat #: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__intrastat @@ -114,45 +72,17 @@ msgstr "DEB/DES" msgid "Intrastat Fiscal Position" msgstr "Position fiscale intrastat" -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form -msgid "Intrastat Result View" -msgstr "Résultat DEB" - #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost -msgid "Is accessory cost" -msgstr "Est un frais accessoire" +msgid "Is Accessory Cost" +msgstr "" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_move msgid "Journal Entry" msgstr "Pièce comptable" -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_account_chart_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_account_move____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_common____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_product_template____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_res_company____last_update -#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings____last_update -msgid "Last Modified on" -msgstr "Dernière modification le" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_uid -msgid "Last Updated by" -msgstr "Dernière modification par" - -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__write_date -msgid "Last Updated on" -msgstr "Dernière modification le" - #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids #: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids @@ -172,27 +102,17 @@ msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." -#. module: intrastat_base -#: model:ir.model.fields,field_description:intrastat_base.field_intrastat_result_view__note -msgid "Notes" -msgstr "Notes" - -#. module: intrastat_base -#: model_terms:ir.ui.view,arch_db:intrastat_base.intrastat_result_view_form -msgid "Ok" -msgstr "Ok" - -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_intrastat_result_view -msgid "Pop-up to show errors on intrastat report generation" -msgstr "" -"Pop-up qui affiche les erreurs lors de la génération du rapport intrastat" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product Template" msgstr "Modèle d'article" +#. module: intrastat_base +#: code:addons/intrastat_base/models/res_partner.py:0 +#, python-format +msgid "Programming Error when calling '_get_intrastat_country_code()" +msgstr "" + #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position #: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat @@ -216,23 +136,14 @@ msgstr "Frais de port" msgid "Template for Fiscal Position" msgstr "Modèle de position fiscale" -#. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 -#, python-format -msgid "The VAT number is not set for the partner '%s'." -msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." - #. module: intrastat_base #: code:addons/intrastat_base/models/product_template.py:0 #, python-format msgid "" "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'" +"products. You have activated this option for the product '{product_name}' " +"which is configured with type '{product_type}'." msgstr "" -"L'option 'Est un frais accessoire' ne doit être activée que sur des articles " -"de service. Vous avez activé cette option pour l'article '%s' qui est de " -"type '%s'" #. module: intrastat_base #: model:product.product,uom_name:intrastat_base.shipping_costs_exclude @@ -241,7 +152,7 @@ msgid "Units" msgstr "Unités" #. module: intrastat_base -#: code:addons/intrastat_base/models/intrastat_common.py:0 +#: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Unknown Error" msgstr "Erreur inconnue" @@ -252,6 +163,66 @@ msgstr "Erreur inconnue" msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" +#~ msgid "Account Chart Template" +#~ msgstr "Modèle de plan comptable" + +#~ msgid "Cannot delete the declaration %s because it is in Done state" +#~ msgstr "" +#~ "Impossible de supprimer la déclaration %s parce qu'elle est à l'état " +#~ "'Terminé'." + +#~ msgid "Common functions for intrastat reports for products " +#~ msgstr "Fonctions communes pour les rapports intrastat des produits " + +#~ msgid "Created by" +#~ msgstr "Créé par" + +#~ msgid "Created on" +#~ msgstr "Créé le" + +#~ msgid "Display Name" +#~ msgstr "Afficher le nom" + +#~ msgid "ID" +#~ msgstr "ID" + +#~ msgid "Intrastat Result View" +#~ msgstr "Résultat DEB" + +#~ msgid "Is accessory cost" +#~ msgstr "Est un frais accessoire" + +#~ msgid "Last Modified on" +#~ msgstr "Dernière modification le" + +#~ msgid "Last Updated by" +#~ msgstr "Dernière modification par" + +#~ msgid "Last Updated on" +#~ msgstr "Dernière modification le" + +#~ msgid "Notes" +#~ msgstr "Notes" + +#~ msgid "Ok" +#~ msgstr "Ok" + +#~ msgid "Pop-up to show errors on intrastat report generation" +#~ msgstr "" +#~ "Pop-up qui affiche les erreurs lors de la génération du rapport intrastat" + +#~ msgid "The VAT number is not set for the partner '%s'." +#~ msgstr "Numéro de TVA non renseigné sur le partenaire '%s'." + +#~ msgid "" +#~ "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'" +#~ msgstr "" +#~ "L'option 'Est un frais accessoire' ne doit être activée que sur des " +#~ "articles de service. Vous avez activé cette option pour l'article '%s' " +#~ "qui est de type '%s'" + #~ msgid "Company not yet set on intrastat report." #~ msgstr "Société non configurée sur le rapport DEB/DES." From 989262498d63abfbb6a5c864bc4d0883544c1091 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 27 Dec 2022 22:38:02 +0100 Subject: [PATCH 64/90] [MIG] intrastat_base to v16 --- intrastat_base/__manifest__.py | 8 +-- intrastat_base/demo/intrastat_demo.xml | 62 ++++++++++++++--- intrastat_base/models/__init__.py | 1 - .../models/account_chart_template.py | 2 +- .../models/account_fiscal_position.py | 2 +- .../account_fiscal_position_template.py | 2 +- intrastat_base/models/account_move.py | 2 +- intrastat_base/models/product_template.py | 2 +- intrastat_base/models/res_company.py | 2 +- intrastat_base/models/res_partner.py | 67 ------------------- .../views/account_fiscal_position.xml | 16 ++++- intrastat_base/views/intrastat.xml | 4 +- intrastat_base/views/product_template.xml | 2 +- intrastat_base/views/res_config_settings.xml | 6 +- intrastat_base/views/res_partner.xml | 2 +- intrastat_base/wizards/res_config_settings.py | 4 +- 16 files changed, 86 insertions(+), 98 deletions(-) delete mode 100644 intrastat_base/models/res_partner.py 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). From 5b07b6fb1f77eb45682afb545298cadb2859e7d7 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 8 Feb 2023 10:08:30 +0100 Subject: [PATCH 65/90] intrastat_base: intrastat field is now a selection field intrastat field on account.fiscal.position is now a selection field with 3 values : b2b/b2c/no Add views on account.fiscal.position.template --- intrastat_base/__manifest__.py | 1 + .../models/account_fiscal_position.py | 43 +++++++++++++++-- .../account_fiscal_position_template.py | 13 +++-- intrastat_base/models/account_move.py | 2 +- intrastat_base/tests/test_all.py | 18 +++++++ .../views/account_fiscal_position.xml | 11 ++++- .../account_fiscal_position_template.xml | 48 +++++++++++++++++++ 7 files changed, 127 insertions(+), 9 deletions(-) create mode 100644 intrastat_base/views/account_fiscal_position_template.xml diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index d574ac5..8bd97fb 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -20,6 +20,7 @@ "views/res_config_settings.xml", "views/intrastat.xml", "views/account_fiscal_position.xml", + "views/account_fiscal_position_template.xml", ], "demo": ["demo/intrastat_demo.xml"], "installable": True, diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py index dfb9be3..f7d5ba8 100644 --- a/intrastat_base/models/account_fiscal_position.py +++ b/intrastat_base/models/account_fiscal_position.py @@ -2,13 +2,50 @@ # @author: # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from odoo import fields, models +from odoo import _, api, fields, models +from odoo.exceptions import ValidationError class AccountFiscalPosition(models.Model): _inherit = "account.fiscal.position" - intrastat = fields.Boolean( - help="Set to True if the invoices with this fiscal position should " + intrastat = fields.Selection( + "_intrastat_selection", + help="When set to B2B or B2C, the invoices with this fiscal position will " "be taken into account for the generation of the intrastat reports.", ) + + @api.model + def _intrastat_selection(self): + return [ + ("b2b", _("B2B")), + ("b2c", _("B2C")), + ("no", _("No")), + ] + + @api.constrains("intrastat", "vat_required") + def _check_intrastat(self): + for position in self: + if position.intrastat == "b2b" and not position.vat_required: + raise ValidationError( + _( + "The fiscal position '%s' has intrastat set to B2B, " + "so the option 'VAT Required' must be enabled." + ) + % position.display_name + ) + elif position.intrastat == "b2c" and position.vat_required: + raise ValidationError( + _( + "The fiscal position '%s' has intrastat set to B2C, " + "so the option 'VAT Required' mustn't be enabled." + ) + % position.display_name + ) + + @api.onchange("intrastat", "vat_required") + def intrastat_change(self): + if self.intrastat == "b2b" and not self.vat_required: + self.vat_required = True + elif self.intrastat == "b2c" and self.vat_required: + self.vat_required = False diff --git a/intrastat_base/models/account_fiscal_position_template.py b/intrastat_base/models/account_fiscal_position_template.py index 8b6c51e..e4dd231 100644 --- a/intrastat_base/models/account_fiscal_position_template.py +++ b/intrastat_base/models/account_fiscal_position_template.py @@ -1,13 +1,18 @@ # 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 +from odoo import api, fields, models class AccountFiscalPositionTemplate(models.Model): _inherit = "account.fiscal.position.template" - intrastat = fields.Boolean( - help="Check this if you want to generate intrastat declarations with" - "the created fiscal position", + intrastat = fields.Selection( + "_intrastat_selection", + help="When set to B2B or B2C, the invoices with this fiscal position will " + "be taken into account for the generation of the intrastat reports.", ) + + @api.model + def _intrastat_selection(self): + return self.env["account.fiscal.position"]._intrastat_selection() diff --git a/intrastat_base/models/account_move.py b/intrastat_base/models/account_move.py index 83c13cb..8ef5269 100644 --- a/intrastat_base/models/account_move.py +++ b/intrastat_base/models/account_move.py @@ -8,7 +8,7 @@ from odoo import fields, models class AccountMove(models.Model): _inherit = "account.move" - intrastat_fiscal_position = fields.Boolean( + intrastat_fiscal_position = fields.Selection( related="fiscal_position_id.intrastat", store=True, string="Intrastat Fiscal Position", diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py index 40b414f..70913a6 100644 --- a/intrastat_base/tests/test_all.py +++ b/intrastat_base/tests/test_all.py @@ -28,3 +28,21 @@ class TestIntrastatBase(IntrastatCommon): def test_accessory(self): with self.assertRaises(ValidationError): self.shipping_cost.type = "consu" + + def test_fiscal_position(self): + with self.assertRaises(ValidationError): + self.env["account.fiscal.position"].create( + { + "name": "TestB2B", + "vat_required": False, + "intrastat": "b2b", + } + ) + with self.assertRaises(ValidationError): + self.env["account.fiscal.position"].create( + { + "name": "TestB2C", + "vat_required": True, + "intrastat": "b2c", + } + ) diff --git a/intrastat_base/views/account_fiscal_position.xml b/intrastat_base/views/account_fiscal_position.xml index a52b5b4..7c7dbfb 100644 --- a/intrastat_base/views/account_fiscal_position.xml +++ b/intrastat_base/views/account_fiscal_position.xml @@ -32,11 +32,20 @@ + + + + + diff --git a/intrastat_base/views/account_fiscal_position_template.xml b/intrastat_base/views/account_fiscal_position_template.xml new file mode 100644 index 0000000..ca8111d --- /dev/null +++ b/intrastat_base/views/account_fiscal_position_template.xml @@ -0,0 +1,48 @@ + + + + + intrastat.account.fiscal.position.form + account.fiscal.position.template + + + + + + + + + intrastat.account.fiscal.position.tree + account.fiscal.position.template + + + + + + + + + account.fiscal.position.template + + + + + + + + + + + From 4761e5d8d3e9cf17fafb61d9d81f04d8a7893f03 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Fri, 10 Feb 2023 00:44:21 +0100 Subject: [PATCH 66/90] [FIX] intrastat_base: inherit of account.fiscal.position.template form view --- intrastat_base/views/account_fiscal_position_template.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/views/account_fiscal_position_template.xml b/intrastat_base/views/account_fiscal_position_template.xml index ca8111d..b05a839 100644 --- a/intrastat_base/views/account_fiscal_position_template.xml +++ b/intrastat_base/views/account_fiscal_position_template.xml @@ -10,7 +10,7 @@ account.fiscal.position.template - + From 2cac25590b7d12f0c1a0c347c3a0826f7641dae6 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Sat, 4 Mar 2023 14:06:27 +0000 Subject: [PATCH 67/90] [UPD] Update intrastat_base.pot --- intrastat_base/i18n/intrastat_base.pot | 82 ++++++++++++++++---------- 1 file changed, 51 insertions(+), 31 deletions(-) diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index 2db5f2d..c09e3fd 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -4,7 +4,7 @@ # msgid "" msgstr "" -"Project-Id-Version: Odoo Server 15.0\n" +"Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" "Last-Translator: \n" "Language-Team: \n" @@ -22,10 +22,17 @@ msgid "" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat -msgid "" -"Check this if you want to generate intrastat declarations withthe created " -"fiscal position" +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2B" +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" msgstr "" #. module: intrastat_base @@ -38,11 +45,6 @@ msgstr "" msgid "Config Settings" msgstr "" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner -msgid "Contact" -msgstr "" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" @@ -54,6 +56,8 @@ msgstr "" #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root #: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_filter +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_template_search #: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "" @@ -90,34 +94,25 @@ msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "" #. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "" #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_product_template -msgid "Product Template" -msgstr "" - -#. module: intrastat_base -#: code:addons/intrastat_base/models/res_partner.py:0 +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format -msgid "Programming Error when calling '_get_intrastat_country_code()" +msgid "No" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position -#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat -#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position -#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position -msgid "" -"Set to True if the invoices with this fiscal position should be taken into " -"account for the generation of the intrastat reports." +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" msgstr "" #. module: intrastat_base -#: model:product.product,name:intrastat_base.shipping_costs_exclude #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template msgid "Shipping costs" msgstr "" @@ -128,6 +123,25 @@ msgid "Template for Fiscal Position" msgstr "" #. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " +"Required' must be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " +"Required' mustn't be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/product_template.py:0 #, python-format msgid "" @@ -137,12 +151,7 @@ msgid "" msgstr "" #. module: intrastat_base -#: model:product.product,uom_name:intrastat_base.shipping_costs_exclude -#: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "Units" -msgstr "" - -#. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Unknown Error" @@ -153,3 +162,14 @@ msgstr "" #: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "" +"When set to B2B or B2C, the invoices with this fiscal position will be taken" +" into account for the generation of the intrastat reports." +msgstr "" From bcbcc32d1305927b7a5eb5dbcc3d363e875d4e85 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sat, 4 Mar 2023 14:09:25 +0000 Subject: [PATCH 68/90] [UPD] README.rst --- intrastat_base/README.rst | 10 +++++----- intrastat_base/static/description/index.html | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index 86532cd..ae9c937 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -14,13 +14,13 @@ Intrastat Reporting Base :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fintrastat--extrastat-lightgray.png?logo=github - :target: https://github.com/OCA/intrastat-extrastat/tree/15.0/intrastat_base + :target: https://github.com/OCA/intrastat-extrastat/tree/16.0/intrastat_base :alt: OCA/intrastat-extrastat .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/intrastat-extrastat-15-0/intrastat-extrastat-15-0-intrastat_base + :target: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/15.0 + :target: https://runbot.odoo-community.org/runbot/227/16.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -66,7 +66,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -`feedback `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -113,6 +113,6 @@ Current `maintainers `__: |maintainer-alexis-via| |maintainer-luc-demeyer| -This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. +This module is part of the `OCA/intrastat-extrastat `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html index afc4c9a..95669a8 100644 --- a/intrastat_base/static/description/index.html +++ b/intrastat_base/static/description/index.html @@ -367,7 +367,7 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

    Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

    +

    Beta License: AGPL-3 OCA/intrastat-extrastat Translate me on Weblate Try me on Runbot

    This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module intrastat_product and with the country-specific reporting modules such @@ -412,7 +412,7 @@ you should uninstall it first before installing this module.

    Bugs are tracked on GitHub Issues. In case of trouble, please check there if your issue has already been reported. If you spotted it first, help us smashing it by providing a detailed and welcomed -feedback.

    +feedback.

    Do not contact contributors directly about support or help with technical issues.

    @@ -444,7 +444,7 @@ mission is to support the collaborative development of Odoo features and promote its widespread use.

    Current maintainers:

    alexis-via luc-demeyer

    -

    This module is part of the OCA/intrastat-extrastat project on GitHub.

    +

    This module is part of the OCA/intrastat-extrastat project on GitHub.

    You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

    From f815d052741bea04097402f3ed281a75e9ddc477 Mon Sep 17 00:00:00 2001 From: Weblate Date: Sat, 4 Mar 2023 16:06:42 +0000 Subject: [PATCH 69/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 95 ++++++++++++++++++++++++++------------- 1 file changed, 63 insertions(+), 32 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index d1db811..ee57609 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -29,10 +29,17 @@ msgstr "" "la DEB et la DES." #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat -msgid "" -"Check this if you want to generate intrastat declarations withthe created " -"fiscal position" +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2B" +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" msgstr "" #. module: intrastat_base @@ -45,11 +52,6 @@ msgstr "Sociétés" msgid "Config Settings" msgstr "Configuration" -#. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_res_partner -msgid "Contact" -msgstr "" - #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" @@ -61,6 +63,8 @@ msgstr "Position fiscale" #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root #: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root #: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_filter +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_template_search #: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" msgstr "DEB/DES" @@ -97,36 +101,25 @@ msgid "List of emails of Users Receiving the Intrastat Reminder" msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" #. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Missing e-mail address on user '%s'." msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." #. module: intrastat_base -#: model:ir.model,name:intrastat_base.model_product_template -msgid "Product Template" -msgstr "Modèle d'article" - -#. module: intrastat_base -#: code:addons/intrastat_base/models/res_partner.py:0 +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format -msgid "Programming Error when calling '_get_intrastat_country_code()" +msgid "No" msgstr "" #. module: intrastat_base -#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position -#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat -#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position -#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position -msgid "" -"Set to True if the invoices with this fiscal position should be taken into " -"account for the generation of the intrastat reports." +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" msgstr "" -"Activer si les factures ayant cette position fiscale doivent être " -"sélectionnées pour la génération des rapports intrastat." #. module: intrastat_base -#: model:product.product,name:intrastat_base.shipping_costs_exclude #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template msgid "Shipping costs" msgstr "Frais de port" @@ -137,6 +130,25 @@ msgid "Template for Fiscal Position" msgstr "Modèle de position fiscale" #. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " +"Required' must be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " +"Required' mustn't be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/product_template.py:0 #, python-format msgid "" @@ -146,12 +158,7 @@ msgid "" msgstr "" #. module: intrastat_base -#: model:product.product,uom_name:intrastat_base.shipping_costs_exclude -#: model:product.template,uom_name:intrastat_base.shipping_costs_exclude_product_template -msgid "Units" -msgstr "Unités" - -#. module: intrastat_base +#. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Unknown Error" @@ -163,6 +170,30 @@ msgstr "Erreur inconnue" msgid "Users Receiving the Intrastat Reminder" msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "" +"When set to B2B or B2C, the invoices with this fiscal position will be taken " +"into account for the generation of the intrastat reports." +msgstr "" + +#~ msgid "Product Template" +#~ msgstr "Modèle d'article" + +#~ msgid "" +#~ "Set to True if the invoices with this fiscal position should be taken " +#~ "into account for the generation of the intrastat reports." +#~ msgstr "" +#~ "Activer si les factures ayant cette position fiscale doivent être " +#~ "sélectionnées pour la génération des rapports intrastat." + +#~ msgid "Units" +#~ msgstr "Unités" + #~ msgid "Account Chart Template" #~ msgstr "Modèle de plan comptable" From c79c0aaf63b3d5f17b9f0632724112d618d1520e Mon Sep 17 00:00:00 2001 From: "Sandrine (ACSONE)" Date: Fri, 26 May 2023 13:18:21 +0000 Subject: [PATCH 70/90] Translated using Weblate (French) Currently translated at 100.0% (23 of 23 strings) Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/fr/ --- intrastat_base/i18n/fr.po | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index ee57609..8786383 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -7,15 +7,15 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-29 09:52+0000\n" -"PO-Revision-Date: 2021-07-04 21:48+0000\n" -"Last-Translator: Alexis de Lattre \n" +"PO-Revision-Date: 2023-05-26 16:08+0000\n" +"Last-Translator: \"Sandrine (ACSONE)\" \n" "Language-Team: \n" "Language: fr\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n > 1;\n" -"X-Generator: Weblate 4.3.2\n" +"X-Generator: Weblate 4.17\n" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost @@ -33,14 +33,14 @@ msgstr "" #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "B2B" -msgstr "" +msgstr "B2B" #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "B2C" -msgstr "" +msgstr "B2C" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_company @@ -80,7 +80,7 @@ msgstr "Position fiscale intrastat" #: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost msgid "Is Accessory Cost" -msgstr "" +msgstr "Est un frais accessoire" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_move @@ -112,12 +112,12 @@ msgstr "Adresse e-mail manquante pour l'utilisateur '%s'." #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "No" -msgstr "" +msgstr "Non" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product" -msgstr "" +msgstr "Produit" #. module: intrastat_base #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template @@ -137,6 +137,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " "Required' must be enabled." msgstr "" +"La position fiscale '%s' a un intrastat défini comme B2B, donc l'option 'TVA " +"requise' doit être activée." #. module: intrastat_base #. odoo-python @@ -146,6 +148,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " "Required' mustn't be enabled." msgstr "" +"La position fiscale '%s' a un intrastat défini comme B2C, donc l'option 'TVA " +"requise' ne doit pas être activée." #. module: intrastat_base #. odoo-python @@ -156,6 +160,9 @@ msgid "" "products. You have activated this option for the product '{product_name}' " "which is configured with type '{product_type}'." msgstr "" +"L'option 'Est un frais accessoire ?' ne devrait être activée que sur les " +"produits de type 'Service'. Vous avez activé cette option pour le produit " +"'{product_name}' qui est configuré avec le type '{product_type}'." #. module: intrastat_base #. odoo-python @@ -180,6 +187,8 @@ msgid "" "When set to B2B or B2C, the invoices with this fiscal position will be taken " "into account for the generation of the intrastat reports." msgstr "" +"Quand c'est défini comme B2B ou B2C, les factures avec cette position " +"fiscale seront prises en compte pour la génération des rapports intrastat." #~ msgid "Product Template" #~ msgstr "Modèle d'article" From ca024a8fa7ca6b31e642a74a65f4ab0cfa63de06 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Wed, 7 Jun 2023 16:16:45 +0000 Subject: [PATCH 71/90] Translated using Weblate (French) Currently translated at 100.0% (23 of 23 strings) Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/fr/ --- intrastat_base/i18n/fr.po | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 8786383..6b7cbd6 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -7,8 +7,8 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-29 09:52+0000\n" -"PO-Revision-Date: 2023-05-26 16:08+0000\n" -"Last-Translator: \"Sandrine (ACSONE)\" \n" +"PO-Revision-Date: 2023-06-07 19:08+0000\n" +"Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "Language: fr\n" "MIME-Version: 1.0\n" @@ -26,7 +26,7 @@ msgid "" msgstr "" "Activer cette option pour les frais de port, les frais d'emballage et tous " "les services associés à la vente de produits. Cette option est utilisée pour " -"la DEB et la DES." +"l'EMEBI et la DES." #. module: intrastat_base #. odoo-python @@ -67,7 +67,7 @@ msgstr "Position fiscale" #: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_template_search #: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" -msgstr "DEB/DES" +msgstr "EMEBI/DES" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position @@ -93,12 +93,12 @@ msgstr "Pièce comptable" msgid "" "List of Odoo users who will receive a notification to remind them about the " "Intrastat declaration." -msgstr "Liste d'utilisateurs Odoo qui recevront un rappel pour la DEB/DES." +msgstr "Liste d'utilisateurs Odoo qui recevront un rappel pour l'EMEBI/DES." #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list msgid "List of emails of Users Receiving the Intrastat Reminder" -msgstr "Liste des emails des utilisateurs qui reçoivent le rappel DEB/DES" +msgstr "Liste des emails des utilisateurs qui reçoivent le rappel EMEBI/DES" #. module: intrastat_base #. odoo-python @@ -117,7 +117,7 @@ msgstr "Non" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product" -msgstr "Produit" +msgstr "Article" #. module: intrastat_base #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template @@ -137,8 +137,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " "Required' must be enabled." msgstr "" -"La position fiscale '%s' a un intrastat défini comme B2B, donc l'option 'TVA " -"requise' doit être activée." +"Sur la position fiscale '%s', le champ 'Intrastat' est configuré en 'B2B', " +"donc l'option 'TVA requise' doit être activée." #. module: intrastat_base #. odoo-python @@ -148,8 +148,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " "Required' mustn't be enabled." msgstr "" -"La position fiscale '%s' a un intrastat défini comme B2C, donc l'option 'TVA " -"requise' ne doit pas être activée." +"Sur la position fiscale '%s', le champ 'Intrastat' est configuré en 'B2C', " +"donc l'option 'TVA requise' ne doit pas être activée." #. module: intrastat_base #. odoo-python @@ -175,7 +175,7 @@ msgstr "Erreur inconnue" #: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids #: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" -msgstr "Utilisateurs qui reçoivent le rappel DEB/DES" +msgstr "Utilisateurs qui reçoivent le rappel EMEBI/DES" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position @@ -187,8 +187,9 @@ msgid "" "When set to B2B or B2C, the invoices with this fiscal position will be taken " "into account for the generation of the intrastat reports." msgstr "" -"Quand c'est défini comme B2B ou B2C, les factures avec cette position " -"fiscale seront prises en compte pour la génération des rapports intrastat." +"Quand ce champ est configuré en 'B2B' ou 'B2C', les factures avec cette " +"position fiscale seront prises en compte pour la génération des rapports " +"EMEBI/DES." #~ msgid "Product Template" #~ msgstr "Modèle d'article" From d00ee75b5375bed3959d9ec31460b9419ec094ba Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Thu, 8 Jun 2023 01:31:20 +0200 Subject: [PATCH 72/90] intrastat_base: fix string formatting --- intrastat_base/models/product_template.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py index b8da8d2..f4c3ae8 100644 --- a/intrastat_base/models/product_template.py +++ b/intrastat_base/models/product_template.py @@ -23,12 +23,13 @@ class ProductTemplate(models.Model): _( "The option 'Is accessory cost?' should only be " "activated on 'Service' products. You have activated " - "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 option for the product '%(product_name)s' which is " + "configured with type '%(product_type)s'." + ) + % { + "product_name": this.display_name, + "product_type": this._fields["type"].convert_to_export( this.type, this ), - ) + } ) From 961b29cfa53197e99ed27dd9220877e0692599d8 Mon Sep 17 00:00:00 2001 From: oca-ci Date: Fri, 9 Jun 2023 12:56:44 +0000 Subject: [PATCH 73/90] [UPD] Update intrastat_base.pot --- intrastat_base/i18n/intrastat_base.pot | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot index c09e3fd..143a29d 100644 --- a/intrastat_base/i18n/intrastat_base.pot +++ b/intrastat_base/i18n/intrastat_base.pot @@ -146,8 +146,8 @@ msgstr "" #, python-format msgid "" "The option 'Is accessory cost?' should only be activated on 'Service' " -"products. You have activated this option for the product '{product_name}' " -"which is configured with type '{product_type}'." +"products. You have activated this option for the product '%(product_name)s' " +"which is configured with type '%(product_type)s'." msgstr "" #. module: intrastat_base From 69e603af8678ab4d03f2c67b59a13c3c1fa14370 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Fri, 9 Jun 2023 12:59:08 +0000 Subject: [PATCH 74/90] intrastat_base 16.0.1.1.0 --- intrastat_base/__manifest__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py index 8bd97fb..82597f4 100644 --- a/intrastat_base/__manifest__.py +++ b/intrastat_base/__manifest__.py @@ -5,7 +5,7 @@ { "name": "Intrastat Reporting Base", - "version": "16.0.1.0.0", + "version": "16.0.1.1.0", "category": "Intrastat", "license": "AGPL-3", "summary": "Base module for Intrastat reporting", From 8bcca3417b2bf106922943eb116cd490073c5d4d Mon Sep 17 00:00:00 2001 From: Weblate Date: Fri, 9 Jun 2023 12:59:16 +0000 Subject: [PATCH 75/90] Update translation files Updated by "Update PO files to match POT (msgmerge)" hook in Weblate. Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/ --- intrastat_base/i18n/fr.po | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 6b7cbd6..95e2061 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -157,12 +157,9 @@ msgstr "" #, python-format msgid "" "The option 'Is accessory cost?' should only be activated on 'Service' " -"products. You have activated this option for the product '{product_name}' " -"which is configured with type '{product_type}'." +"products. You have activated this option for the product '%(product_name)s' " +"which is configured with type '%(product_type)s'." msgstr "" -"L'option 'Est un frais accessoire ?' ne devrait être activée que sur les " -"produits de type 'Service'. Vous avez activé cette option pour le produit " -"'{product_name}' qui est configuré avec le type '{product_type}'." #. module: intrastat_base #. odoo-python @@ -191,6 +188,16 @@ msgstr "" "position fiscale seront prises en compte pour la génération des rapports " "EMEBI/DES." +#, python-format +#~ msgid "" +#~ "The option 'Is accessory cost?' should only be activated on 'Service' " +#~ "products. You have activated this option for the product '{product_name}' " +#~ "which is configured with type '{product_type}'." +#~ msgstr "" +#~ "L'option 'Est un frais accessoire ?' ne devrait être activée que sur les " +#~ "produits de type 'Service'. Vous avez activé cette option pour le produit " +#~ "'{product_name}' qui est configuré avec le type '{product_type}'." + #~ msgid "Product Template" #~ msgstr "Modèle d'article" From 9ad3d4605c5e93e29cbaef8c8292962c5fa460a5 Mon Sep 17 00:00:00 2001 From: Alexis de Lattre Date: Tue, 20 Jun 2023 14:27:24 +0000 Subject: [PATCH 76/90] Translated using Weblate (French) Currently translated at 100.0% (23 of 23 strings) Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/fr/ --- intrastat_base/i18n/fr.po | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po index 95e2061..174acbe 100644 --- a/intrastat_base/i18n/fr.po +++ b/intrastat_base/i18n/fr.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: Odoo Server 11.0\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2018-12-29 09:52+0000\n" -"PO-Revision-Date: 2023-06-07 19:08+0000\n" +"PO-Revision-Date: 2023-06-20 17:08+0000\n" "Last-Translator: Alexis de Lattre \n" "Language-Team: \n" "Language: fr\n" @@ -160,6 +160,9 @@ msgid "" "products. You have activated this option for the product '%(product_name)s' " "which is configured with type '%(product_type)s'." msgstr "" +"L'option 'Est un frais accessoire ?' ne doit être activée que pour les " +"articles de type 'Service'. Vous avez activé cette option pour l'article " +"'%(product_name)s' qui est de type '%(product_type)s'." #. module: intrastat_base #. odoo-python From c7610e66cc87c41ddf151d8a50800a276858b738 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Fri, 4 Aug 2023 10:34:20 +0000 Subject: [PATCH 77/90] Added translation using Weblate (Spanish) --- intrastat_base/i18n/es.po | 176 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 176 insertions(+) create mode 100644 intrastat_base/i18n/es.po diff --git a/intrastat_base/i18n/es.po b/intrastat_base/i18n/es.po new file mode 100644 index 0000000..75dd4b3 --- /dev/null +++ b/intrastat_base/i18n/es.po @@ -0,0 +1,176 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"Last-Translator: Automatically generated\n" +"Language-Team: none\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,help:intrastat_base.field_product_template__is_accessory_cost +msgid "" +"Activate this option for shipping costs, packaging costs and all services " +"related to the sale of products. This option is used for Intrastat reports." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2B" +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_fiscal_position +msgid "Fiscal Position" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position_template__intrastat +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_base_root +#: model:ir.ui.menu,name:intrastat_base.menu_intrastat_config_root +#: model_terms:ir.ui.view,arch_db:intrastat_base.product_template_form_view +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_filter +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_template_search +#: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings +msgid "Intrastat" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,field_description:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,field_description:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "Intrastat Fiscal Position" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost +#: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost +msgid "Is Accessory Cost" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,help:intrastat_base.field_res_config_settings__intrastat_remind_user_ids +msgid "" +"List of Odoo users who will receive a notification to remind them about the " +"Intrastat declaration." +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list +msgid "List of emails of Users Receiving the Intrastat Reminder" +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/res_company.py:0 +#, python-format +msgid "Missing e-mail address on user '%s'." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "No" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" +msgstr "" + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_fiscal_position_template +msgid "Template for Fiscal Position" +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " +"Required' must be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "" +"The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " +"Required' mustn't be enabled." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/product_template.py:0 +#, python-format +msgid "" +"The option 'Is accessory cost?' should only be activated on 'Service' " +"products. You have activated this option for the product '%(product_name)s' " +"which is configured with type '%(product_type)s'." +msgstr "" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/res_company.py:0 +#, python-format +msgid "Unknown Error" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids +#: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids +msgid "Users Receiving the Intrastat Reminder" +msgstr "" + +#. module: intrastat_base +#: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_fiscal_position_template__intrastat +#: model:ir.model.fields,help:intrastat_base.field_account_move__intrastat_fiscal_position +#: model:ir.model.fields,help:intrastat_base.field_account_payment__intrastat_fiscal_position +msgid "" +"When set to B2B or B2C, the invoices with this fiscal position will be taken" +" into account for the generation of the intrastat reports." +msgstr "" From a7c9a3c7471a936a466373490b045a7e0b6fb1a2 Mon Sep 17 00:00:00 2001 From: Ivorra78 Date: Fri, 4 Aug 2023 10:34:50 +0000 Subject: [PATCH 78/90] Translated using Weblate (Spanish) Currently translated at 100.0% (23 of 23 strings) Translation: intrastat-extrastat-16.0/intrastat-extrastat-16.0-intrastat_base Translate-URL: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base/es/ --- intrastat_base/i18n/es.po | 52 +++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 18 deletions(-) diff --git a/intrastat_base/i18n/es.po b/intrastat_base/i18n/es.po index 75dd4b3..34ed8b1 100644 --- a/intrastat_base/i18n/es.po +++ b/intrastat_base/i18n/es.po @@ -6,13 +6,15 @@ msgid "" msgstr "" "Project-Id-Version: Odoo Server 16.0\n" "Report-Msgid-Bugs-To: \n" -"Last-Translator: Automatically generated\n" +"PO-Revision-Date: 2023-08-04 13:10+0000\n" +"Last-Translator: Ivorra78 \n" "Language-Team: none\n" "Language: es\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: \n" "Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.17\n" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_product_product__is_accessory_cost @@ -21,35 +23,38 @@ msgid "" "Activate this option for shipping costs, packaging costs and all services " "related to the sale of products. This option is used for Intrastat reports." msgstr "" +"Active esta opción para costes de envío, costes de embalaje y todos los " +"servicios relacionados con la venta de productos. Esta opción se utiliza " +"para reportes de Instratat." #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "B2B" -msgstr "" +msgstr "B2B" #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "B2C" -msgstr "" +msgstr "B2C" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_company msgid "Companies" -msgstr "" +msgstr "Compañías" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_res_config_settings msgid "Config Settings" -msgstr "" +msgstr "Ajustes de Configuración" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position msgid "Fiscal Position" -msgstr "" +msgstr "Posición fiscal" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__intrastat @@ -61,25 +66,25 @@ msgstr "" #: model_terms:ir.ui.view,arch_db:intrastat_base.view_account_position_template_search #: model_terms:ir.ui.view,arch_db:intrastat_base.view_intrastat_res_config_settings msgid "Intrastat" -msgstr "" +msgstr "Intrastat" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position #: model:ir.model.fields,field_description:intrastat_base.field_account_move__intrastat_fiscal_position #: model:ir.model.fields,field_description:intrastat_base.field_account_payment__intrastat_fiscal_position msgid "Intrastat Fiscal Position" -msgstr "" +msgstr "Posición fiscal Intrastat" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_product_product__is_accessory_cost #: model:ir.model.fields,field_description:intrastat_base.field_product_template__is_accessory_cost msgid "Is Accessory Cost" -msgstr "" +msgstr "Es Coste de Accesorio" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_move msgid "Journal Entry" -msgstr "" +msgstr "Entrada diaria" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_res_company__intrastat_remind_user_ids @@ -88,40 +93,42 @@ msgid "" "List of Odoo users who will receive a notification to remind them about the " "Intrastat declaration." msgstr "" +"Lista de usuarios Odoo que recibirán una notificación para recordarles " +"acerca de la declaración Intrastat." #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_email_list msgid "List of emails of Users Receiving the Intrastat Reminder" -msgstr "" +msgstr "Lista de emails de Usuarios que recibirán un recordatorio Intrastat" #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Missing e-mail address on user '%s'." -msgstr "" +msgstr "Falta la dirección de correo electrónico del usuario '%s'." #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/account_fiscal_position.py:0 #, python-format msgid "No" -msgstr "" +msgstr "No" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_product_template msgid "Product" -msgstr "" +msgstr "Producto" #. module: intrastat_base #: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template msgid "Shipping costs" -msgstr "" +msgstr "Gastos de envío" #. module: intrastat_base #: model:ir.model,name:intrastat_base.model_account_fiscal_position_template msgid "Template for Fiscal Position" -msgstr "" +msgstr "Plantilla de Posición Fiscal" #. module: intrastat_base #. odoo-python @@ -131,6 +138,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2B, so the option 'VAT " "Required' must be enabled." msgstr "" +"La posición fiscal '%s' tiene intrastat establecido en B2B, por lo que la " +"opción 'IVA Requerido' debe estar activada." #. module: intrastat_base #. odoo-python @@ -140,6 +149,8 @@ msgid "" "The fiscal position '%s' has intrastat set to B2C, so the option 'VAT " "Required' mustn't be enabled." msgstr "" +"La posición fiscal '%s' tiene intrastat establecido en B2C, por lo que la " +"opción 'IVA requerido' no debe estar activada." #. module: intrastat_base #. odoo-python @@ -150,19 +161,22 @@ msgid "" "products. You have activated this option for the product '%(product_name)s' " "which is configured with type '%(product_type)s'." msgstr "" +"La opción '¿El costo del accesorio?' solo debe activarse en productos de " +"'Servicio'. Ha activado esta opción para el producto '%(product_name)s' que " +"está configurado con el tipo '%(product_type)s'." #. module: intrastat_base #. odoo-python #: code:addons/intrastat_base/models/res_company.py:0 #, python-format msgid "Unknown Error" -msgstr "" +msgstr "Error Desconocido" #. module: intrastat_base #: model:ir.model.fields,field_description:intrastat_base.field_res_company__intrastat_remind_user_ids #: model:ir.model.fields,field_description:intrastat_base.field_res_config_settings__intrastat_remind_user_ids msgid "Users Receiving the Intrastat Reminder" -msgstr "" +msgstr "Usuarios Recibiendo el Recordatorio Intrastat" #. module: intrastat_base #: model:ir.model.fields,help:intrastat_base.field_account_bank_statement_line__intrastat_fiscal_position @@ -174,3 +188,5 @@ msgid "" "When set to B2B or B2C, the invoices with this fiscal position will be taken" " into account for the generation of the intrastat reports." msgstr "" +"Cuando se configura en B2B o B2C, las facturas con esta posición fiscal se " +"tendrán en cuenta para la generación de los informes intrastat." From b588c0a9e80deae0866ad711e53ce7c456b84650 Mon Sep 17 00:00:00 2001 From: OCA-git-bot Date: Sun, 3 Sep 2023 13:16:44 +0000 Subject: [PATCH 79/90] [UPD] README.rst --- intrastat_base/README.rst | 15 ++++--- intrastat_base/static/description/index.html | 44 ++++++++++---------- 2 files changed, 32 insertions(+), 27 deletions(-) diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst index ae9c937..8566f78 100644 --- a/intrastat_base/README.rst +++ b/intrastat_base/README.rst @@ -2,10 +2,13 @@ Intrastat Reporting Base ======================== -.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:28aa058f14d9b8414cad83bafa1c8d416330287450167531b2787c4d47348560 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! .. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png :target: https://odoo-community.org/page/development-status @@ -19,11 +22,11 @@ Intrastat Reporting Base .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png :target: https://translation.odoo-community.org/projects/intrastat-extrastat-16-0/intrastat-extrastat-16-0-intrastat_base :alt: Translate me on Weblate -.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/227/16.0 - :alt: Try me on Runbot +.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png + :target: https://runboat.odoo-community.org/builds?repo=OCA/intrastat-extrastat&target_branch=16.0 + :alt: Try me on Runboat -|badge1| |badge2| |badge3| |badge4| |badge5| +|badge1| |badge2| |badge3| |badge4| |badge5| This module contains common functions for the intrastat reporting and should be used in combination with the generic reporting module @@ -65,7 +68,7 @@ Bug Tracker Bugs are tracked on `GitHub Issues `_. In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed +If you spotted it first, help us to smash it by providing a detailed and welcomed `feedback `_. Do not contact contributors directly about support or help with technical issues. diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html index 95669a8..4dd24ea 100644 --- a/intrastat_base/static/description/index.html +++ b/intrastat_base/static/description/index.html @@ -1,20 +1,20 @@ - + - + Intrastat Reporting Base