diff --git a/l10n_it_website_sale_fiscalcode/README.rst b/l10n_it_website_sale_fiscalcode/README.rst new file mode 100644 index 000000000000..241ba9734f44 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/README.rst @@ -0,0 +1,99 @@ +======================= +Website Sale FiscalCode +======================= + +.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png + :target: https://odoo-community.org/page/development-status + :alt: Beta +.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fl10n--italy-lightgray.png?logo=github + :target: https://github.com/OCA/l10n-italy/tree/14.0/l10n_it_website_sale_fiscalcode + :alt: OCA/l10n-italy +.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png + :target: https://translation.odoo-community.org/projects/l10n-italy-14-0/l10n-italy-14-0-l10n_it_website_sale_fiscalcode + :alt: Translate me on Weblate +.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png + :target: https://runbot.odoo-community.org/runbot/122/14.0 + :alt: Try me on Runbot + +|badge1| |badge2| |badge3| |badge4| |badge5| + +**Italiano** + +Questo modulo aggiunge il codice fiscale nel form del checkout. + +**English** + +This module adds fiscal code in the checkout form. + +**Table of contents** + +.. contents:: + :local: + +Usage +===== + +**Italiano** + +Per utilizzare questo modulo: + +* Andare nel negozio; +* Comprare qualcosa; +* Aggiungere il codice fiscale nel form del checkout. + +**English** + +To use this module, you need to: + +* Go to Shop; +* Buy something; +* Add fiscal code in the checkout form. + +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 +~~~~~~~ + +* Agile Business Group + +Contributors +~~~~~~~~~~~~ + +* Nicola Malcontenti +* Alessio Gerace + +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-italy `_ project on GitHub. + +You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/l10n_it_website_sale_fiscalcode/__init__.py b/l10n_it_website_sale_fiscalcode/__init__.py new file mode 100644 index 000000000000..eb82a65d614f --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2017 Nicola Malcontenti - Agile Business Group + +from . import controllers diff --git a/l10n_it_website_sale_fiscalcode/__manifest__.py b/l10n_it_website_sale_fiscalcode/__manifest__.py new file mode 100644 index 000000000000..ae678b2b09a9 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/__manifest__.py @@ -0,0 +1,19 @@ +# Copyright 2017 Nicola Malcontenti - Agile Business Group +# Copyright 2019 Simone Rubino +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl). + +{ + "name": "Website Sale FiscalCode", + "category": "e-commerce", + "author": "Agile Business Group," "Odoo Community Association (OCA)", + "version": "14.0.1.0.0", + "license": "AGPL-3", + "website": "https://github.com/OCA/l10n-italy" + "/tree/14.0/l10n_it_website_sale_fiscalcode", + "depends": ["website_sale", "l10n_it_fiscalcode"], + "data": [ + "views/templates.xml", + ], + "installable": True, + "auto_install": True, +} diff --git a/l10n_it_website_sale_fiscalcode/controllers/__init__.py b/l10n_it_website_sale_fiscalcode/controllers/__init__.py new file mode 100644 index 000000000000..9bd1ee4d0d84 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/controllers/__init__.py @@ -0,0 +1,3 @@ +# Copyright 2017 Nicola Malcontenti - Agile Business Group + +from . import main diff --git a/l10n_it_website_sale_fiscalcode/controllers/main.py b/l10n_it_website_sale_fiscalcode/controllers/main.py new file mode 100644 index 000000000000..4f9464b738b5 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/controllers/main.py @@ -0,0 +1,36 @@ +# Copyright 2017 Nicola Malcontenti - Agile Business Group + +from odoo import _ +from odoo.http import request + +from odoo.addons.website_sale.controllers.main import WebsiteSale + + +class WebsiteSaleFiscalCode(WebsiteSale): + def _checkout_form_save(self, mode, checkout, all_values): + res = super(WebsiteSaleFiscalCode, self)._checkout_form_save( + mode, checkout, all_values + ) + partner_values = dict() + if "fiscalcode" not in checkout and "fiscalcode" in all_values: + partner_values["fiscalcode"] = all_values["fiscalcode"] + if partner_values: + request.env["res.partner"].browse(res).sudo().write(partner_values) + return res + + def checkout_form_validate(self, mode, all_form_values, data): + error, error_message = super().checkout_form_validate( + mode, all_form_values, data + ) + partner_sudo = request.env.user.partner_id.sudo() + dummy_partner = request.env["res.partner"].new( + { + "fiscalcode": data.get("fiscalcode"), + "is_company": partner_sudo.is_company, + } + ) + if dummy_partner.fiscalcode: + if len(dummy_partner.fiscalcode) != 16: + error["fiscalcode"] = "error" + error_message.append(_("Fiscal Code not valid")) + return error, error_message diff --git a/l10n_it_website_sale_fiscalcode/i18n/de.po b/l10n_it_website_sale_fiscalcode/i18n/de.po new file mode 100644 index 000000000000..8f69c168a1bc --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/i18n/de.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_website_sale_fiscalcode +# +# Translators: +# Niki Waibel, 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-11 12:22+0000\n" +"PO-Revision-Date: 2018-05-11 12:22+0000\n" +"Last-Translator: Niki Waibel, 2018\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"Language: de\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: l10n_it_website_sale_fiscalcode +#: model_terms:ir.ui.view,arch_db:l10n_it_website_sale_fiscalcode.l10n_it_website_sale_fiscalcode +msgid "Fiscal Code" +msgstr "Steuernummer" + +#. module: l10n_it_website_sale_fiscalcode +#: code:addons/l10n_it_website_sale_fiscalcode/controllers/main.py:30 +#, fuzzy, python-format +msgid "Fiscal Code not valid" +msgstr "Steuernummer" diff --git a/l10n_it_website_sale_fiscalcode/i18n/es.po b/l10n_it_website_sale_fiscalcode/i18n/es.po new file mode 100644 index 000000000000..92bae7cee95e --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/i18n/es.po @@ -0,0 +1,30 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_website_sale_fiscalcode +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-11 12:22+0000\n" +"PO-Revision-Date: 2018-05-11 12:22+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"Language: es\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: l10n_it_website_sale_fiscalcode +#: model_terms:ir.ui.view,arch_db:l10n_it_website_sale_fiscalcode.l10n_it_website_sale_fiscalcode +msgid "Fiscal Code" +msgstr "Código Fiscal" + +#. module: l10n_it_website_sale_fiscalcode +#: code:addons/l10n_it_website_sale_fiscalcode/controllers/main.py:30 +#, fuzzy, python-format +msgid "Fiscal Code not valid" +msgstr "Código Fiscal" diff --git a/l10n_it_website_sale_fiscalcode/i18n/it.po b/l10n_it_website_sale_fiscalcode/i18n/it.po new file mode 100644 index 000000000000..04968b9ea387 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/i18n/it.po @@ -0,0 +1,29 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_website_sale_fiscalcode +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0+e\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-07 13:45+0000\n" +"PO-Revision-Date: 2019-02-27 08:13+0000\n" +"Last-Translator: Sergio Zanchetta \n" +"Language-Team: \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 3.4\n" + +#. module: l10n_it_website_sale_fiscalcode +#: model_terms:ir.ui.view,arch_db:l10n_it_website_sale_fiscalcode.l10n_it_website_sale_fiscalcode +msgid "Fiscal Code" +msgstr "Codice fiscale" + +#. module: l10n_it_website_sale_fiscalcode +#: code:addons/l10n_it_website_sale_fiscalcode/controllers/main.py:30 +#, python-format +msgid "Fiscal Code not valid" +msgstr "Codice fiscale non valido" diff --git a/l10n_it_website_sale_fiscalcode/i18n/l10n_it_website_sale_fiscalcode.pot b/l10n_it_website_sale_fiscalcode/i18n/l10n_it_website_sale_fiscalcode.pot new file mode 100644 index 000000000000..a34e1421f6e0 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/i18n/l10n_it_website_sale_fiscalcode.pot @@ -0,0 +1,26 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_website_sale_fiscalcode +# +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 14.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_it_website_sale_fiscalcode +#: model_terms:ir.ui.view,arch_db:l10n_it_website_sale_fiscalcode.l10n_it_website_sale_fiscalcode +msgid "Fiscal Code" +msgstr "" + +#. module: l10n_it_website_sale_fiscalcode +#: code:addons/l10n_it_website_sale_fiscalcode/controllers/main.py:30 +#, python-format +msgid "Fiscal Code not valid" +msgstr "" + diff --git a/l10n_it_website_sale_fiscalcode/i18n/sl.po b/l10n_it_website_sale_fiscalcode/i18n/sl.po new file mode 100644 index 000000000000..6870457621af --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/i18n/sl.po @@ -0,0 +1,31 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * l10n_it_website_sale_fiscalcode +# +# Translators: +# OCA Transbot , 2018 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 10.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2018-05-11 12:22+0000\n" +"PO-Revision-Date: 2018-05-11 12:22+0000\n" +"Last-Translator: OCA Transbot , 2018\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"Language: sl\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n" +"%100==4 ? 2 : 3);\n" + +#. module: l10n_it_website_sale_fiscalcode +#: model_terms:ir.ui.view,arch_db:l10n_it_website_sale_fiscalcode.l10n_it_website_sale_fiscalcode +msgid "Fiscal Code" +msgstr "Fiskalna koda" + +#. module: l10n_it_website_sale_fiscalcode +#: code:addons/l10n_it_website_sale_fiscalcode/controllers/main.py:30 +#, fuzzy, python-format +msgid "Fiscal Code not valid" +msgstr "Fiskalna koda" diff --git a/l10n_it_website_sale_fiscalcode/readme/CONTRIBUTORS.rst b/l10n_it_website_sale_fiscalcode/readme/CONTRIBUTORS.rst new file mode 100644 index 000000000000..03c4e1b7f925 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/readme/CONTRIBUTORS.rst @@ -0,0 +1,2 @@ +* Nicola Malcontenti +* Alessio Gerace diff --git a/l10n_it_website_sale_fiscalcode/readme/DESCRIPTION.rst b/l10n_it_website_sale_fiscalcode/readme/DESCRIPTION.rst new file mode 100644 index 000000000000..fcffdb991c99 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/readme/DESCRIPTION.rst @@ -0,0 +1,7 @@ +**Italiano** + +Questo modulo aggiunge il codice fiscale nel form del checkout. + +**English** + +This module adds fiscal code in the checkout form. diff --git a/l10n_it_website_sale_fiscalcode/readme/USAGE.rst b/l10n_it_website_sale_fiscalcode/readme/USAGE.rst new file mode 100644 index 000000000000..1500431ea1f5 --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/readme/USAGE.rst @@ -0,0 +1,15 @@ +**Italiano** + +Per utilizzare questo modulo: + +* Andare nel negozio; +* Comprare qualcosa; +* Aggiungere il codice fiscale nel form del checkout. + +**English** + +To use this module, you need to: + +* Go to Shop; +* Buy something; +* Add fiscal code in the checkout form. diff --git a/l10n_it_website_sale_fiscalcode/static/description/icon.png b/l10n_it_website_sale_fiscalcode/static/description/icon.png new file mode 100644 index 000000000000..3a0328b516c4 Binary files /dev/null and b/l10n_it_website_sale_fiscalcode/static/description/icon.png differ diff --git a/l10n_it_website_sale_fiscalcode/static/description/index.html b/l10n_it_website_sale_fiscalcode/static/description/index.html new file mode 100644 index 000000000000..3f80f5d7a10d --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/static/description/index.html @@ -0,0 +1,441 @@ + + + + + + +Website Sale FiscalCode + + + +
+

