Initial commit: OCA Financial packages (186 packages)

This commit is contained in:
Ernad Husremovic 2025-08-29 15:43:04 +02:00
commit 3e0e8473fb
8757 changed files with 947473 additions and 0 deletions

View file

@ -0,0 +1,44 @@
# Account Tax One VAT
Odoo addon: account_tax_one_vat
## Installation
```bash
pip install odoo-bringout-oca-account-invoicing-account_tax_one_vat
```
## Dependencies
This addon depends on:
- account
## Manifest Information
- **Name**: Account Tax One VAT
- **Version**: 16.0.1.0.0
- **Category**: account
- **License**: AGPL-3
- **Installable**: True
## Source
Based on [OCA/account-invoicing](https://github.com/OCA/account-invoicing) branch 16.0, addon `account_tax_one_vat`.
## License
This package maintains the original AGPL-3 license from the upstream Odoo project.
## Documentation
- Overview: doc/OVERVIEW.md
- Architecture: doc/ARCHITECTURE.md
- Models: doc/MODELS.md
- Controllers: doc/CONTROLLERS.md
- Wizards: doc/WIZARDS.md
- Install: doc/INSTALL.md
- Usage: doc/USAGE.md
- Configuration: doc/CONFIGURATION.md
- Dependencies: doc/DEPENDENCIES.md
- Troubleshooting: doc/TROUBLESHOOTING.md
- FAQ: doc/FAQ.md

View file

@ -0,0 +1,103 @@
===================
Account Tax One VAT
===================
..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5267b359cd7a1fa9cf781a36c0f425bdd55fcc1ad03f0564d05e3327d4987ba4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/16.0/account_tax_one_vat
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_tax_one_vat
: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/account-invoicing&target_branch=16.0
:alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5|
This module ensures that only one VAT tax can be selected because
the invoices (at least in Belgium) must have one and only one
VAT tax per line. So this module comes to complete the OCA module
account_invoice_tax_required which ensures a line has a tax.
It deals with taxes on these objects:
* account move line (onchange warning only)
* product template for both customer and supplier (constraint only)
The module adds two computed fields on product - vat_id and
vat (vat_id.name) - which might be set if the restriction is on.
It also adds a boolean field in the account.tax model to indicates the
tax is a VAT.
**Table of contents**
.. contents::
:local:
Usage
=====
Use one of these paths to reach the setting:
* *Settings* - *Invoicing* - *Taxes*
* *Invoicing* - *Configuration* - *Settings* - *Taxes*
Once there find the 'One VAT tax only' option that you can
check/uncheck.
For a specific tax you can find the option to indicates it's
a VAT under the Advanced Options in the form view.
Bug Tracker
===========
Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/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/account-invoicing/issues/new?body=module:%20account_tax_one_vat%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
~~~~~~~
* Camptocamp
* Acsone
Contributors
~~~~~~~~~~~~
* Camptocamp SA
* Hughes Damry <hughes.damry@acsone.eu>
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/account-invoicing <https://github.com/OCA/account-invoicing/tree/16.0/account_tax_one_vat>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View file

@ -0,0 +1 @@
from . import models

View file

@ -0,0 +1,19 @@
# Copyright 2020 Camptocamp SA
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
{
"name": "Account Tax One VAT",
"summary": "Allow only the selection of one VAT Tax.",
"version": "16.0.1.0.0",
"author": "Camptocamp, Acsone, Odoo Community Association (OCA)",
"license": "AGPL-3",
"category": "account",
"depends": ["account"],
"data": [
"views/res_config_settings_views.xml",
"views/account_tax_views.xml",
],
"website": "https://github.com/OCA/account-invoicing",
"installable": True,
}

View file

@ -0,0 +1,127 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_one_vat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid ""
"%(message)s\n"
"%(errors)s"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_one_vat_mixin
msgid "Abstract the methods needed to ensure only one VAT tax is selected."
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.res_config_settings_view_form
msgid "Avoid the selection of multiple VAT taxes."
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_company
msgid "Companies"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_config_settings
msgid "Config Settings"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid "Invoice has a line %s with more than one vat tax"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax_template__is_vat
msgid "Is a VAT tax"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "More than one VAT tax selected!"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "Multiple taxes of type VAT are selected. Only one is allowed."
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
msgid "One VAT tax only"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_product_template
msgid "Product"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax
msgid "Tax"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax_template
msgid "Templates for Taxes"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat_id
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat_id
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.view_account_tax_search
msgid "VAT"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat
msgid "VAT name"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax__is_vat
msgid "VAT tax"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "You selected more than one tax of type VAT."
msgstr ""

View file

@ -0,0 +1,127 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_one_vat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.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: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid ""
"%(message)s\n"
"%(errors)s"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_one_vat_mixin
msgid "Abstract the methods needed to ensure only one VAT tax is selected."
msgstr "Apstraktuj metode potrebne da se osigura da je odabran samo jedan PDV porez."
#. module: account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.res_config_settings_view_form
msgid "Avoid the selection of multiple VAT taxes."
msgstr "Izbegni odabir više PDV poreza."
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_company
msgid "Companies"
msgstr "Kompanije"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_config_settings
msgid "Config Settings"
msgstr "Postavke"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid "Invoice has a line %s with more than one vat tax"
msgstr "Faktura ima liniju %s sa više od jednog PDV poreza"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax_template__is_vat
msgid "Is a VAT tax"
msgstr "Je PDV porez"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move
msgid "Journal Entry"
msgstr "Žurnal"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move_line
msgid "Journal Item"
msgstr "Stavka žurnala"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "More than one VAT tax selected!"
msgstr "Više od jednog PDV poreza je odabrano!"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "Multiple taxes of type VAT are selected. Only one is allowed."
msgstr "Odabrano je više poreza tipa PDV. Dozvoljen je samo jedan."
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
msgid "One VAT tax only"
msgstr "Samo jedan PDV porez"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_product_template
msgid "Product"
msgstr "Artikal"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax
msgid "Tax"
msgstr "Porez"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax_template
msgid "Templates for Taxes"
msgstr "Prijedlozi poreza"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat_id
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat_id
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.view_account_tax_search
msgid "VAT"
msgstr "PDV"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat
msgid "VAT name"
msgstr "PDV naziv"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax__is_vat
msgid "VAT tax"
msgstr "PDV porez"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "You selected more than one tax of type VAT."
msgstr "Odabrali ste više od jednog poreza tipa PDV."

View file

@ -0,0 +1,135 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_one_vat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2023-11-29 19:33+0000\n"
"Last-Translator: Ivorra78 <informatica@totmaterial.es>\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 4.17\n"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid ""
"%(message)s\n"
"%(errors)s"
msgstr ""
"%(message)s\n"
"%(errors)s"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_one_vat_mixin
msgid "Abstract the methods needed to ensure only one VAT tax is selected."
msgstr ""
"Resumen de los métodos necesarios para garantizar que sólo se selecciona un "
"impuesto del IVA."
#. module: account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.res_config_settings_view_form
msgid "Avoid the selection of multiple VAT taxes."
msgstr "Evite la selección de varios impuestos sobre el IVA."
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_company
msgid "Companies"
msgstr "Compañías"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_config_settings
msgid "Config Settings"
msgstr "Configuración de Ajustes"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid "Invoice has a line %s with more than one vat tax"
msgstr "La factura tiene una línea %s con más de un impuesto al IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax_template__is_vat
msgid "Is a VAT tax"
msgstr "Es un impuesto sobre el IVA"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move
msgid "Journal Entry"
msgstr "Entrada en el Diario"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move_line
msgid "Journal Item"
msgstr "Artículo Diario"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "More than one VAT tax selected!"
msgstr "¡Más de un impuesto IVA seleccionado!"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "Multiple taxes of type VAT are selected. Only one is allowed."
msgstr ""
"Múltiples impuestos de tipo IVA han sido seleccionados. Sólo se permite uno."
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
msgid "One VAT tax only"
msgstr "Sólo un Impuesto sobre el Valor Añadido"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_product_template
msgid "Product"
msgstr "Producto"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax
msgid "Tax"
msgstr "Impuesto"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax_template
msgid "Templates for Taxes"
msgstr "Plantillas para Impuestos"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat_id
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat_id
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.view_account_tax_search
msgid "VAT"
msgstr "IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat
msgid "VAT name"
msgstr "Nombre del IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax__is_vat
msgid "VAT tax"
msgstr "Impuesto sobre el IVA"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "You selected more than one tax of type VAT."
msgstr "Ha seleccionado más de un impuesto del tipo IVA."

View file

@ -0,0 +1,133 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_one_vat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0+e\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2023-03-10 17:20+0000\n"
"PO-Revision-Date: 2023-03-10 17:20+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: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid ""
"%(message)s\n"
"%(errors)s"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_one_vat_mixin
msgid "Abstract the methods needed to ensure only one VAT tax is selected."
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.res_config_settings_view_form
msgid "Avoid the selection of multiple VAT taxes."
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_company
msgid "Companies"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_config_settings
msgid "Config Settings"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid "Invoice has a line %s with more than one vat tax"
msgstr "Facture dont la ligne %s avec plus d'une TVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax_template__is_vat
msgid "Is a VAT tax"
msgstr "Est une TVA"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move
msgid "Journal Entry"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move_line
msgid "Journal Item"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "More than one VAT tax selected!"
msgstr "Plusieurs taxes de type TVA sélectionnées !"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "Multiple taxes of type VAT are selected. Only one is allowed."
msgstr ""
"Plusieurs taxes de type TVA sont sélectionnées. Seulement une est "
"autorisée."
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
msgid "One VAT tax only"
msgstr "Une seule taxe de type TVA"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_product_template
msgid "Product"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax
msgid "Tax"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax_template
msgid "Templates for Taxes"
msgstr ""
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat_id
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat_id
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.view_account_tax_search
msgid "VAT"
msgstr "TVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat
msgid "VAT name"
msgstr "TVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax__is_vat
msgid "VAT tax"
msgstr ""
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "You selected more than one tax of type VAT."
msgstr ""
"Vous avez sélectionné plusieurs taxes de type TVA pour une ligne d'achat, "
"cela semble erroné."

View file

@ -0,0 +1,135 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_tax_one_vat
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"PO-Revision-Date: 2024-02-27 18:34+0000\n"
"Last-Translator: mymage <stefano.consolaro@mymage.it>\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"
"X-Generator: Weblate 4.17\n"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid ""
"%(message)s\n"
"%(errors)s"
msgstr ""
"%(message)s\n"
"%(errors)s"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_one_vat_mixin
msgid "Abstract the methods needed to ensure only one VAT tax is selected."
msgstr ""
"Astrae i metodi richiesti per assicurare che solo una imposta IVA venga "
"selezionata."
#. module: account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,help:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.res_config_settings_view_form
msgid "Avoid the selection of multiple VAT taxes."
msgstr "Evita la selezione di imposte IVA multiple."
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_company
msgid "Companies"
msgstr "Aziende"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_res_config_settings
msgid "Config Settings"
msgstr "Impostazioni configurazione"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/account_move.py:0
#, python-format
msgid "Invoice has a line %s with more than one vat tax"
msgstr "La fattura ha la riga %s con più di una imposta IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax_template__is_vat
msgid "Is a VAT tax"
msgstr "È una imposta IVA"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move
msgid "Journal Entry"
msgstr "Registrazione contabile"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_move_line
msgid "Journal Item"
msgstr "Movimento contabile"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "More than one VAT tax selected!"
msgstr "Più di una imposta IVA selezionata!"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "Multiple taxes of type VAT are selected. Only one is allowed."
msgstr ""
"Sono state selezionate imposte di tipo IVA multiple. È consentita solo una."
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_company__account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_res_config_settings__account_tax_one_vat
msgid "One VAT tax only"
msgstr "Una sola imposta IVA"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_product_template
msgid "Product"
msgstr "Prodotto"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax
msgid "Tax"
msgstr "Imposta"
#. module: account_tax_one_vat
#: model:ir.model,name:account_tax_one_vat.model_account_tax_template
msgid "Templates for Taxes"
msgstr "Modelli per imposte"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat_id
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat_id
#: model_terms:ir.ui.view,arch_db:account_tax_one_vat.view_account_tax_search
msgid "VAT"
msgstr "IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_product__vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_product_template__vat
msgid "VAT name"
msgstr "Nome IVA"
#. module: account_tax_one_vat
#: model:ir.model.fields,field_description:account_tax_one_vat.field_account_tax__is_vat
msgid "VAT tax"
msgstr "Imposta IVA"
#. module: account_tax_one_vat
#. odoo-python
#: code:addons/account_tax_one_vat/models/one_vat_mixin.py:0
#, python-format
msgid "You selected more than one tax of type VAT."
msgstr "È stata selezionata più di una imposta di tipo IVA."

View file

@ -0,0 +1,8 @@
from . import one_vat_mixin
from . import account_tax_template
from . import account_tax
from . import account_move
from . import account_move_line
from . import product_template
from . import res_company
from . import res_config_settings

View file

@ -0,0 +1,36 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, models
from odoo.exceptions import UserError
class AccountMove(models.Model):
_inherit = "account.move"
def _check_invoice_line_only_one_vat_tax(self):
errors = []
error_template = _("Invoice has a line %s with more than one vat tax")
loggedin_company = self.env.company
for invoice_line in self.invoice_line_ids.filtered(
lambda x: x.display_type not in ("line_section", "line_note")
):
company = invoice_line.company_id or loggedin_company
vat_taxes = invoice_line._get_vat_taxes("tax_ids", company)
if len(vat_taxes) > 1:
error_string = error_template % invoice_line.name
errors.append(error_string)
if errors:
raise UserError(
_(
"%(message)s\n%(errors)s",
message="Multiple VAT Taxes Defined!",
errors=("\n".join(x for x in errors)),
)
)
def action_post(self):
for move in self:
if move.move_type != "entry":
move._check_invoice_line_only_one_vat_tax()
return super().action_post()

View file

@ -0,0 +1,13 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import api, models
class AccountMoveLine(models.Model):
_name = "account.move.line"
_inherit = ["account.move.line", "one.vat.mixin"]
@api.onchange("tax_ids")
def _onchange_only_one_vat_tax(self):
return self._onchange_one_vat_tax_field("tax_ids")

View file

@ -0,0 +1,10 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountTax(models.Model):
_inherit = "account.tax"
is_vat = fields.Boolean("VAT tax")

View file

@ -0,0 +1,15 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import fields, models
class AccountTaxTemplate(models.Model):
_inherit = "account.tax.template"
is_vat = fields.Boolean("Is a VAT tax")
def _get_tax_vals(self, company, tax_template_to_tax):
val = super()._get_tax_vals(company, tax_template_to_tax)
val.update({"is_vat": self.is_vat})
return val

View file

@ -0,0 +1,42 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import _, models
from odoo.exceptions import ValidationError
class OneVatMixin(models.AbstractModel):
_name = "one.vat.mixin"
_description = "Abstract the methods needed to ensure only one VAT tax is selected."
def _get_vat_taxes(self, field_name, company):
vat_taxes = self[field_name].filtered(
lambda r: r.is_vat and r.company_id == company
)
return vat_taxes
def _check_only_one_vat_tax_field(self, field_name):
loggedin_company = self.env.company
for rec in self:
company = rec.company_id or loggedin_company
if company.account_tax_one_vat:
vat_taxes = rec._get_vat_taxes(field_name, company)
if len(vat_taxes) > 1:
msg = _(
"Multiple taxes of type VAT are selected. Only one is allowed."
)
raise ValidationError(msg)
def _onchange_one_vat_tax_field(self, field_name):
"""Warning if multiple VAT taxes are selected."""
company = self.company_id or self.env.company
if company.account_tax_one_vat:
try:
self._check_only_one_vat_tax_field(field_name)
except ValidationError:
warning_mess = {
"title": _("More than one VAT tax selected!"),
"message": _("You selected more than one tax of type VAT."),
}
return {"warning": warning_mess}
return {}

View file

@ -0,0 +1,45 @@
# Copyright 2020 Camptocamp SA
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class ProductTemplate(models.Model):
_name = "product.template"
_inherit = ["product.template", "one.vat.mixin"]
vat_id = fields.Many2one(
"account.tax",
compute="_compute_product_vat",
string="VAT",
)
vat = fields.Char(compute="_compute_product_vat", string="VAT name")
@api.constrains("taxes_id")
def _check_only_one_vat_customer_tax(self):
self._check_only_one_vat_tax_field("taxes_id")
@api.onchange("taxes_id")
def _onchange_only_one_vat_customer_tax(self):
self._onchange_one_vat_tax_field("taxes_id")
@api.constrains("supplier_taxes_id")
def _check_only_one_vat_supplier_tax(self):
self._check_only_one_vat_tax_field("supplier_taxes_id")
@api.onchange("supplier_taxes_id")
def _onchange_only_one_vat_supplier_tax(self):
self._onchange_one_vat_tax_field("supplier_taxes_id")
@api.depends("taxes_id", "company_id")
@api.depends_context("company")
def _compute_product_vat(self):
loggedin_company = self.env.company
for rec in self:
vat = rec.taxes_id.filtered(
lambda r: r.is_vat and r.company_id == loggedin_company
)
rec.vat_id = vat if loggedin_company.account_tax_one_vat else False
rec.vat = (
vat.name if vat and loggedin_company.account_tax_one_vat else False
)

View file

@ -0,0 +1,12 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import fields, models
class Company(models.Model):
_inherit = "res.company"
account_tax_one_vat = fields.Boolean(
string="One VAT tax only", help="Avoid the selection of multiple VAT taxes."
)

View file

@ -0,0 +1,12 @@
# Copyright 2023 ACSONE SA/NV
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html)
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = "res.config.settings"
account_tax_one_vat = fields.Boolean(
related="company_id.account_tax_one_vat", readonly=False
)

