diff --git a/account_einvoice_generate/README.rst b/account_einvoice_generate/README.rst new file mode 100644 index 0000000000..14a121e787 --- /dev/null +++ b/account_einvoice_generate/README.rst @@ -0,0 +1,120 @@ +========================== +Account e-invoice Generate +========================== + +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:70b52d2850bad74fccedb1fa441798b53743b128dc6cb16d4667b2cbc5328609 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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%2Fedi-lightgray.png?logo=github + :target: https://github.com/OCA/edi/tree/18.0/account_einvoice_generate + :alt: OCA/edi +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/edi-18-0/edi-18-0-account_einvoice_generate + :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/edi&target_branch=18.0 + :alt: Try me on Runboat + +|badge1| |badge2| |badge3| |badge4| |badge5| + +This is a technical module that ensure compatibility between the +e-invoice generation modules of the `OCA/edi +project `__. It doesn't bring any feature +by itself. You must also install one of the 2 OCA modules that generate +electronic invoices: + +- **account_invoice_ubl**: add support for the UBL format (Universal + Business Language), +- **account_invoice_facturx**: add support for the + `Factur-X `__ format. + +See the README of each module for more information. + +These 2 modules are able to embed an XML file in the PDF invoice and +this module ensure that these 2 modules are compatible. + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +Before installing the module, you must **uninstall** the module +**account_edi** from the official addons. As the account_edi module is +auto-installable, it is certainly already installed on your Odoo +database. + +For that, go to the *Apps* menu, remove the *Apps* filter, search for +the module *account_edi* (the title of the module is *Import/Export +Invoices From XML/PDF*). Then click on the button *Module info* and then +on the button *Uninstall*. + +Configuration +============= + +The new configuration parameter *XML Format embedded in PDF invoice* is +available in the menu *Invoicing > Configuration > Settings*. + +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 +------- + +* Akretion +* Onestein + +Contributors +------------ + +- Alexis de Lattre +- Andrea Stirpe +- Shine IT + +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 + +Current `maintainer `__: + +|maintainer-alexis-via| + +This module is part of the `OCA/edi `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/account_einvoice_generate/__init__.py b/account_einvoice_generate/__init__.py new file mode 100644 index 0000000000..82fe5e6e1b --- /dev/null +++ b/account_einvoice_generate/__init__.py @@ -0,0 +1,5 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import models +from . import wizards +from .post_install import update_invoice_report_config diff --git a/account_einvoice_generate/__manifest__.py b/account_einvoice_generate/__manifest__.py new file mode 100644 index 0000000000..09552f57a2 --- /dev/null +++ b/account_einvoice_generate/__manifest__.py @@ -0,0 +1,18 @@ +# Copyright 2018-2022 Akretion France (http://www.akretion.com) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Account e-invoice Generate", + "version": "18.0.1.0.0", + "category": "Accounting & Finance", + "license": "AGPL-3", + "summary": "Technical module to generate PDF invoices with " "embedded XML file", + "author": "Akretion,Onestein,Odoo Community Association (OCA)", + "maintainers": ["alexis-via"], + "website": "https://github.com/OCA/edi", + "depends": ["account"], + "data": ["views/res_config_settings.xml"], + "post_init_hook": "update_invoice_report_config", + "installable": True, +} diff --git a/account_einvoice_generate/i18n/account_e-invoice_generate.pot b/account_einvoice_generate/i18n/account_e-invoice_generate.pot new file mode 100644 index 0000000000..b5781de9fa --- /dev/null +++ b/account_einvoice_generate/i18n/account_e-invoice_generate.pot @@ -0,0 +1,57 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_e-invoice_generate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 13.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: account_e-invoice_generate +#: model_terms:ir.ui.view,arch_db:account_e-invoice_generate.view_account_config_settings +msgid "" +"Select Format\n" +" " +msgstr "" + +#. module: account_e-invoice_generate +#: model:ir.model,name:account_e-invoice_generate.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_e-invoice_generate +#: model:ir.model,name:account_e-invoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_e-invoice_generate +#: model_terms:ir.ui.view,arch_db:account_e-invoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "" + +#. module: account_e-invoice_generate +#: model:ir.model,name:account_e-invoice_generate.model_account_move +msgid "Journal Entries" +msgstr "" + +#. module: account_e-invoice_generate +#: model:ir.model.fields.selection,name:account_e-invoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "" + +#. module: account_e-invoice_generate +#: model_terms:ir.ui.view,arch_db:account_e-invoice_generate.view_account_config_settings +msgid "Select the format of your e-invoices." +msgstr "" + +#. module: account_e-invoice_generate +#: model:ir.model.fields,field_description:account_e-invoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_e-invoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "" diff --git a/account_einvoice_generate/i18n/account_einvoice_generate.pot b/account_einvoice_generate/i18n/account_einvoice_generate.pot new file mode 100644 index 0000000000..c4300f5bcf --- /dev/null +++ b/account_einvoice_generate/i18n/account_einvoice_generate.pot @@ -0,0 +1,50 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_einvoice_generate +# +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: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_company +msgid "Companies" +msgstr "" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_einvoice_generate +#: model:ir.model.fields.selection,name:account_einvoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "" + +#. module: account_einvoice_generate +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "XML format attached to your PDF customer invoices" +msgstr "" diff --git a/account_einvoice_generate/i18n/es.po b/account_einvoice_generate/i18n/es.po new file mode 100644 index 0000000000..31348eb96d --- /dev/null +++ b/account_einvoice_generate/i18n/es.po @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_einvoice_generate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-08-07 08:11+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: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_company +msgid "Companies" +msgstr "Compañías" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "Ajustes de Configuración" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "Facturas electrónicas" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_account_move +msgid "Journal Entry" +msgstr "Entrada Diaria" + +#. module: account_einvoice_generate +#: model:ir.model.fields.selection,name:account_einvoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "Ninguno/a" + +#. module: account_einvoice_generate +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "Formato XML integrado en factura PDF" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "XML format attached to your PDF customer invoices" +msgstr "Formato XML adjunto a sus facturas de clientes en PDF" + +#~ msgid "" +#~ "Select Format\n" +#~ " " +#~ msgstr "" +#~ "Seleccionar Formato\n" +#~ " " diff --git a/account_einvoice_generate/i18n/fr.po b/account_einvoice_generate/i18n/fr.po new file mode 100644 index 0000000000..93630809d7 --- /dev/null +++ b/account_einvoice_generate/i18n/fr.po @@ -0,0 +1,64 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_einvoice_generate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 16.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2023-06-27 19:08+0000\n" +"Last-Translator: Alexis de Lattre \n" +"Language-Team: none\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: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_company +msgid "Companies" +msgstr "Sociétés" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "Configuration" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "Factures électroniques" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_account_move +msgid "Journal Entry" +msgstr "Pièce comptable" + +#. module: account_einvoice_generate +#: model:ir.model.fields.selection,name:account_einvoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "Aucun" + +#. module: account_einvoice_generate +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "Format XML embarqué dans la facture PDF" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "XML format attached to your PDF customer invoices" +msgstr "Format XML embarqué à l'intérieur de vos factures clients PDF" + +#~ msgid "" +#~ "Select Format\n" +#~ " " +#~ msgstr "" +#~ "Sélectionner le format\n" +#~ " " diff --git a/account_einvoice_generate/i18n/hr.po b/account_einvoice_generate/i18n/hr.po new file mode 100644 index 0000000000..a94981e151 --- /dev/null +++ b/account_einvoice_generate/i18n/hr.po @@ -0,0 +1,80 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_e-invoice_generate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2019-11-14 16:34+0000\n" +"Last-Translator: Bole \n" +"Language-Team: none\n" +"Language: hr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" +"X-Generator: Weblate 3.8\n" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_company +msgid "Companies" +msgstr "Tvrtke" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "Postavke" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "Elektronički računi" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_account_move +msgid "Journal Entry" +msgstr "" + +#. module: account_einvoice_generate +#: model:ir.model.fields.selection,name:account_einvoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "Ništa" + +#. module: account_einvoice_generate +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "XML format ugnježđen u PDF račun" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "XML format attached to your PDF customer invoices" +msgstr "" + +#, fuzzy +#~ msgid "" +#~ "Select Format\n" +#~ " " +#~ msgstr "" +#~ "" + +#~ msgid "Select the format of your e-invoices." +#~ msgstr "Odaberite format za vaše elektroničke račune." + +#~ msgid "Format" +#~ msgstr "Format" + +#~ msgid "Invoice" +#~ msgstr "Račun" + +#~ msgid "Select Format" +#~ msgstr "Odabir formata" + +#~ msgid "Universal Business Language (UBL)" +#~ msgstr "Universal Business Language (UBL)" diff --git a/account_einvoice_generate/i18n/it.po b/account_einvoice_generate/i18n/it.po new file mode 100644 index 0000000000..bd5569c04e --- /dev/null +++ b/account_einvoice_generate/i18n/it.po @@ -0,0 +1,53 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * account_einvoice_generate +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 17.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2024-03-13 11:40+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: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_company +msgid "Companies" +msgstr "Aziende" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_res_config_settings +msgid "Config Settings" +msgstr "Impostazioni configurazione" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "Electronic Invoices" +msgstr "Fatture elettroniche" + +#. module: account_einvoice_generate +#: model:ir.model,name:account_einvoice_generate.model_account_move +msgid "Journal Entry" +msgstr "Registrazione contabile" + +#. module: account_einvoice_generate +#: model:ir.model.fields.selection,name:account_einvoice_generate.selection__res_company__xml_format_in_pdf_invoice__none +msgid "None" +msgstr "Nessuna" + +#. module: account_einvoice_generate +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_company__xml_format_in_pdf_invoice +#: model:ir.model.fields,field_description:account_einvoice_generate.field_res_config_settings__xml_format_in_pdf_invoice +msgid "XML Format embedded in PDF invoice" +msgstr "Formato XML incorporato nella fattura PDF" + +#. module: account_einvoice_generate +#: model_terms:ir.ui.view,arch_db:account_einvoice_generate.view_account_config_settings +msgid "XML format attached to your PDF customer invoices" +msgstr "Formato XML allegato alla tua fattura PDF" diff --git a/account_einvoice_generate/models/__init__.py b/account_einvoice_generate/models/__init__.py new file mode 100644 index 0000000000..500c05e962 --- /dev/null +++ b/account_einvoice_generate/models/__init__.py @@ -0,0 +1,4 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import res_company +from . import account_move diff --git a/account_einvoice_generate/models/account_move.py b/account_einvoice_generate/models/account_move.py new file mode 100644 index 0000000000..ad78838af4 --- /dev/null +++ b/account_einvoice_generate/models/account_move.py @@ -0,0 +1,45 @@ +# Copyright 2018-2022 Akretion France +# @author: Alexis de Lattre +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountMove(models.Model): + _inherit = "account.move" + + def get_payment_identifier(self): + """This method is designed to be inherited in localization modules""" + self.ensure_one() + return None + + def _xml_format_in_pdf_invoice(self): + """Returns the format if it is possible to generate the XML + Otherwize return False""" + self.ensure_one() + xml_format = self.company_id.xml_format_in_pdf_invoice + # I want to allow embedded XML even on draft invoice + # So I write here the conditions to be able to generate a valid XML + if ( + xml_format + and xml_format != "none" + and self.move_type in ("out_invoice", "out_refund") + and self.partner_id + and self.state != "cancel" + and self.invoice_line_ids.filtered(lambda x: x.display_type == "product") + ): + return xml_format + else: + return False + + def _get_unece_due_date_type_code(self): + """account.tax has a selection field 'tax_exigibility' with 2 possible values: + 'on_invoice' or 'on_payment'. + As a consequence, tax exigibility is a property of the invoice line. + But, in real life (at least in France), tax exigibility is a property + of the invoice, not the invoice line! + This method is a hook to get the UNECE due date type code from the invoice + instead of the tax. If it returns None, Odoo will get it from the tax. + """ + self.ensure_one() + return None diff --git a/account_einvoice_generate/models/res_company.py b/account_einvoice_generate/models/res_company.py new file mode 100644 index 0000000000..e8d105435c --- /dev/null +++ b/account_einvoice_generate/models/res_company.py @@ -0,0 +1,13 @@ +# Copyright 2018-2022 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResCompany(models.Model): + _inherit = "res.company" + + xml_format_in_pdf_invoice = fields.Selection( + [("none", "None")], string="XML Format embedded in PDF invoice" + ) diff --git a/account_einvoice_generate/post_install.py b/account_einvoice_generate/post_install.py new file mode 100644 index 0000000000..f1cfdd0c6e --- /dev/null +++ b/account_einvoice_generate/post_install.py @@ -0,0 +1,15 @@ +# Copyright 2024 Akretion France (https://www.akretion.com/) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +# In v17, the method _is_invoice_report(report_ref) of ir.actions.report +# was returning True for the 2 invoices reports. +# In v18, a new boolean field is_invoice_report was added to ir.actions.report +# but, surprisingly, it is set to True for report XMLID account.account_invoices +# but left to False for report XMLID account.account_invoices_without_payment +# (which is the report that users can access via the print menu). +# This post_install script fixes this. +def update_invoice_report_config(env): + env.ref("account.account_invoices_without_payment").write( + {"is_invoice_report": True} + ) diff --git a/account_einvoice_generate/pyproject.toml b/account_einvoice_generate/pyproject.toml new file mode 100644 index 0000000000..4231d0cccb --- /dev/null +++ b/account_einvoice_generate/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/account_einvoice_generate/readme/CONFIGURE.md b/account_einvoice_generate/readme/CONFIGURE.md new file mode 100644 index 0000000000..9f30df1975 --- /dev/null +++ b/account_einvoice_generate/readme/CONFIGURE.md @@ -0,0 +1,2 @@ +The new configuration parameter *XML Format embedded in PDF invoice* is +available in the menu *Invoicing \> Configuration \> Settings*. diff --git a/account_einvoice_generate/readme/CONTRIBUTORS.md b/account_einvoice_generate/readme/CONTRIBUTORS.md new file mode 100644 index 0000000000..f9b110635c --- /dev/null +++ b/account_einvoice_generate/readme/CONTRIBUTORS.md @@ -0,0 +1,3 @@ +- Alexis de Lattre \<\> +- Andrea Stirpe \<\> +- Shine IT \<\> diff --git a/account_einvoice_generate/readme/DESCRIPTION.md b/account_einvoice_generate/readme/DESCRIPTION.md new file mode 100644 index 0000000000..536dfaba16 --- /dev/null +++ b/account_einvoice_generate/readme/DESCRIPTION.md @@ -0,0 +1,15 @@ +This is a technical module that ensure compatibility between the +e-invoice generation modules of the [OCA/edi +project](https://github.com/OCA/edi/). It doesn't bring any feature by +itself. You must also install one of the 2 OCA modules that generate +electronic invoices: + +- **account_invoice_ubl**: add support for the UBL format (Universal + Business Language), +- **account_invoice_facturx**: add support for the + [Factur-X](http://fnfe-mpe.org/factur-x/factur-x_en/) format. + +See the README of each module for more information. + +These 2 modules are able to embed an XML file in the PDF invoice and +this module ensure that these 2 modules are compatible. diff --git a/account_einvoice_generate/readme/INSTALL.md b/account_einvoice_generate/readme/INSTALL.md new file mode 100644 index 0000000000..0ac39fb6d6 --- /dev/null +++ b/account_einvoice_generate/readme/INSTALL.md @@ -0,0 +1,9 @@ +Before installing the module, you must **uninstall** the module +**account_edi** from the official addons. As the account_edi module is +auto-installable, it is certainly already installed on your Odoo +database. + +For that, go to the *Apps* menu, remove the *Apps* filter, search for +the module *account_edi* (the title of the module is *Import/Export +Invoices From XML/PDF*). Then click on the button *Module info* and then +on the button *Uninstall*. diff --git a/account_einvoice_generate/static/description/icon.png b/account_einvoice_generate/static/description/icon.png new file mode 100644 index 0000000000..3a0328b516 Binary files /dev/null and b/account_einvoice_generate/static/description/icon.png differ diff --git a/account_einvoice_generate/static/description/index.html b/account_einvoice_generate/static/description/index.html new file mode 100644 index 0000000000..c189a392ca --- /dev/null +++ b/account_einvoice_generate/static/description/index.html @@ -0,0 +1,459 @@ + + + + + +Account e-invoice Generate + + + +
+

