diff --git a/l10n_es_aeat_sii_oss/README.rst b/l10n_es_aeat_sii_oss/README.rst new file mode 100644 index 00000000000..121ff4c6ddd --- /dev/null +++ b/l10n_es_aeat_sii_oss/README.rst @@ -0,0 +1,99 @@ +================================================== +Suministro Inmediato de Información en el IVA: OSS +================================================== + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Production%2FStable-green.png + :target: https://odoo-community.org/page/development-status + :alt: Production/Stable +.. |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%2Fl10n--spain-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-spain/tree/15.0/l10n_es_aeat_sii_oss + :alt: OCA/l10n-spain +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-spain-15-0/l10n-spain-15-0-l10n_es_aeat_sii_oss + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/189/15.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +Este módulo compatibiliza el envío al SII de las facturas de comercio B2C a los países intracomunitarios según el marco de la normativa europea One-Stop Shop (OSS). + +**Table of contents** + +.. contents:: + :local: + +Installation +============ + +Para instalar esté módulo necesita los módulos `account_fiscal_position_partner_type` y `l10n_eu_oss`, que se encuentran en https://github.com/OCA/account-fiscal-rule.git + +Configuration +============= + +Para configurar este módulo es necesario: + +#. En la posiciones fiscales generadas por el modulo l10n_eu_oss debemos activarlas para el envío del SII. + Ademas debemos definir en la opción "Clave de registro SII por defecto para ventas" la clave 17 + y en la opción "Causa de no sujeción SII" definir Operaciones no sujetas en el TAI por reglas de localización + +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 +~~~~~~~ + +* FactorLibre +* Tecnativa + +Contributors +~~~~~~~~~~~~ + +* Rodrigo Bonilla +* `Tecnativa `__: + + * Pedro M. Baeza + +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-pedrobaeza| image:: https://github.com/pedrobaeza.png?size=40px + :target: https://github.com/pedrobaeza + :alt: pedrobaeza + +Current `maintainer `__: + +|maintainer-pedrobaeza| + +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_aeat_sii_oss/__init__.py b/l10n_es_aeat_sii_oss/__init__.py new file mode 100644 index 00000000000..b358ca90bef --- /dev/null +++ b/l10n_es_aeat_sii_oss/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2021 FactorLibre - Rodrigo Bonilla +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/l10n_es_aeat_sii_oss/__manifest__.py b/l10n_es_aeat_sii_oss/__manifest__.py new file mode 100644 index 00000000000..bfe1705c721 --- /dev/null +++ b/l10n_es_aeat_sii_oss/__manifest__.py @@ -0,0 +1,22 @@ +# Copyright 2021 FactorLibre - Rodrigo Bonilla +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + "name": "Suministro Inmediato de Información en el IVA: OSS", + "version": "16.0.1.0.0", + "category": "Accounting & Finance", + "website": "https://github.com/OCA/l10n-spain", + "author": "FactorLibre, Tecnativa, Odoo Community Association (OCA)", + "license": "AGPL-3", + "application": False, + "installable": True, + "autoinstall": True, + "development_status": "Production/Stable", + "maintainers": ["pedrobaeza"], + "depends": [ + "l10n_es_aeat_sii_oca", + "account_fiscal_position_partner_type", + "l10n_eu_oss_oca", + ], + "data": ["data/aeat_sii_mapping_registration_keys_data.xml"], +} diff --git a/l10n_es_aeat_sii_oss/data/aeat_sii_mapping_registration_keys_data.xml b/l10n_es_aeat_sii_oss/data/aeat_sii_mapping_registration_keys_data.xml new file mode 100644 index 00000000000..1cb7da40b67 --- /dev/null +++ b/l10n_es_aeat_sii_oss/data/aeat_sii_mapping_registration_keys_data.xml @@ -0,0 +1,13 @@ + + + + 17 + Operación acogida a alguno de los regímenes previstos en el Capítulo XI del Título IX (OSS) + sale + + diff --git a/l10n_es_aeat_sii_oss/i18n/ca.po b/l10n_es_aeat_sii_oss/i18n/ca.po new file mode 100644 index 00000000000..e228cb5e109 --- /dev/null +++ b/l10n_es_aeat_sii_oss/i18n/ca.po @@ -0,0 +1,22 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_aeat_sii_oss +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.0\n" +"Report-Msgid-Bugs-To: \n" +"PO-Revision-Date: 2022-05-20 18:05+0000\n" +"Last-Translator: jabelchi \n" +"Language-Team: none\n" +"Language: ca\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=n != 1;\n" +"X-Generator: Weblate 4.3.2\n" + +#. module: l10n_es_aeat_sii_oss +#: model:ir.model,name:l10n_es_aeat_sii_oss.model_account_move +msgid "Journal Entry" +msgstr "Apunt comptable" diff --git a/l10n_es_aeat_sii_oss/i18n/l10n_es_aeat_sii_oss.pot b/l10n_es_aeat_sii_oss/i18n/l10n_es_aeat_sii_oss.pot new file mode 100644 index 00000000000..e0b9e723e63 --- /dev/null +++ b/l10n_es_aeat_sii_oss/i18n/l10n_es_aeat_sii_oss.pot @@ -0,0 +1,19 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_es_aeat_sii_oss +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 15.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: l10n_es_aeat_sii_oss +#: model:ir.model,name:l10n_es_aeat_sii_oss.model_account_move +msgid "Journal Entry" +msgstr "" diff --git a/l10n_es_aeat_sii_oss/models/__init__.py b/l10n_es_aeat_sii_oss/models/__init__.py new file mode 100644 index 00000000000..06d06dffb2a --- /dev/null +++ b/l10n_es_aeat_sii_oss/models/__init__.py @@ -0,0 +1,3 @@ +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import account_move diff --git a/l10n_es_aeat_sii_oss/models/account_move.py b/l10n_es_aeat_sii_oss/models/account_move.py new file mode 100644 index 00000000000..81777d2294f --- /dev/null +++ b/l10n_es_aeat_sii_oss/models/account_move.py @@ -0,0 +1,21 @@ +# Copyright 2021 FactorLibre - Rodrigo Bonilla +# Copyright 2021 Tecnativa - Pedro M. Baeza +# 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_sii_taxes_map(self, codes): + """Inject OSS taxes when querying not subjected invoices.""" + taxes = super()._get_sii_taxes_map(codes) + if any([x in ["SFENS", "NotIncludedInTotal"] for x in codes]): + taxes |= self.env["account.tax"].search( + [ + ("oss_country_id", "!=", False), + ("company_id", "=", self.company_id.id), + ] + ) + return taxes diff --git a/l10n_es_aeat_sii_oss/readme/CONFIGURE.rst b/l10n_es_aeat_sii_oss/readme/CONFIGURE.rst new file mode 100644 index 00000000000..2063f30bf7b --- /dev/null +++ b/l10n_es_aeat_sii_oss/readme/CONFIGURE.rst @@ -0,0 +1,5 @@ +Para configurar este módulo es necesario: + +#. En la posiciones fiscales generadas por el modulo l10n_eu_oss debemos activarlas para el envío del SII. + Ademas debemos definir en la opción "Clave de registro SII por defecto para ventas" la clave 17 + y en la opción "Causa de no sujeción SII" definir Operaciones no sujetas en el TAI por reglas de localización diff --git a/l10n_es_aeat_sii_oss/readme/CONTRIBUTORS.rst b/l10n_es_aeat_sii_oss/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000000..ebee552f9cc --- /dev/null +++ b/l10n_es_aeat_sii_oss/readme/CONTRIBUTORS.rst @@ -0,0 +1,4 @@ +* Rodrigo Bonilla +* `Tecnativa `__: + + * Pedro M. Baeza diff --git a/l10n_es_aeat_sii_oss/readme/DESCRIPTION.rst b/l10n_es_aeat_sii_oss/readme/DESCRIPTION.rst new file mode 100644 index 00000000000..0f293f75719 --- /dev/null +++ b/l10n_es_aeat_sii_oss/readme/DESCRIPTION.rst @@ -0,0 +1 @@ +Este módulo compatibiliza el envío al SII de las facturas de comercio B2C a los países intracomunitarios según el marco de la normativa europea One-Stop Shop (OSS). diff --git a/l10n_es_aeat_sii_oss/readme/INSTALL.rst b/l10n_es_aeat_sii_oss/readme/INSTALL.rst new file mode 100644 index 00000000000..b6d5a08d2de --- /dev/null +++ b/l10n_es_aeat_sii_oss/readme/INSTALL.rst @@ -0,0 +1 @@ +Para instalar esté módulo necesita los módulos `account_fiscal_position_partner_type` y `l10n_eu_oss`, que se encuentran en https://github.com/OCA/account-fiscal-rule.git diff --git a/l10n_es_aeat_sii_oss/static/description/icon.png b/l10n_es_aeat_sii_oss/static/description/icon.png new file mode 100644 index 00000000000..5170cb8cfb8 Binary files /dev/null and b/l10n_es_aeat_sii_oss/static/description/icon.png differ diff --git a/l10n_es_aeat_sii_oss/static/description/icon_source.svg b/l10n_es_aeat_sii_oss/static/description/icon_source.svg new file mode 100644 index 00000000000..63b232d6494 --- /dev/null +++ b/l10n_es_aeat_sii_oss/static/description/icon_source.svg @@ -0,0 +1,123 @@ + + + + + + + + image/svg+xml + + + + + + + + + + + + + + + + + + + + OSS + diff --git a/l10n_es_aeat_sii_oss/static/description/index.html b/l10n_es_aeat_sii_oss/static/description/index.html new file mode 100644 index 00000000000..f08cb516447 --- /dev/null +++ b/l10n_es_aeat_sii_oss/static/description/index.html @@ -0,0 +1,441 @@ + + + + + + +Suministro Inmediato de Información en el IVA: OSS + + + +
+