View file

@ -0,0 +1,2 @@
* Camptocamp SA
* Hughes Damry <hughes.damry@acsone.eu>

View file

@ -0,0 +1,13 @@
This module ensures that only one VAT tax can be selected because
the invoices (at least in Belgium) must have one and only one
VAT tax per line. So this module comes to complete the OCA module
account_invoice_tax_required which ensures a line has a tax.
It deals with taxes on these objects:
* account move line (onchange warning only)
* product template for both customer and supplier (constraint only)
The module adds two computed fields on product - vat_id and
vat (vat_id.name) - which might be set if the restriction is on.
It also adds a boolean field in the account.tax model to indicates the
tax is a VAT.

View file

@ -0,0 +1,9 @@
Use one of these paths to reach the setting:
* *Settings* - *Invoicing* - *Taxes*
* *Invoicing* - *Configuration* - *Settings* - *Taxes*
Once there find the 'One VAT tax only' option that you can
check/uncheck.
For a specific tax you can find the option to indicates it's
a VAT under the Advanced Options in the form view.

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.2 KiB

View file

@ -0,0 +1,449 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
<title>Account Tax One VAT</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="account-tax-one-vat">
<h1 class="title">Account Tax One VAT</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:5267b359cd7a1fa9cf781a36c0f425bdd55fcc1ad03f0564d05e3327d4987ba4
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/account-invoicing/tree/16.0/account_tax_one_vat"><img alt="OCA/account-invoicing" src="https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/account-invoicing-16-0/account-invoicing-16-0-account_tax_one_vat"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module ensures that only one VAT tax can be selected because
the invoices (at least in Belgium) must have one and only one
VAT tax per line. So this module comes to complete the OCA module
account_invoice_tax_required which ensures a line has a tax.
It deals with taxes on these objects:
* account move line (onchange warning only)
* product template for both customer and supplier (constraint only)</p>
<p>The module adds two computed fields on product - vat_id and
vat (vat_id.name) - which might be set if the restriction is on.</p>
<p>It also adds a boolean field in the account.tax model to indicates the
tax is a VAT.</p>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#usage" id="toc-entry-1">Usage</a></li>
<li><a class="reference internal" href="#bug-tracker" id="toc-entry-2">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="toc-entry-3">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="toc-entry-4">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="toc-entry-5">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="toc-entry-6">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#toc-entry-1">Usage</a></h1>
<dl class="docutils">
<dt>Use one of these paths to reach the setting:</dt>
<dd><ul class="first last simple">
<li><em>Settings</em> - <em>Invoicing</em> - <em>Taxes</em></li>
<li><em>Invoicing</em> - <em>Configuration</em> - <em>Settings</em> - <em>Taxes</em></li>
</ul>
</dd>
</dl>
<p>Once there find the One VAT tax only option that you can
check/uncheck.</p>
<p>For a specific tax you can find the option to indicates its
a VAT under the Advanced Options in the form view.</p>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#toc-entry-2">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/account-invoicing/issues">GitHub Issues</a>.
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
<a class="reference external" href="https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_tax_one_vat%0Aversion:%2016.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#toc-entry-3">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#toc-entry-4">Authors</a></h2>
<ul class="simple">
<li>Camptocamp</li>
<li>Acsone</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#toc-entry-5">Contributors</a></h2>
<ul class="simple">
<li>Camptocamp SA</li>
<li>Hughes Damry &lt;<a class="reference external" href="mailto:hughes.damry&#64;acsone.eu">hughes.damry&#64;acsone.eu</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#toc-entry-6">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/account-invoicing/tree/16.0/account_tax_one_vat">OCA/account-invoicing</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div>
</div>
</div>
</body>
</html>