Account e-invoice Generate

+ + +

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

+

This is a technical module that ensure compatibility between the +e-invoice generation modules of the OCA/edi +project. It doesn’t bring any feature +by itself. You must also install one of the 2 OCA modules that generate +electronic invoices:

+
    +
  • account_invoice_ubl: add support for the UBL format (Universal +Business Language),
  • +
  • account_invoice_facturx: add support for the +Factur-X format.
  • +
+

See the README of each module for more information.

+

These 2 modules are able to embed an XML file in the PDF invoice and +this module ensure that these 2 modules are compatible.

+

Table of contents

+ +
+

Installation

+

Before installing the module, you must uninstall the module +account_edi from the official addons. As the account_edi module is +auto-installable, it is certainly already installed on your Odoo +database.

+

For that, go to the Apps menu, remove the Apps filter, search for +the module account_edi (the title of the module is Import/Export +Invoices From XML/PDF). Then click on the button Module info and then +on the button Uninstall.

+
+
+

Configuration

+

The new configuration parameter XML Format embedded in PDF invoice is +available in the menu Invoicing > Configuration > Settings.

+
+
+

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

+
    +
  • Akretion
  • +
  • Onestein
  • +
+
+
+

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 maintainer:

+

alexis-via

+

This module is part of the OCA/edi project on GitHub.

