Skip to content

Commit

Permalink
Merge PR #4083 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by tafaRU
  • Loading branch information
OCA-git-bot committed Apr 5, 2024
2 parents f62097a + 2990686 commit 87f175d
Show file tree
Hide file tree
Showing 17 changed files with 807 additions and 0 deletions.
104 changes: 104 additions & 0 deletions l10n_it_website_sale_fiscalcode/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
=======================
Website Sale FiscalCode
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:84b421560c92fa648ec8256a96ea0d48e1a37aad7cf35afb8158a14e4e52bd8e
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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/16.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-16-0/l10n-italy-16-0-l10n_it_website_sale_fiscalcode
: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/l10n-italy&target_branch=16.0
:alt: Try me on Runboat

|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 <https://github.com/OCA/l10n-italy/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 <https://github.com/OCA/l10n-italy/issues/new?body=module:%20l10n_it_website_sale_fiscalcode%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

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

Credits
=======

Authors
-------

* Agile Business Group

Contributors
------------

- Nicola Malcontenti <nicola.malcontenti@agilebg.com>
- Alessio Gerace <alessio.gerace@agilebg.com>
- Giuseppe Borruso - Dinamiche Aziendali srl
<gborruso@dinamicheaziendali.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.

This module is part of the `OCA/l10n-italy <https://github.com/OCA/l10n-italy/tree/16.0/l10n_it_website_sale_fiscalcode>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
3 changes: 3 additions & 0 deletions l10n_it_website_sale_fiscalcode/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2017 Nicola Malcontenti - Agile Business Group

from . import controllers
19 changes: 19 additions & 0 deletions l10n_it_website_sale_fiscalcode/__manifest__.py
Original file line number Diff line number Diff line change
@@ -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": "16.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,
}
3 changes: 3 additions & 0 deletions l10n_it_website_sale_fiscalcode/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Copyright 2017 Nicola Malcontenti - Agile Business Group

from . import main
48 changes: 48 additions & 0 deletions l10n_it_website_sale_fiscalcode/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Copyright 2017 Nicola Malcontenti - Agile Business Group

from odoo.exceptions import ValidationError
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()._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
)
# Check fiscalcode
partner = request.env.user.partner_id
# company_type does not come from page form
company_type = partner.company_type
company_name = False
if "company_name" in data:
company_name = data.get("company_name")
else:
# when company_name is not posted (readonly)
if partner.company_name:
company_name = partner.company_name
elif partner.company_type == "company":
company_name = partner.name
dummy_partner = request.env["res.partner"].new(
{
"fiscalcode": data.get("fiscalcode"),
"company_name": company_name,
"company_type": company_type,
}
)
try:
dummy_partner.check_fiscalcode()
except ValidationError as e:
error["fiscalcode"] = "error"
error_message.append(e)
return error, error_message
28 changes: 28 additions & 0 deletions l10n_it_website_sale_fiscalcode/i18n/de.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# 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"

#, fuzzy, python-format
#~ msgid "Fiscal Code not valid"
#~ msgstr "Steuernummer"
28 changes: 28 additions & 0 deletions l10n_it_website_sale_fiscalcode/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_it_website_sale_fiscalcode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"

#, fuzzy, python-format
#~ msgid "Fiscal Code not valid"
#~ msgstr "Código Fiscal"
27 changes: 27 additions & 0 deletions l10n_it_website_sale_fiscalcode/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# 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 <primes2h@gmail.com>\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"

#, python-format
#~ msgid "Fiscal Code not valid"
#~ msgstr "Codice fiscale non valido"
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# 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 ""
29 changes: 29 additions & 0 deletions l10n_it_website_sale_fiscalcode/i18n/sl.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * l10n_it_website_sale_fiscalcode
#
# Translators:
# OCA Transbot <transbot@odoo-community.org>, 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 <transbot@odoo-community.org>, 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"

#, fuzzy, python-format
#~ msgid "Fiscal Code not valid"
#~ msgstr "Fiskalna koda"
3 changes: 3 additions & 0 deletions l10n_it_website_sale_fiscalcode/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
3 changes: 3 additions & 0 deletions l10n_it_website_sale_fiscalcode/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
- Nicola Malcontenti \<<nicola.malcontenti@agilebg.com>\>
- Alessio Gerace \<<alessio.gerace@agilebg.com>\>
- Giuseppe Borruso - Dinamiche Aziendali srl \<<gborruso@dinamicheaziendali.it>\>
7 changes: 7 additions & 0 deletions l10n_it_website_sale_fiscalcode/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -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.
15 changes: 15 additions & 0 deletions l10n_it_website_sale_fiscalcode/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -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.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 87f175d

Please sign in to comment.