View file

@ -0,0 +1,2 @@
from . import common
from . import test_account_tax_one_vat

View file

@ -0,0 +1,102 @@
# Copyright 2023 Acsone SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.addons.account.tests.common import AccountTestInvoicingCommon
class TestAccountTaxOneVatCommon(AccountTestInvoicingCommon):
@classmethod
def setUpClass(cls, chart_template_ref=None):
super().setUpClass(chart_template_ref=chart_template_ref)
cls.env.user.company_id = cls.company_data["company"]
cls.env = cls.env(context=dict(cls.env.context, tracking_disable=True))
cls.vat_tax_1 = cls.env["account.tax"].create(
{
"name": "21%",
"amount_type": "percent",
"amount": 21,
"sequence": 10,
"is_vat": True,
}
)
cls.vat_tax_2 = cls.env["account.tax"].create(
{
"name": "12%",
"amount_type": "percent",
"amount": 12,
"sequence": 20,
"is_vat": True,
}
)
cls.tax_3 = cls.env["account.tax"].create(
{
"name": "6%",
"amount_type": "percent",
"amount": 6,
"sequence": 30,
}
)
cls.test_move = cls.env["account.move"].create(
{
"move_type": "entry",
"line_ids": [
(
0,
None,
{
"name": "revenue line 1",
"account_id": cls.company_data[
"default_account_revenue"
].id,
"debit": 500.0,
"credit": 0.0,
},
),
(
0,
None,
{
"name": "counterpart line",
"account_id": cls.company_data[
"default_account_expense"
].id,
"debit": 0.0,
"credit": 500.0,
},
),
],
}
)
cls.vat_taxes = cls.vat_tax_1 | cls.vat_tax_2
cls.mixed_taxes = cls.vat_tax_1 | cls.tax_3
cls.product_test = cls.env["product.product"].create(
{
"name": "product_test",
"company_id": cls.env.user.company_id.id,
}
)
def _create_invoice(self, taxes_per_line):
"""Create an invoice on the fly.
:param taxes_per_line: A list of tuple (price_unit, account.tax recordset)
"""
vals = {
"move_type": "out_invoice",
"partner_id": self.partner_a.id,
"invoice_line_ids": [
(
0,
0,
{
"name": "xxxx",
"quantity": 1,
"price_unit": amount,
"tax_ids": [(6, 0, taxes.ids)],
},
)
for amount, taxes in taxes_per_line
],
}
return self.env["account.move"].create(vals)