Website Sale FiscalCode

+ + +

Beta License: AGPL-3 OCA/l10n-italy Translate me on Weblate Try me on Runbot

+

Italiano

+

Questo modulo aggiunge il codice fiscale nel form del checkout.

+

English

+

This module adds fiscal code in the checkout form.

+

Table of contents

+ +
+

Usage

+

Italiano

+

Per utilizzare questo modulo:

+
    +
  • Andare nel negozio;
  • +
  • Comprare qualcosa;
  • +
  • Aggiungere il codice fiscale nel form del checkout.
  • +
+

English

+

To use this module, you need to:

+
    +
  • Go to Shop;
  • +
  • Buy something;
  • +
  • Add fiscal code in the checkout form.
  • +
+
+
+

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

+
    +
  • Agile Business Group
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is maintained by the OCA.

+Odoo Community Association +

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

+

This module is part of the OCA/l10n-italy project on GitHub.

+

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

+
+
+
+ + diff --git a/l10n_it_website_sale_fiscalcode/views/templates.xml b/l10n_it_website_sale_fiscalcode/views/templates.xml new file mode 100644 index 000000000000..f1332d97378c --- /dev/null +++ b/l10n_it_website_sale_fiscalcode/views/templates.xml @@ -0,0 +1,27 @@ + + + + + diff --git a/setup/l10n_it_website_sale_fiscalcode/odoo/addons/l10n_it_website_sale_fiscalcode b/setup/l10n_it_website_sale_fiscalcode/odoo/addons/l10n_it_website_sale_fiscalcode new file mode 120000 index 000000000000..3866ae414522 --- /dev/null +++ b/setup/l10n_it_website_sale_fiscalcode/odoo/addons/l10n_it_website_sale_fiscalcode @@ -0,0 +1 @@ +../../../../l10n_it_website_sale_fiscalcode \ No newline at end of file diff --git a/setup/l10n_it_website_sale_fiscalcode/setup.py b/setup/l10n_it_website_sale_fiscalcode/setup.py new file mode 100644 index 000000000000..28c57bb64031 --- /dev/null +++ b/setup/l10n_it_website_sale_fiscalcode/setup.py @@ -0,0 +1,6 @@ +import setuptools + +setuptools.setup( + setup_requires=['setuptools-odoo'], + odoo_addon=True, +)