+

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

+
+
+
+ + diff --git a/account_einvoice_generate/tests/__init__.py b/account_einvoice_generate/tests/__init__.py new file mode 100644 index 0000000000..a242996a72 --- /dev/null +++ b/account_einvoice_generate/tests/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from . import test_einvoice_generate diff --git a/account_einvoice_generate/tests/test_einvoice_generate.py b/account_einvoice_generate/tests/test_einvoice_generate.py new file mode 100644 index 0000000000..42e21a6a5e --- /dev/null +++ b/account_einvoice_generate/tests/test_einvoice_generate.py @@ -0,0 +1,17 @@ +# Copyright 2019-2022 Onestein () +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestEInvoiceGenerate(TransactionCase): + def test_config(self): + """Test configuration of Electronic Invoices.""" + conf = self.env["res.config.settings"].create( + {"xml_format_in_pdf_invoice": "none"} + ) + conf.execute() + self.assertTrue(self.env.company.xml_format_in_pdf_invoice) + conf.xml_format_in_pdf_invoice = False + conf.execute() + self.assertFalse(self.env.company.xml_format_in_pdf_invoice) diff --git a/account_einvoice_generate/views/res_config_settings.xml b/account_einvoice_generate/views/res_config_settings.xml new file mode 100644 index 0000000000..e3c93b59d1 --- /dev/null +++ b/account_einvoice_generate/views/res_config_settings.xml @@ -0,0 +1,22 @@ + + + + + res.config.settings + + + + + + + + + + diff --git a/account_einvoice_generate/wizards/__init__.py b/account_einvoice_generate/wizards/__init__.py new file mode 100644 index 0000000000..0deb68c468 --- /dev/null +++ b/account_einvoice_generate/wizards/__init__.py @@ -0,0 +1 @@ +from . import res_config_settings diff --git a/account_einvoice_generate/wizards/res_config_settings.py b/account_einvoice_generate/wizards/res_config_settings.py new file mode 100644 index 0000000000..bd9f17c8c3 --- /dev/null +++ b/account_einvoice_generate/wizards/res_config_settings.py @@ -0,0 +1,13 @@ +# Copyright 2018-2022 Akretion (http://www.akretion.com) +# @author: Alexis de Lattre +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class ResConfigSettings(models.TransientModel): + _inherit = "res.config.settings" + + xml_format_in_pdf_invoice = fields.Selection( + related="company_id.xml_format_in_pdf_invoice", readonly=False + )