View file

@ -0,0 +1,157 @@
# Copyright 2023 Acsone SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
from odoo.exceptions import UserError, ValidationError
from odoo.fields import Command
from odoo.tests import tagged
from .common import TestAccountTaxOneVatCommon
@tagged("post_install", "-at_install")
class TestAccountTaxOneVat(TestAccountTaxOneVatCommon):
def test_move_line_without_limitation(self):
"""
data:
- 'one vat tax only' setting is unset
case:
- create an invoice
set 2 VAT taxes on an invoice line
result:
- No warning upon onchange tax_ids
"""
# unset the one vat tax only setting
self.env["res.config.settings"].create({"account_tax_one_vat": False}).execute()
invoice = self._create_invoice([(100, self.tax_3)])
move_line = invoice.line_ids[0]
move_line.tax_ids = [Command.set(self.vat_taxes.ids)]
action = move_line._onchange_only_one_vat_tax()
self.assertEqual(action, {})
self.assertEqual(move_line.tax_ids, self.vat_taxes)
def test_move_line_with_limitation_warning(self):
"""
data:
- 'one vat tax only' setting is set
case:
- create an invoice
- set 2 VAT taxes on an invoice line
result:
- Get a warning upon onchange tax_ids
"""
self.env["res.config.settings"].create({"account_tax_one_vat": True}).execute()
invoice = self._create_invoice([(100, self.tax_3)])
move_line = invoice.line_ids[0]
move_line.tax_ids = [Command.set(self.vat_taxes.ids)]
action = move_line._onchange_only_one_vat_tax()
self.assertTrue("warning" in action)
self.assertDictEqual(
action,
{
"warning": {
"title": "More than one VAT tax selected!",
"message": "You selected more than one tax of type VAT.",
}
},
)
self.assertEqual(move_line.tax_ids, self.vat_taxes)
def test_move_line_with_limitation_no_warning(self):
"""
data:
- 'one vat tax only' setting is set
case:
- create an invoice
- set 2 taxes (only 1 is VAT) on an invoice line
result:
- No warning upon onchange tax_ids
"""
self.env["res.config.settings"].create({"account_tax_one_vat": True}).execute()
invoice = self._create_invoice([(100, self.tax_3)])
move_line = invoice.line_ids[0]
move_line.tax_ids = [Command.set(self.mixed_taxes.ids)]
action = move_line._onchange_only_one_vat_tax()
self.assertEqual(action, {})
self.assertEqual(move_line.tax_ids, self.mixed_taxes)
def test_invoice_post_with_limitation(self):
"""
data:
- 'one vat tax only' setting is set
- one draft invoice
case:
- set 2 VAT taxes on an invoice line and confirm the invoice
result:
- Get a UserError and the invoice is still draft
"""
self.env["res.config.settings"].create({"account_tax_one_vat": True}).execute()
invoice = self._create_invoice([(100, self.tax_3)])
move_line = invoice.line_ids[0]
move_line.tax_ids = [Command.set(self.vat_taxes.ids)]
self.assertEqual(invoice.state, "draft")
with self.assertRaises(UserError):
invoice.action_post()
self.assertEqual(invoice.state, "draft")
def test_product_without_limitation(self):
"""
data:
- 'one vat tax only' setting is unset
- a product
case:
- create an invoice
- set 2 VAT taxes on the product
result:
- vat field is not set
"""
# unset the one vat tax only setting
self.env["res.config.settings"].create({"account_tax_one_vat": False}).execute()
self.product_test.taxes_id = [Command.set(self.vat_taxes.ids)]
self.assertEqual(self.product_test.taxes_id, self.vat_taxes)
self.product_test.supplier_taxes_id = [Command.set(self.vat_taxes.ids)]
self.assertEqual(self.product_test.supplier_taxes_id, self.vat_taxes)
# vat is not set
self.assertFalse(self.product_test.vat_id)
self.assertFalse(self.product_test.vat)
def test_product_with_limitation_constraint(self):
"""
data:
- 'one vat tax only' setting is set
- a product
case:
- set 2 VAT taxes on the product
result:
- get a ValidationError
- vat field is not set
"""
# set the one vat tax only setting
self.env["res.config.settings"].create({"account_tax_one_vat": True}).execute()
msg = "Multiple customer tax of type VAT are selected. Only one is allowed."
with self.assertRaises(ValidationError, msg=msg):
self.product_test.taxes_id = [Command.set(self.vat_taxes.ids)]
with self.assertRaises(ValidationError, msg=msg):
self.product_test.supplier_taxes_id = [Command.set(self.vat_taxes.ids)]
# vat is not set
self.assertFalse(self.product_test.vat_id)
self.assertFalse(self.product_test.vat)
def test_product_with_limitation_no_constraint(self):
"""
data:
- 'one vat tax only' setting is set
- a product
case:
- set 2 taxes (only 1 VAT) on the product
result:
- vat field is set to the VAT tax
"""
# set the one vat tax only setting
self.env["res.config.settings"].create({"account_tax_one_vat": True}).execute()
self.product_test.taxes_id = [Command.link(t.id) for t in self.mixed_taxes]
self.product_test.supplier_taxes_id = [
Command.link(t.id) for t in self.mixed_taxes
]
# vat is set
self.assertEqual(self.product_test.vat_id, self.vat_tax_1)
self.assertEqual(self.product_test.vat, self.vat_tax_1.name)

