diff --git a/partner_vat_unique/README.rst b/partner_vat_unique/README.rst index 980af41b2..4aca28e02 100644 --- a/partner_vat_unique/README.rst +++ b/partner_vat_unique/README.rst @@ -14,13 +14,13 @@ Partner VAT Unique :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html :alt: License: AGPL-3 .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fpartner--contact-lightgray.png?logo=github - :target: https://github.com/OCA/partner-contact/tree/12.0/partner_vat_unique + :target: https://github.com/OCA/partner-contact/tree/13.0/partner_vat_unique :alt: OCA/partner-contact .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png - :target: https://translation.odoo-community.org/projects/partner-contact-12-0/partner-contact-12-0-partner_vat_unique + :target: https://translation.odoo-community.org/projects/partner-contact-13-0/partner-contact-13-0-partner_vat_unique :alt: Translate me on Weblate .. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png - :target: https://runbot.odoo-community.org/runbot/134/12.0 + :target: https://runbot.odoo-community.org/runbot/134/13.0 :alt: Try me on Runbot |badge1| |badge2| |badge3| |badge4| |badge5| @@ -39,13 +39,19 @@ Installation Will not check previous VAT duplicates, so it is recomended make sure there isn't any duplicated VAT before installation. +Known issues / Roadmap +====================== + +* Creation of the partner from XML-RPC. +* Partner creation by importing a CSV file, in those cases you miss the notice. + 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 `_. +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -61,10 +67,13 @@ Contributors ~~~~~~~~~~~~ * Ismael Calvo -* Vicent Cubells * Michael Michot * Koen Loodts +* `Tecnativa `__: + * Vicent Cubells + * Manuel Calero - Tecnativa + Maintainers ~~~~~~~~~~~ @@ -78,6 +87,6 @@ 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/partner-contact `_ project on GitHub. +This module is part of the `OCA/partner-contact `_ project on GitHub. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. diff --git a/partner_vat_unique/__manifest__.py b/partner_vat_unique/__manifest__.py index ee7f818a5..0488c39da 100644 --- a/partner_vat_unique/__manifest__.py +++ b/partner_vat_unique/__manifest__.py @@ -1,9 +1,10 @@ # Copyright 2017 Grant Thornton Spain - Ismael Calvo -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# Copyright 2020 Manuel Calero - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). { "name": "Partner VAT Unique", "summary": "Module to make the VAT number unique for customers and suppliers.", - "version": "12.0.1.0.1", + "version": "13.0.1.0.0", "category": "Customer Relationship Management", "website": "https://github.com/OCA/partner-contact", "author": "Grant Thornton S.L.P, Odoo Community Association (OCA)", diff --git a/partner_vat_unique/i18n/es.po b/partner_vat_unique/i18n/es.po index ed08392ce..9a7f91ee9 100644 --- a/partner_vat_unique/i18n/es.po +++ b/partner_vat_unique/i18n/es.po @@ -20,13 +20,13 @@ msgstr "" #. module: partner_vat_unique #: model:ir.model,name:partner_vat_unique.model_res_partner msgid "Contact" -msgstr "" +msgstr "Contacto" #. module: partner_vat_unique #: model:ir.model.fields,field_description:partner_vat_unique.field_res_partner__vat #: model:ir.model.fields,field_description:partner_vat_unique.field_res_users__vat msgid "Tax ID" -msgstr "" +msgstr "Tax" #. module: partner_vat_unique #: model:ir.model.fields,help:partner_vat_unique.field_res_partner__vat @@ -35,6 +35,8 @@ msgid "" "The Tax Identification Number. Complete it if the contact is subjected to " "government taxes. Used in some legal statements." msgstr "" +"Complete el número de identificación fiscal si el contacto está sujeto " +"a impuestos gubernamentales. Utilizado en algunas declaraciones legales" #. module: partner_vat_unique #: code:addons/partner_vat_unique/models/res_partner.py:29 diff --git a/partner_vat_unique/models/res_partner.py b/partner_vat_unique/models/res_partner.py index 2b62ad9b7..88944f1d2 100644 --- a/partner_vat_unique/models/res_partner.py +++ b/partner_vat_unique/models/res_partner.py @@ -1,5 +1,6 @@ # Copyright 2017 Grant Thornton Spain - Ismael Calvo -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# Copyright 2020 Manuel Calero - Tecnativa +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo import _, api, fields, models from odoo.exceptions import ValidationError @@ -21,14 +22,7 @@ class ResPartner(models.Model): ) if test_condition: continue - results = self.env["res.partner"].search_count( - [ - ("parent_id", "=", False), - ("vat", "=", record.vat), - ("id", "!=", record.id), - ] - ) - if results: + if record.same_vat_partner_id: raise ValidationError( - _("The VAT %s already exists in another " "partner.") % record.vat + _("The VAT %s already exists in another partner.") % record.vat ) diff --git a/partner_vat_unique/readme/CONTRIBUTORS.rst b/partner_vat_unique/readme/CONTRIBUTORS.rst index 1d3d7966d..69a906a67 100644 --- a/partner_vat_unique/readme/CONTRIBUTORS.rst +++ b/partner_vat_unique/readme/CONTRIBUTORS.rst @@ -1,4 +1,7 @@ * Ismael Calvo -* Vicent Cubells * Michael Michot * Koen Loodts + +* `Tecnativa `__: + * Vicent Cubells + * Manuel Calero - Tecnativa diff --git a/partner_vat_unique/readme/ROADMAP.rst b/partner_vat_unique/readme/ROADMAP.rst new file mode 100644 index 000000000..606c4f0b0 --- /dev/null +++ b/partner_vat_unique/readme/ROADMAP.rst @@ -0,0 +1,2 @@ +* Creation of the partner from XML-RPC. +* Partner creation by importing a CSV file, in those cases you miss the notice. diff --git a/partner_vat_unique/static/description/index.html b/partner_vat_unique/static/description/index.html index dc1ea0627..f71b0cb1d 100644 --- a/partner_vat_unique/static/description/index.html +++ b/partner_vat_unique/static/description/index.html @@ -367,18 +367,19 @@ ul.auto-toc { !! This file is generated by oca-gen-addon-readme !! !! changes will be overwritten. !! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> -

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

+

Beta License: AGPL-3 OCA/partner-contact Translate me on Weblate Try me on Runbot

Module to make the VAT number unique for customers and suppliers. Will not consider empty VATs as duplicated.

Table of contents

+
+

Known issues / Roadmap

+
    +
  • Creation of the partner from XML-RPC.
  • +
  • Partner creation by importing a CSV file, in those cases you miss the notice.
  • +
+
-

Bug Tracker

+

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.

+feedback.

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

-

Credits

+

Credits

-

Authors

+

Authors

  • Grant Thornton S.L.P
-

Contributors

+

Contributors

-

Maintainers

+

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/partner-contact project on GitHub.

+

This module is part of the OCA/partner-contact project on GitHub.

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

diff --git a/partner_vat_unique/tests/test_vat_unique.py b/partner_vat_unique/tests/test_vat_unique.py index c5413c754..94a67d095 100644 --- a/partner_vat_unique/tests/test_vat_unique.py +++ b/partner_vat_unique/tests/test_vat_unique.py @@ -1,5 +1,5 @@ # Copyright 2017 Grant Thornton Spain - Ismael Calvo -# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). from odoo.exceptions import ValidationError from odoo.tests.common import SavepointCase