diff --git a/intrastat_base/README.rst b/intrastat_base/README.rst new file mode 100644 index 0000000..bbc6522 --- /dev/null +++ b/intrastat_base/README.rst @@ -0,0 +1,123 @@ +======================== +Intrastat Reporting Base +======================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:7ea7f7b4a4bf87827db491ee111dfb108b983fc85c32d67ad555da2497416917 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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/18.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-18-0/intrastat-extrastat-18-0-intrastat_base + :alt: Translate me on Weblate +.. |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=18.0 + :alt: Try me on Runboat + +|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 +*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** + +.. contents:: + :local: + +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 fiscal positions. + +With this module, the country field on partners becomes a required +field. + +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 to smash it by providing a detailed and welcomed +`feedback `_. + +Do not contact contributors directly about support or help with technical issues. + +Credits +======= + +Authors +------- + +* ACSONE SA/NV +* Akretion +* Noviat + +Contributors +------------ + +- Alexis de Lattre, Akretion +- Luc De Meyer, Noviat +- Kumar Aberer, brain-tec AG +- Andrea Stirpe +- Denis Roussel + +Maintainers +----------- + +This module is maintained by the OCA. + +.. image:: https://odoo-community.org/logo.png + :alt: Odoo Community Association + :target: https://odoo-community.org + +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. + +.. |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/__init__.py b/intrastat_base/__init__.py new file mode 100644 index 0000000..aee8895 --- /dev/null +++ b/intrastat_base/__init__.py @@ -0,0 +1,2 @@ +from . import models +from . import wizards diff --git a/intrastat_base/__manifest__.py b/intrastat_base/__manifest__.py new file mode 100644 index 0000000..108088a --- /dev/null +++ b/intrastat_base/__manifest__.py @@ -0,0 +1,26 @@ +# 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": "18.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"], + "data": [ + "views/product_template.xml", + "views/res_partner.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/demo/intrastat_demo.xml b/intrastat_base/demo/intrastat_demo.xml new file mode 100644 index 0000000..f19b285 --- /dev/null +++ b/intrastat_base/demo/intrastat_demo.xml @@ -0,0 +1,71 @@ + + + + + FR58441019213 + + + + 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 + SHIP_S + service + + 30 + + + diff --git a/intrastat_base/i18n/es.po b/intrastat_base/i18n/es.po new file mode 100644 index 0000000..225b293 --- /dev/null +++ b/intrastat_base/i18n/es.po @@ -0,0 +1,187 @@ +# 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" +"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 +#: 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 "" +"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 "B2B" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" +msgstr "B2C" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes de Configuración" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_fiscal_position +msgid "Fiscal Position" +msgstr "Posición fiscal" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__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_intrastat_res_config_settings +msgid "Intrastat" +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 "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 "Es Coste de Accesorio" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_move +msgid "Journal Entry" +msgstr "Entrada diaria" + +#. 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 "" +"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 "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 "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 "No" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" +msgstr "Producto" + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "Gastos de envío" + +#. 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 "" +"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 +#: 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 "" +"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 +#: 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 "" +"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 "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 "Usuarios Recibiendo el Recordatorio Intrastat" + +#. 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 "" +"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." + +#~ msgid "Template for Fiscal Position" +#~ msgstr "Plantilla de Posición Fiscal" diff --git a/intrastat_base/i18n/fr.po b/intrastat_base/i18n/fr.po new file mode 100644 index 0000000..a94fd85 --- /dev/null +++ b/intrastat_base/i18n/fr.po @@ -0,0 +1,323 @@ +# 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: 2023-06-20 17:08+0000\n" +"Last-Translator: Alexis de Lattre \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.17\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 " +"l'EMEBI et la DES." + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2B" +msgstr "B2B" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" +msgstr "B2C" + +#. 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_config_settings +msgid "Config Settings" +msgstr "Configuration" + +#. 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_fiscal_position__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_intrastat_res_config_settings +msgid "Intrastat" +msgstr "EMEBI/DES" + +#. 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 "Position fiscale 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 "Est un frais accessoire" + +#. 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,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 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 EMEBI/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 +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "No" +msgstr "Non" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" +msgstr "Article" + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "Frais de port" + +#. 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 "" +"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 +#: 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 "" +"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 +#: 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 "" +"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 +#: code:addons/intrastat_base/models/res_company.py:0 +#, python-format +msgid "Unknown Error" +msgstr "Erreur inconnue" + +#. 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 EMEBI/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_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 "" +"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 "Template for Fiscal Position" +#~ msgstr "Modèle de position fiscale" + +#, 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" + +#~ 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" + +#~ 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." + +#~ 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" + +#~ 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." diff --git a/intrastat_base/i18n/intrastat_base.pot b/intrastat_base/i18n/intrastat_base.pot new file mode 100644 index 0000000..5796c7a --- /dev/null +++ b/intrastat_base/i18n/intrastat_base.pot @@ -0,0 +1,167 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \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 "" + +#. 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.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_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 +#. 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_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 "" diff --git a/intrastat_base/i18n/it.po b/intrastat_base/i18n/it.po new file mode 100644 index 0000000..9a532b2 --- /dev/null +++ b/intrastat_base/i18n/it.po @@ -0,0 +1,184 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * intrastat_base +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-04-04 11:38+0000\n" +"Last-Translator: mymage \n" +"Language-Team: none\n" +"Language: it\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 +#: 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 "" +"Attivare questa opzione per i costi i spedizione, costi di imballaggio e " +"tutti i servizi relativi alla vendita del prodtto. Questa opzione è " +"utilizzata dai resoconti Intrastat." + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2B" +msgstr "B2B" + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "B2C" +msgstr "B2C" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_fiscal_position +msgid "Fiscal Position" +msgstr "Posizione fiscale" + +#. module: intrastat_base +#: model:ir.model.fields,field_description:intrastat_base.field_account_fiscal_position__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_intrastat_res_config_settings +msgid "Intrastat" +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 "Posizione fiscale 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 "È un costo accessorio" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. 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 "" +"Elenco degli utenti Odoo che riceveranno una notifica promemoria della " +"dichiarazione 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 "Elenco e-mail degli utenti che riceveranno il promemoria 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 "Indirizzo e-mail mancante per l'utente '%s'." + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/account_fiscal_position.py:0 +#, python-format +msgid "No" +msgstr "No" + +#. module: intrastat_base +#: model:ir.model,name:intrastat_base.model_product_template +msgid "Product" +msgstr "Prodotto" + +#. module: intrastat_base +#: model:product.template,name:intrastat_base.shipping_costs_exclude_product_template +msgid "Shipping costs" +msgstr "Costi di spedizione" + +#. 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 "" +"La poszione fiscale '%s' ha l'Intrastat impostato a B2B, pertanto l'opzione " +"'IVA richiesta' deve essere abilitata." + +#. 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 "" +"La poszione fiscale '%s' ha l'Intrastat impostato a B2C, pertanto l'opzione " +"'IVA richiesta' non deve essere abilitata." + +#. 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 "" +"L'opzione \"È un costo accessorio?\" deve essere attivata solo su prodotti " +"'Servizio'. È stata attivata l'opzione per il prdotto '%(product_name)s' che " +"è configurato come tipo '%(product_type)s'." + +#. module: intrastat_base +#. odoo-python +#: code:addons/intrastat_base/models/res_company.py:0 +#, python-format +msgid "Unknown Error" +msgstr "Errore sconosciuto" + +#. 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 "Utenti che ricevono il promemoria Intrastat" + +#. 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 "" +"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 "" +"Quando impostata a B2B o B2C, le fatture con questa posizione fiscale " +"verranno prese in considerazione per la generazione dei resoconti Intrastat." diff --git a/intrastat_base/models/__init__.py b/intrastat_base/models/__init__.py new file mode 100644 index 0000000..8e78bef --- /dev/null +++ b/intrastat_base/models/__init__.py @@ -0,0 +1,4 @@ +from . import product_template +from . import res_company +from . import account_fiscal_position +from . import account_move diff --git a/intrastat_base/models/account_fiscal_position.py b/intrastat_base/models/account_fiscal_position.py new file mode 100644 index 0000000..f7d5ba8 --- /dev/null +++ b/intrastat_base/models/account_fiscal_position.py @@ -0,0 +1,51 @@ +# 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 _, api, fields, models +from odoo.exceptions import ValidationError + + +class AccountFiscalPosition(models.Model): + _inherit = "account.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 [ + ("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_move.py b/intrastat_base/models/account_move.py new file mode 100644 index 0000000..8ef5269 --- /dev/null +++ b/intrastat_base/models/account_move.py @@ -0,0 +1,15 @@ +# 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 + + +class AccountMove(models.Model): + _inherit = "account.move" + + intrastat_fiscal_position = fields.Selection( + related="fiscal_position_id.intrastat", + store=True, + string="Intrastat Fiscal Position", + ) diff --git a/intrastat_base/models/product_template.py b/intrastat_base/models/product_template.py new file mode 100644 index 0000000..f4c3ae8 --- /dev/null +++ b/intrastat_base/models/product_template.py @@ -0,0 +1,35 @@ +# Copyright 2010-2022 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 +from odoo.exceptions import ValidationError + + +class ProductTemplate(models.Model): + _inherit = "product.template" + + is_accessory_cost = fields.Boolean( + 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.", + ) + + @api.constrains("type", "is_accessory_cost") + 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 '%(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 + ), + } + ) diff --git a/intrastat_base/models/res_company.py b/intrastat_base/models/res_company.py new file mode 100644 index 0000000..f95cd7d --- /dev/null +++ b/intrastat_base/models/res_company.py @@ -0,0 +1,72 @@ +# Copyright 2013-2022 Akretion France (http://www.akretion.com/) +# @author: +# 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 ResCompany(models.Model): + _inherit = "res.company" + + intrastat_remind_user_ids = fields.Many2many( + comodel_name="res.users", + relation="company_intrastat_reminder_user_rel", + 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.", + ) + intrastat_email_list = fields.Char( + 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") + def _compute_intrastat_email_list(self): + for this in self: + emails = [ + user.email for user in this.intrastat_remind_user_ids if user.email + ] + this.intrastat_email_list = ",".join(emails) + + @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) + ) + + @api.model + def _intrastat_check_xml_schema(self, xml_bytes, xsd_file): + """Validate the XML file against the XSD""" + with tools.file_open(xsd_file, mode="rb") as f: + xsd_etree_obj = etree.parse(f) + 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 = f"{e.__class__.__name__}\n\n{str(e)}" + raise UserError(usererror) from e + except Exception as e: + error = _("Unknown Error") + tb = "".join(format_exception(*exc_info())) + error += f"\n{tb}" + logger.warning(error) + raise UserError(error) from e diff --git a/intrastat_base/pyproject.toml b/intrastat_base/pyproject.toml new file mode 100644 index 0000000..4231d0c --- /dev/null +++ b/intrastat_base/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/intrastat_base/readme/CONTRIBUTORS.md b/intrastat_base/readme/CONTRIBUTORS.md new file mode 100644 index 0000000..319b1f5 --- /dev/null +++ b/intrastat_base/readme/CONTRIBUTORS.md @@ -0,0 +1,5 @@ +- Alexis de Lattre, Akretion \<\> +- Luc De Meyer, Noviat \<\> +- Kumar Aberer, brain-tec AG \<\> +- Andrea Stirpe \<\> +- Denis Roussel \<\> diff --git a/intrastat_base/readme/DESCRIPTION.md b/intrastat_base/readme/DESCRIPTION.md new file mode 100644 index 0000000..ed84ff1 --- /dev/null +++ b/intrastat_base/readme/DESCRIPTION.md @@ -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.md b/intrastat_base/readme/INSTALL.md new file mode 100644 index 0000000..ced70fe --- /dev/null +++ b/intrastat_base/readme/INSTALL.md @@ -0,0 +1,6 @@ +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.md b/intrastat_base/readme/USAGE.md new file mode 100644 index 0000000..0024237 --- /dev/null +++ b/intrastat_base/readme/USAGE.md @@ -0,0 +1,6 @@ +This module adds an intrastat property on fiscal positions. + +With this module, the country field on partners becomes a required +field. + +It adds an *Intrastat* section on the *Invoicing* configuration page. diff --git a/intrastat_base/static/description/icon.png b/intrastat_base/static/description/icon.png new file mode 100644 index 0000000..3a0328b Binary files /dev/null and b/intrastat_base/static/description/icon.png differ diff --git a/intrastat_base/static/description/index.html b/intrastat_base/static/description/index.html new file mode 100644 index 0000000..69784ba --- /dev/null +++ b/intrastat_base/static/description/index.html @@ -0,0 +1,459 @@ + + + + + +Intrastat Reporting Base + + + +
+