Suministro Inmediato de Información en el IVA: OSS

+ + +

Production/Stable License: AGPL-3 OCA/l10n-spain Translate me on Weblate Try me on Runbot

+

Este módulo compatibiliza el envío al SII de las facturas de comercio B2C a los países intracomunitarios según el marco de la normativa europea One-Stop Shop (OSS).

+

Table of contents

+ +
+

Installation

+

Para instalar esté módulo necesita los módulos account_fiscal_position_partner_type y l10n_eu_oss, que se encuentran en https://github.com/OCA/account-fiscal-rule.git

+
+
+

Configuration

+

Para configurar este módulo es necesario:

+
    +
  1. En la posiciones fiscales generadas por el modulo l10n_eu_oss debemos activarlas para el envío del SII. +Ademas debemos definir en la opción “Clave de registro SII por defecto para ventas” la clave 17 +y en la opción “Causa de no sujeción SII” definir Operaciones no sujetas en el TAI por reglas de localización
  2. +
+
+
+

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

+
    +
  • FactorLibre
  • +
  • Tecnativa
  • +
+
+
+

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:

+

pedrobaeza

+

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_aeat_sii_oss/tests/__init__.py b/l10n_es_aeat_sii_oss/tests/__init__.py new file mode 100644 index 00000000000..e9fc5521349 --- /dev/null +++ b/l10n_es_aeat_sii_oss/tests/__init__.py @@ -0,0 +1,4 @@ +# Copyright 2021 FactorLibre - Rodrigo Bonilla +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import test_l10n_es_aeat_sii diff --git a/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py b/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py new file mode 100644 index 00000000000..0633b4c3c3f --- /dev/null +++ b/l10n_es_aeat_sii_oss/tests/test_l10n_es_aeat_sii.py @@ -0,0 +1,56 @@ +# Copyright 2021 FactorLibre - Rodrigo Bonilla +# Copyright 2021 Tecnativa - Pedro M. Baeza +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). +from odoo.addons.l10n_es_aeat_sii_oca.tests.test_l10n_es_aeat_sii import ( + TestL10nEsAeatSiiBase, +) + + +class TestL10nEsAeatSiiBaseOss(TestL10nEsAeatSiiBase): + @classmethod + def setUpClass(cls): + super().setUpClass() + account_fiscal_position_env = cls.env["account.fiscal.position"] + xml_id = "%s_account_tax_template_s_oss20" % cls.company.id + cls.tax_fr_20 = cls._get_or_create_tax(xml_id, "Test tax 20%", "sale", 20) + cls.tax_fr_20.write({"oss_country_id": cls.env.ref("base.fr").id}) + cls.fpos_fr_id = account_fiscal_position_env.create( + { + "name": "Intra-EU FR B2C", + "company_id": cls.company.id, + "vat_required": False, + "auto_apply": True, + "country_id": cls.env.ref("base.fr").id, + "fiscal_position_type": "b2c", + "sii_registration_key_sale": cls.env.ref( + "l10n_es_aeat_sii_oss.aeat_sii_oss_mapping_registration_keys_1" + ).id, + "sii_exempt_cause": "none", + "sii_partner_identification_type": "2", + } + ) + + def test_invoice_sii_oss(self): + self.partner.sii_simplified_invoice = True + invoice_vals = { + "move_type": "out_invoice", + "partner_id": self.partner.id, + "invoice_date": "2021-07-01", + "fiscal_position_id": self.fpos_fr_id.id, + "invoice_line_ids": [ + ( + 0, + 0, + { + "product_id": self.product.id, + "price_unit": 100, + "quantity": 1, + "tax_ids": [(6, 0, [self.tax_fr_20.id])], + }, + ) + ], + } + invoice = self.env["account.move"].create(invoice_vals) + res = invoice._get_sii_invoice_dict() + res_issue = res["FacturaExpedida"] + self.assertEqual(res_issue["ImporteTotal"], 100) diff --git a/setup/l10n_es_aeat_sii_oss/odoo/addons/l10n_es_aeat_sii_oss b/setup/l10n_es_aeat_sii_oss/odoo/addons/l10n_es_aeat_sii_oss new file mode 120000 index 00000000000..53082ec25d6 --- /dev/null +++ b/setup/l10n_es_aeat_sii_oss/odoo/addons/l10n_es_aeat_sii_oss @@ -0,0 +1 @@ +../../../../l10n_es_aeat_sii_oss \ No newline at end of file diff --git a/setup/l10n_es_aeat_sii_oss/setup.py b/setup/l10n_es_aeat_sii_oss/setup.py new file mode 100644 index 00000000000..28c57bb6403 --- /dev/null +++ b/setup/l10n_es_aeat_sii_oss/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)