View file

@ -0,0 +1,35 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_tax_tree" model="ir.ui.view">
<field name="name">account.tax.tree in (account_tax_one_vat)</field>
<field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_tax_tree" />
<field name="arch" type="xml">
<field name="description" position="after">
<field name="is_vat" />
</field>
</field>
</record>
<record id="view_account_tax_search" model="ir.ui.view">
<field name="name">account.tax.search in (account_tax_one_vat)</field>
<field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_account_tax_search" />
<field name="arch" type="xml">
<filter name="purchase" position="after">
<filter string="VAT" name="vat" domain="[('is_vat','=',True)]" />
</filter>
</field>
</record>
<record id="view_tax_form" model="ir.ui.view">
<field name="name">account.tax.form in (account_tax_one_vat)</field>
<field name="model">account.tax</field>
<field name="inherit_id" ref="account.view_tax_form" />
<field name="arch" type="xml">
<group name="advanced_booleans" position="inside">
<field name="is_vat" />
</group>
</field>
</record>
</odoo>

View file

@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="res_config_settings_view_form" model="ir.ui.view">
<field
name="name"
>res.config.settings.view.form in (account_tax_one_vat)</field>
<field name="model">res.config.settings</field>
<field name="inherit_id" ref="account.res_config_settings_view_form" />
<field name="arch" type="xml">
<xpath
expr="//div[@name='default_taxes_setting_container']"
position="inside"
>
<div class="col-12 col-lg-6 o_setting_box">
<div class="o_setting_left_pane">
<field name="account_tax_one_vat" />
</div>
<div class="o_setting_right_pane">
<label for="account_tax_one_vat" />
<div class="text-muted">
Avoid the selection of multiple VAT taxes.
</div>
</div>
</div>
</xpath>
</field>
</record>
</odoo>

