Skip to content

Commit

Permalink
Merge PR #1029 into 18.0
Browse files Browse the repository at this point in the history
Signed-off-by pedrobaeza
  • Loading branch information
OCA-git-bot committed Mar 6, 2025
2 parents d8a3e37 + 2c745a5 commit 620a7d4
Show file tree
Hide file tree
Showing 18 changed files with 770 additions and 0 deletions.
96 changes: 96 additions & 0 deletions website_sale_vat_required/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
=======================
e-commerce required VAT
=======================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:550696f4b5c3aff75ccf29a52f3986b5e4b3432114db19f96043d6b66c26d35f
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Fe--commerce-lightgray.png?logo=github
:target: https://github.com/OCA/e-commerce/tree/18.0/website_sale_vat_required
:alt: OCA/e-commerce
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/e-commerce-18-0/e-commerce-18-0-website_sale_vat_required
: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/e-commerce&target_branch=18.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module extends checkout e-commerce form in order to force user to
fill 'VAT number' field.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Buy something from your e-commerce
2. Go to checkout page.
3. Try to checkout without specifying a VAT, or using a wrong one.
4. You will get an error.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/e-commerce/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/e-commerce/issues/new?body=module:%20website_sale_vat_required%0Aversion:%2018.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
* Tecnativa

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

- Lorenzo Battistini <[email protected]>

- `Tecnativa <https://www.tecnativa.com>`__:

- Jairo Llopis
- Ernesto Tejeda
- Carlos Lopez

- Abraham Anes <[email protected]>

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/e-commerce <https://github.com/OCA/e-commerce/tree/18.0/website_sale_vat_required>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions website_sale_vat_required/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright 2017 Jairo Llopis <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import controllers
21 changes: 21 additions & 0 deletions website_sale_vat_required/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright 2017 Jairo Llopis <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "e-commerce required VAT",
"summary": "VAT number required in checkout form",
"version": "18.0.1.0.0",
"category": "Website",
"author": "Agile Business Group, Tecnativa, Odoo Community Association (OCA)",
"website": "https://github.com/OCA/e-commerce",
"license": "AGPL-3",
"depends": ["website_sale", "base_vat"],
"installable": True,
"auto_install": False,
"assets": {
"web.assets_tests": [
"website_sale_vat_required/static/tests/tours/website_sale_vat_required.esm.js",
],
},
}
5 changes: 5 additions & 0 deletions website_sale_vat_required/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Copyright 2015 Lorenzo Battistini <[email protected]>
# Copyright 2017 Jairo Llopis <[email protected]>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import main
28 changes: 28 additions & 0 deletions website_sale_vat_required/controllers/main.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2015 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright 2017 Jairo Llopis <[email protected]>
# Copyright 2025 Carlos Lopez - Tecnativa
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo.addons.website_sale.controllers.main import WebsiteSale


class WebsiteSale(WebsiteSale):
def _get_mandatory_billing_address_fields(self, country_sudo):
field_names = super()._get_mandatory_billing_address_fields(country_sudo)
if "vat" not in field_names:
field_names |= {"vat"}
return field_names

def _prepare_address_form_values(
self, *args, address_type, use_delivery_as_billing, **kwargs
):
rendering_values = super()._prepare_address_form_values(
*args,
address_type=address_type,
use_delivery_as_billing=use_delivery_as_billing,
**kwargs,
)
rendering_values["show_vat"] = (
address_type == "billing" or use_delivery_as_billing
)
return rendering_values
Empty file.
20 changes: 20 additions & 0 deletions website_sale_vat_required/i18n/es.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * website_sale_vat_required
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2018-11-13 09:15+0000\n"
"Last-Translator: David Vidal <[email protected]>\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 3.2.2\n"

#~ msgid "TIN / VAT"
#~ msgstr "NIF"
14 changes: 14 additions & 0 deletions website_sale_vat_required/i18n/it.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: Automatically generated\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"
13 changes: 13 additions & 0 deletions website_sale_vat_required/i18n/website_sale_vat_required.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
#
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"
3 changes: 3 additions & 0 deletions website_sale_vat_required/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[build-system]
requires = ["whool"]
build-backend = "whool.buildapi"
9 changes: 9 additions & 0 deletions website_sale_vat_required/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
- Lorenzo Battistini \<<[email protected]>\>

- [Tecnativa](https://www.tecnativa.com):

> - Jairo Llopis
> - Ernesto Tejeda
> - Carlos Lopez
- Abraham Anes \<<[email protected]>\>
2 changes: 2 additions & 0 deletions website_sale_vat_required/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
This module extends checkout e-commerce form in order to force user to
fill 'VAT number' field.
6 changes: 6 additions & 0 deletions website_sale_vat_required/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
To use this module, you need to:

1. Buy something from your e-commerce
2. Go to checkout page.
3. Try to checkout without specifying a VAT, or using a wrong one.
4. You will get an error.
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 620a7d4

Please sign in to comment.