Intrastat Reporting Base

+ + +

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

+

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 fiscal positions.

+

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

+

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 to smash it by providing a detailed and welcomed +feedback.

+

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

+
+
+

Credits

+
+

Authors

+
    +
  • ACSONE SA/NV
  • +
  • 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.

+

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.

+
+
+
+ + diff --git a/intrastat_base/tests/__init__.py b/intrastat_base/tests/__init__.py new file mode 100644 index 0000000..a2afb4b --- /dev/null +++ b/intrastat_base/tests/__init__.py @@ -0,0 +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..7190bae --- /dev/null +++ b/intrastat_base/tests/common.py @@ -0,0 +1,16 @@ +# Copyright 2021 ACSONE SA/NV +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + + +class IntrastatCommon: + @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") diff --git a/intrastat_base/tests/models.py b/intrastat_base/tests/models.py new file mode 100644 index 0000000..302914c --- /dev/null +++ b/intrastat_base/tests/models.py @@ -0,0 +1,10 @@ +# 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" + _description = "Intrastat Declaration Test" diff --git a/intrastat_base/tests/test_all.py b/intrastat_base/tests/test_all.py new file mode 100644 index 0000000..70913a6 --- /dev/null +++ b/intrastat_base/tests/test_all.py @@ -0,0 +1,48 @@ +from odoo.exceptions import ValidationError + +from .common import IntrastatCommon + + +class TestIntrastatBase(IntrastatCommon): + """Tests for this module""" + + @classmethod + def setUpClass(cls): + super().setUpClass() + + def test_company(self): + # add 'Demo user' to intrastat_remind_user_ids + 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(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_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 new file mode 100644 index 0000000..ffde9da --- /dev/null +++ b/intrastat_base/views/account_fiscal_position.xml @@ -0,0 +1,51 @@ + + + + + intrastat.account.fiscal.position.form + account.fiscal.position + + + + + + + + + intrastat.account.fiscal.position.tree + account.fiscal.position + + + + + + + + + account.fiscal.position + + + + + + + + + + + + + + diff --git a/intrastat_base/views/intrastat.xml b/intrastat_base/views/intrastat.xml new file mode 100644 index 0000000..8469cd7 --- /dev/null +++ b/intrastat_base/views/intrastat.xml @@ -0,0 +1,21 @@ + + + + + + + diff --git a/intrastat_base/views/product_template.xml b/intrastat_base/views/product_template.xml new file mode 100644 index 0000000..be100a5 --- /dev/null +++ b/intrastat_base/views/product_template.xml @@ -0,0 +1,22 @@ + + + + + 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 new file mode 100644 index 0000000..52143eb --- /dev/null +++ b/intrastat_base/views/res_config_settings.xml @@ -0,0 +1,34 @@ + + + + + intrastat.res.config.settings.form + res.config.settings + + + + + +
+
+
+
+
+
+
+
+
+
diff --git a/intrastat_base/views/res_partner.xml b/intrastat_base/views/res_partner.xml new file mode 100644 index 0000000..a715ea7 --- /dev/null +++ b/intrastat_base/views/res_partner.xml @@ -0,0 +1,44 @@ + + + + + + res.partner + + + + 1 + + + 1 + + + + + + res.partner + + + + 1 + + + + + + res.partner + + + + 1 + + + + diff --git a/intrastat_base/wizards/__init__.py b/intrastat_base/wizards/__init__.py new file mode 100644 index 0000000..0deb68c --- /dev/null +++ b/intrastat_base/wizards/__init__.py @@ -0,0 +1 @@ +from . import res_config_settings diff --git a/intrastat_base/wizards/res_config_settings.py b/intrastat_base/wizards/res_config_settings.py new file mode 100644 index 0000000..9806cb4 --- /dev/null +++ b/intrastat_base/wizards/res_config_settings.py @@ -0,0 +1,14 @@ +# 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 odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + intrastat_remind_user_ids = fields.Many2many( + related="company_id.intrastat_remind_user_ids", readonly=False + )