View file

@ -0,0 +1,32 @@
# Architecture
```mermaid
flowchart TD
U[Users] -->|HTTP| V[Views and QWeb Templates]
V --> C[Controllers]
V --> W[Wizards Transient Models]
C --> M[Models and ORM]
W --> M
M --> R[Reports]
DX[Data XML] --> M
S[Security ACLs and Groups] -. enforces .-> M
subgraph Account_tax_one_vat Module - account_tax_one_vat
direction LR
M:::layer
W:::layer
C:::layer
V:::layer
R:::layer
S:::layer
DX:::layer
end
classDef layer fill:#eef8ff,stroke:#6ea8fe,stroke-width:1px
```
Notes
- Views include tree/form/kanban templates and report templates.
- Controllers provide website/portal routes when present.
- Wizards are UI flows implemented with `models.TransientModel`.
- Data XML loads data/demo records; Security defines groups and access.

View file

@ -0,0 +1,3 @@
# Configuration
Refer to Odoo settings for account_tax_one_vat. Configure related models, access rights, and options as needed.

View file

@ -0,0 +1,3 @@
# Controllers
This module does not define custom HTTP controllers.

View file

@ -0,0 +1,5 @@
# Dependencies
This addon depends on:
- [account](../../odoo-bringout-oca-ocb-account)

