From 43323a89d2e79580ffb0b41118b23ea029e08648 Mon Sep 17 00:00:00 2001 From: arodriguez Date: Mon, 11 Mar 2024 13:20:39 +0100 Subject: [PATCH] [ADD] l10n_es_ticketbai_oss: Add OSS support for TicketBai --- l10n_es_ticketbai_oss/README.rst | 75 +++++++++++++++++ l10n_es_ticketbai_oss/__init__.py | 1 + l10n_es_ticketbai_oss/__manifest__.py | 19 +++++ l10n_es_ticketbai_oss/i18n/es.po | 78 ++++++++++++++++++ l10n_es_ticketbai_oss/i18n/eu_ES.po | 78 ++++++++++++++++++ l10n_es_ticketbai_oss/models/__init__.py | 3 + .../models/account_invoice_tax.py | 31 +++++++ l10n_es_ticketbai_oss/models/account_tax.py | 27 ++++++ .../models/ticketbai_invoice_tax.py | 10 +++ .../static/description/icon.png | Bin 0 -> 9485 bytes l10n_es_ticketbai_oss/tests/__init__.py | 1 + .../tests/test_invoice_oss.py | 74 +++++++++++++++++ .../views/account_tax_views.xml | 19 +++++ .../odoo/addons/l10n_es_ticketbai_oss | 1 + setup/l10n_es_ticketbai_oss/setup.py | 6 ++ 15 files changed, 423 insertions(+) create mode 100644 l10n_es_ticketbai_oss/README.rst create mode 100644 l10n_es_ticketbai_oss/__init__.py create mode 100644 l10n_es_ticketbai_oss/__manifest__.py create mode 100644 l10n_es_ticketbai_oss/i18n/es.po create mode 100644 l10n_es_ticketbai_oss/i18n/eu_ES.po create mode 100644 l10n_es_ticketbai_oss/models/__init__.py create mode 100644 l10n_es_ticketbai_oss/models/account_invoice_tax.py create mode 100644 l10n_es_ticketbai_oss/models/account_tax.py create mode 100644 l10n_es_ticketbai_oss/models/ticketbai_invoice_tax.py create mode 100644 l10n_es_ticketbai_oss/static/description/icon.png create mode 100644 l10n_es_ticketbai_oss/tests/__init__.py create mode 100644 l10n_es_ticketbai_oss/tests/test_invoice_oss.py create mode 100644 l10n_es_ticketbai_oss/views/account_tax_views.xml create mode 120000 setup/l10n_es_ticketbai_oss/odoo/addons/l10n_es_ticketbai_oss create mode 100644 setup/l10n_es_ticketbai_oss/setup.py diff --git a/l10n_es_ticketbai_oss/README.rst b/l10n_es_ticketbai_oss/README.rst new file mode 100644 index 00000000000..99098fd7ace --- /dev/null +++ b/l10n_es_ticketbai_oss/README.rst @@ -0,0 +1,75 @@ +======================= +TicketBAI - OSS Support +======================= + +.. |badge1| image:: https://img.shields.io/badge/maturity-Alpha-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Alpha +.. |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 + +|badge1| |badge2| + +Módulo para hacer compatible el envío de facturas Ticketbai con el OSS + +Añade 2 campos nuevos en los impuestos (account.tax): + +* Tipo de causa de no sujeción (se añade el tipo IE) +* Tipo de impuesto Ticketbai + +A la hora de generar el fichero XML de envío a TicketBai, si estos campos están rellenados, +se tendrán en cuenta dichos campos, sino seguirá el flujo normal como hasta ahora. + + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +Para instalar este módulo se necesita: + +#. Los módulos l10n_es_ticketbai + +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 +~~~~~~~ + +* Binovo IT Human Project S.L. + +Contributors +~~~~~~~~~~~~ + +* Alicia Rodríguez + +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. + +This module is part of the `OCA/l10n-spain `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_es_ticketbai_oss/__init__.py b/l10n_es_ticketbai_oss/__init__.py new file mode 100644 index 00000000000..0650744f6bc --- /dev/null +++ b/l10n_es_ticketbai_oss/__init__.py @@ -0,0 +1 @@ +from . import models diff --git a/l10n_es_ticketbai_oss/__manifest__.py b/l10n_es_ticketbai_oss/__manifest__.py new file mode 100644 index 00000000000..3a6d65f2773 --- /dev/null +++ b/l10n_es_ticketbai_oss/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2024 Binovo IT Human Project SL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "TicketBAI - OSS Support ", + "version": "12.0.1.0.0", + "category": "Accounting & Finance", + "website": "https://github.com/OCA/l10n-spain", + "author": "Binovo," + "Odoo Community Association (OCA)", + "license": "AGPL-3", + "development_status": "Alpha", + "maintainers": ["Binovo"], + "depends": ["l10n_es_ticketbai"], + "data": ["views/account_tax_views.xml"], + "application": False, + "installable": True, + "auto_install": False, +} diff --git a/l10n_es_ticketbai_oss/i18n/es.po b/l10n_es_ticketbai_oss/i18n/es.po new file mode 100644 index 00000000000..94d14af4bf2 --- /dev/null +++ b/l10n_es_ticketbai_oss/i18n/es.po @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_ticketbai_oss +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-11 08:38+0000\n" +"PO-Revision-Date: 2024-03-11 08:38+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: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "IE" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "IE - No sujeto en el TAI por reglas de localización, pero repercute impuesto extranjero, IPS/IGIC o IVA de otro estado miembro UE." +msgstr "IE - No sujeto en el TAI por reglas de localización, pero repercute impuesto extranjero, IPS/IGIC o IVA de otro estado miembro UE." + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_account_invoice_tax +msgid "Invoice Tax" +msgstr "Impuesto de factura" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_tax__not_subject_to_cause +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_tbai_invoice_tax__not_subject_to_cause +msgid "Not Subject to Cause" +msgstr "Causa no sujeta" + +#. module: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "OT" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "OT - No sujeto por el artículo 7 de la Norma Foral de IVA Otros supuestos de no sujeción. " +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "RL" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "RL - No sujeto por reglas de localización." +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_account_tax +msgid "Tax" +msgstr "Impuesto" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_tax__tbai_tax_map_id +msgid "Tbai Tax Map" +msgstr "Tipo impuesto TicketBai" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_invoice_tax__tbai_vat_exemption_key +msgid "TicketBAI - VAT Exemption Key" +msgstr "TicketBAI - Causa exención impuesto" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_tbai_invoice_tax +msgid "TicketBAI Invoice taxes" +msgstr "TicketBAI Factura impuestos" + diff --git a/l10n_es_ticketbai_oss/i18n/eu_ES.po b/l10n_es_ticketbai_oss/i18n/eu_ES.po new file mode 100644 index 00000000000..44ce8edf217 --- /dev/null +++ b/l10n_es_ticketbai_oss/i18n/eu_ES.po @@ -0,0 +1,78 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_ticketbai_oss +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 12.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2024-03-11 08:41+0000\n" +"PO-Revision-Date: 2024-03-11 08:41+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: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "IE" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "IE - No sujeto en el TAI por reglas de localización, pero repercute impuesto extranjero, IPS/IGIC o IVA de otro estado miembro UE." +msgstr "IE - Lokalizazio-arauak direla-eta ZALen subjektua ez dena, baina atzerriko zerga, IPS/IGIC edo EBko beste estatu kide bateko BEZa eragiten duena." + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_account_invoice_tax +msgid "Invoice Tax" +msgstr "Faktura zerga" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_tax__not_subject_to_cause +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_tbai_invoice_tax__not_subject_to_cause +msgid "Not Subject to Cause" +msgstr "Ez da kausaren menpe" + +#. module: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "OT" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "OT - No sujeto por el artículo 7 de la Norma Foral de IVA Otros supuestos de no sujeción. " +msgstr "OT - BEZaren Foru Arauaren 7. artikuluak lotu gabea Lotu gabeko beste kasu batzuk." + +#. module: l10n_es_ticketbai_oss +#: selection:tbai.invoice.tax,not_subject_to_cause:0 +msgid "RL" +msgstr "" + +#. module: l10n_es_ticketbai_oss +#: selection:account.tax,not_subject_to_cause:0 +msgid "RL - No sujeto por reglas de localización." +msgstr "RL - Lokalizazio arauengatik lotu gabe." + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_account_tax +msgid "Tax" +msgstr "Zerga" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_tax__tbai_tax_map_id +msgid "Tbai Tax Map" +msgstr "TicketBai zerga-mota" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model.fields,field_description:l10n_es_ticketbai_oss.field_account_invoice_tax__tbai_vat_exemption_key +msgid "TicketBAI - VAT Exemption Key" +msgstr "TicketBAI - Zerga Salbuespenaren Giltza" + +#. module: l10n_es_ticketbai_oss +#: model:ir.model,name:l10n_es_ticketbai_oss.model_tbai_invoice_tax +msgid "TicketBAI Invoice taxes" +msgstr "TicketBAI Fakturaren zergak" + diff --git a/l10n_es_ticketbai_oss/models/__init__.py b/l10n_es_ticketbai_oss/models/__init__.py new file mode 100644 index 00000000000..fb1f92b9de5 --- /dev/null +++ b/l10n_es_ticketbai_oss/models/__init__.py @@ -0,0 +1,3 @@ +from . import account_tax +from . import account_invoice_tax +from . import ticketbai_invoice_tax diff --git a/l10n_es_ticketbai_oss/models/account_invoice_tax.py b/l10n_es_ticketbai_oss/models/account_invoice_tax.py new file mode 100644 index 00000000000..980001b497f --- /dev/null +++ b/l10n_es_ticketbai_oss/models/account_invoice_tax.py @@ -0,0 +1,31 @@ +# Copyright 2024 Binovo IT Human Project SL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import models + + +class AccountInvoiceTax(models.Model): + _inherit = "account.invoice.tax" + + def tbai_es_prestacion_servicios(self): + if self.tax_id.tbai_tax_map_id: + return ( + True + if self.tax_id.tbai_tax_map_id.code in ("SNS", "SIE", "S", "SER") + else False + ) + return super().tbai_es_prestacion_servicios() + + def tbai_es_entrega(self): + if self.tax_id.tbai_tax_map_id: + return ( + True + if self.tax_id.tbai_tax_map_id.code in ("B", "BNS", "IEE", "SER") + else False + ) + return super().tbai_es_entrega() + + def tbai_get_value_causa(self): + if self.tax_id.not_subject_to_cause: + return self.tax_id.not_subject_to_cause + return super().tbai_get_value_causa() diff --git a/l10n_es_ticketbai_oss/models/account_tax.py b/l10n_es_ticketbai_oss/models/account_tax.py new file mode 100644 index 00000000000..11c603ede78 --- /dev/null +++ b/l10n_es_ticketbai_oss/models/account_tax.py @@ -0,0 +1,27 @@ +# Copyright 2024 Binovo IT Human Project SL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class AccountTax(models.Model): + _inherit = "account.tax" + + tbai_tax_map_id = fields.Many2one( + comodel_name="tbai.tax.map", string="Tbai Tax Map" + ) + not_subject_to_cause = fields.Selection( + selection=[ + ("OT", "OT - No sujeto por el artículo 7 de la Norma Foral de IVA Otros" + " supuestos de no sujeción. "), + ("RL", "RL - No sujeto por reglas de localización."), + ("IE", "IE - No sujeto en el TAI por reglas de localización, pero repercute" + " impuesto extranjero, IPS/IGIC o IVA de otro estado miembro UE."), + ], + string="Not Subject to Cause", + ) + + def tbai_is_subject_to_tax(self): + if self.tbai_tax_map_id and self.tbai_tax_map_id.code in ("SNS", "BNS"): + return False + return super().tbai_is_subject_to_tax() diff --git a/l10n_es_ticketbai_oss/models/ticketbai_invoice_tax.py b/l10n_es_ticketbai_oss/models/ticketbai_invoice_tax.py new file mode 100644 index 00000000000..0db8ad51539 --- /dev/null +++ b/l10n_es_ticketbai_oss/models/ticketbai_invoice_tax.py @@ -0,0 +1,10 @@ +# Copyright 2024 Binovo IT Human Project SL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo import fields, models + + +class TicketBaiTax(models.Model): + _inherit = "tbai.invoice.tax" + + not_subject_to_cause = fields.Selection(selection_add=[("IE", "IE")]) diff --git a/l10n_es_ticketbai_oss/static/description/icon.png b/l10n_es_ticketbai_oss/static/description/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ae809b4346254b37be1ab3f6ac2a71b923de7f55 GIT binary patch literal 9485 zcma)iXIN9+(l%X+fOP3%0U;C>=}kaTl%lkR9=bs25D2~ZA|Rm?iu4wG$3zUhDkTsp zg7hXJMEc8f&Uv15{(aw%z1MZ^ea~LA*EMU_%smtRM)L(VB^xCH0Rgqz%jenz1ccb@ zD~+7^`UxLJEjRF-brv zWV~-m2i%tQrjmuRO2Me*d}!r-*`$5w$tss!?>26L;0@V^YD)k+b3 z6)yBD0-zBrq8=rz87iU`#{V|<@!Np3;Tloq5>@LK zQ*ZIU%`2|PFR3x~LtO~G%{}{bSb9ffdQ)^}YfM&KTuw(!UUNcTS7QFB>kE_8TsBjw$L}e*#Gs%z_+ELZ{G(emq(`NN3g5o z*u{R_+PB%I3Ea=Axz*|UHSEIr%#RJ+(&pUHorTrC#kF568{6wUdz*U)TfYvs_kZsm z9PJ$*?;rm9b%ftP{&RpoJ^J(e_sRLu=>`7m^5pE#pYyBJ^OLiS)2s8-lgq2Ci?geX ztMjX~>)ZAMXL!}Al|*Qk+|PJ_^V{o)iW*MS zsGxT{iz~Cm+7(KAvwfX294}_E2>166RdztJyX> zV>_Cw!SE8h#+v;&>%z4Su|2aUyXKp_Mk_tTU>BHY^bFijF31}E;2zS71djSDbmy-z z4wXy?dP4LXyup0yuTk|sAfyM?f5CAmdQcnbf5EC?3c)#||AOx!Nsh`YCo0$^-Y`Hlk&IT+~{5>o143kcawr8L`8*w-y^3`b4L(&b;qC6QZ z#cRgSEpq}$WU7&SMXRK~YWXKMw?KdYK^29#y?0A+zE3Ep7`lt^FovR%9h;g@*G}D4 zLm+-y`HJ)>}!wbu=~M|*d8&C<>+)P(XK)PY-<00+~7vWkF3 z8bd4ihMj$%s{M=(<%GP*94$2KA_Mq451>seSU|U#;Jp>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kYG8=)*Ohkgc@&x{GP7;iA~#xv3|wii*TM~!VeaD9TCekF-@zvATl{C zOI#3s4}#{X8a;ZB$5oslZ6HBSt<~=#*B~PgN|NbCc`+G~)^aQ994TbnHM8X7Zk4wI z(I&;~0EcP@4@4$cW#pu`Q^n4EM1KhWrB>6#L!^rBs6~F1;mFKi+x!@EN9^YEfu@KE zRgv8&tx67>nZx!F*>`i^S_YP=(OO`#Z=h{3?$j&6OTkh)l(0el9#K7D6XIk3v$O!#^~L`(JBwlkq-_1jzBJ(bffne6G+qI(@h5+ zH+WnHfj9-9L@jR!|^};9sdu}V~WPB8&&??H48;Sjn{2X O1Zpap&#RTdA^!(vh;a4* literal 0 HcmV?d00001 diff --git a/l10n_es_ticketbai_oss/tests/__init__.py b/l10n_es_ticketbai_oss/tests/__init__.py new file mode 100644 index 00000000000..04e0f1e393a --- /dev/null +++ b/l10n_es_ticketbai_oss/tests/__init__.py @@ -0,0 +1 @@ +from . import test_invoice_oss diff --git a/l10n_es_ticketbai_oss/tests/test_invoice_oss.py b/l10n_es_ticketbai_oss/tests/test_invoice_oss.py new file mode 100644 index 00000000000..3762928153d --- /dev/null +++ b/l10n_es_ticketbai_oss/tests/test_invoice_oss.py @@ -0,0 +1,74 @@ +# Copyright 2024 Binovo IT Human Project SL +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase, tagged + + +@tagged("post_install", "-at_install") +class TestInvoiceAddress(TransactionCase): + + def setUp(self): + super(TestInvoiceAddress, self).setUp() + self.currency = self.env.ref("base.EUR") + self.company = self.env.ref("base.main_company") + vals = { + "company_id": self.company.id, + "type": "sale", + "code": "TEST", + "name": "Journal Test", + } + self.journal = self.env["account.journal"].create(vals) + vals = { + "name": "Customer", + "customer": True, + "supplier": False, + } + self.partner = self.env["res.partner"].create(vals) + self.account = self.env["account.account"].search( + [ + ( + "user_type_id", + "=", + self.env.ref("account.data_account_type_receivable").id, + ) + ], + limit=1, + ) + tbai_tax_map_id = self.env["tbai.tax.map"].search([("code", "=", "BNS")]).id + vals = { + "name": "Tax 22%", + "amount": 22, + "price_include": False, + "not_subject_to_cause": "IE", + "tbai_tax_map_id": tbai_tax_map_id + } + self.tax = self.env["account.tax"].create(vals) + + def test_no_subject_invoice(self): + vals = { + "currency_id": self.currency.id, + "partner_id": self.partner.id, + "reference_type": "none", + "journal_id": self.journal.id, + "account_id": self.account.id, + } + invoice = self.env["account.invoice"].create(vals) + vals = { + "name": "Product 001", + "quantity": 1, + "price_unit": 100, + "invoice_line_tax_ids": [(6, 0, [self.tax.id])], + "invoice_id": invoice.id, + "account_id": self.account.id, + } + self.env["account.invoice.line"].create(vals) + invoice._onchange_invoice_line_ids() + self.assertEqual(len(invoice.invoice_line_ids), 1) + is_subject_tax = ( + invoice.invoice_line_ids[0].invoice_line_tax_ids.tbai_is_subject_to_tax()) + self.assertFalse(is_subject_tax) + invoice.compute_taxes() + self.assertEqual(len(invoice.tax_line_ids), 1) + self.assertTrue(invoice.tax_line_ids.tbai_es_entrega()) + self.assertFalse(invoice.tax_line_ids.tbai_es_prestacion_servicios()) + self.assertEqual(invoice.tax_line_ids.tbai_get_value_causa(), "IE") diff --git a/l10n_es_ticketbai_oss/views/account_tax_views.xml b/l10n_es_ticketbai_oss/views/account_tax_views.xml new file mode 100644 index 00000000000..0204886f433 --- /dev/null +++ b/l10n_es_ticketbai_oss/views/account_tax_views.xml @@ -0,0 +1,19 @@ + + + + + + account.tax.tbai.form + account.tax + + + + + + + + + + diff --git a/setup/l10n_es_ticketbai_oss/odoo/addons/l10n_es_ticketbai_oss b/setup/l10n_es_ticketbai_oss/odoo/addons/l10n_es_ticketbai_oss new file mode 120000 index 00000000000..095a0bd7e66 --- /dev/null +++ b/setup/l10n_es_ticketbai_oss/odoo/addons/l10n_es_ticketbai_oss @@ -0,0 +1 @@ +../../../../l10n_es_ticketbai_oss/ \ No newline at end of file diff --git a/setup/l10n_es_ticketbai_oss/setup.py b/setup/l10n_es_ticketbai_oss/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/l10n_es_ticketbai_oss/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)