View file

@ -0,0 +1,4 @@
# FAQ
- Q: Which Odoo version? A: 16.0 (OCA/OCB packaged).
- Q: How to enable? A: Start server with --addon account_tax_one_vat or install in UI.

View file

@ -0,0 +1,7 @@
# Install
```bash
pip install odoo-bringout-oca-account-invoicing-account_tax_one_vat"
# or
uv pip install odoo-bringout-oca-account-invoicing-account_tax_one_vat"
```

View file

@ -0,0 +1,19 @@
# Models
Detected core models and extensions in account_tax_one_vat.
```mermaid
classDiagram
class account_move_line
class one_vat_mixin
class product_template
class account_move
class account_tax
class account_tax_template
class res_company
class res_config_settings
```
Notes
- Classes show model technical names; fields omitted for brevity.
- Items listed under _inherit are extensions of existing models.

View file

@ -0,0 +1,6 @@
# Overview
Packaged Odoo addon: account_tax_one_vat. Provides features documented in upstream Odoo 16 under this addon.
- Source: OCA/OCB 16.0, addon account_tax_one_vat
- License: LGPL-3

View file

@ -0,0 +1,3 @@
# Reports
This module does not define custom reports.

View file

@ -0,0 +1,8 @@
# Security
This module does not define custom security rules or access controls beyond Odoo defaults.
Default Odoo security applies:
- Base user access through standard groups
- Model access inherited from dependencies
- No custom row-level security rules

View file

@ -0,0 +1,5 @@
# Troubleshooting
- Ensure Python and Odoo environment matches repo guidance.
- Check database connectivity and logs if startup fails.
- Validate that dependent addons listed in DEPENDENCIES.md are installed.

View file

@ -0,0 +1,7 @@
# Usage
Start Odoo including this addon (from repo root):
```bash
python3 scripts/nix_odoo_web_server.py --db-name mydb --addon account_tax_one_vat
```

View file

@ -0,0 +1,3 @@
# Wizards
This module does not include UI wizards.

View file

@ -0,0 +1,42 @@
[project]
name = "odoo-bringout-oca-account-invoicing-account_tax_one_vat"
version = "16.0.0"
description = "Account Tax One VAT - Allow only the selection of one VAT Tax."
authors = [
{ name = "Ernad Husremovic", email = "hernad@bring.out.ba" }
]
dependencies = [
"odoo-bringout-oca-ocb-account>=16.0.0",
"requests>=2.25.1"
]
readme = "README.md"
requires-python = ">= 3.11"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Office/Business",
]
[project.urls]
homepage = "https://github.com/bringout/0"
repository = "https://github.com/bringout/0"
[build-system]
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.hatch.metadata]
allow-direct-references = true
[tool.hatch.build.targets.wheel]
packages = ["account_tax_one_vat"]
[tool.rye]
managed = true
dev-dependencies = [
"pytest>=8.4.1",
]