From 36106a4d8a0cce3516fda48f5757c7f66653c846 Mon Sep 17 00:00:00 2001 From: Sergio Teruel Albert Date: Tue, 13 Dec 2016 12:57:06 +0100 Subject: [PATCH] [FIX] Some fixes: * base_vat_optional_vies: Fix pass lower country code in _split_vat function to find parent function check_vat_'xx' instead of check_vat_'XX' * base_vat_optional_vies: Convert to upper when write NIF into database --- base_vat_optional_vies/README.rst | 12 +++++++----- base_vat_optional_vies/__init__.py | 2 -- base_vat_optional_vies/__openerp__.py | 5 +++-- base_vat_optional_vies/models/__init__.py | 2 -- base_vat_optional_vies/models/res_partner.py | 8 ++++---- base_vat_optional_vies/tests/__init__.py | 2 -- base_vat_optional_vies/tests/test_res_partner.py | 2 +- 7 files changed, 15 insertions(+), 18 deletions(-) diff --git a/base_vat_optional_vies/README.rst b/base_vat_optional_vies/README.rst index 9a1d3eea..2ece8aca 100644 --- a/base_vat_optional_vies/README.rst +++ b/base_vat_optional_vies/README.rst @@ -21,7 +21,8 @@ Configuration ============= In order to activate VIES validation, you must set this option in your company: -Settings > Companies > Companies > Your Company > Configuration > Accounting > VIES VAT Check +Settings > Companies > Companies > Your Company > Configuration > Accounting +> VIES VAT Check Usage @@ -46,10 +47,10 @@ bypass country validation you can use "EU" code 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 -`here `_. +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. Credits @@ -60,6 +61,7 @@ Contributors * Rafael Blasco * Antonio Espinosa +* Sergio Teruel Maintainer diff --git a/base_vat_optional_vies/__init__.py b/base_vat_optional_vies/__init__.py index ab13a621..cde864ba 100644 --- a/base_vat_optional_vies/__init__.py +++ b/base_vat_optional_vies/__init__.py @@ -1,5 +1,3 @@ # -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa -# See README.rst file on addon root folder for more details from . import models diff --git a/base_vat_optional_vies/__openerp__.py b/base_vat_optional_vies/__openerp__.py index 08f8dfe3..d2f05aa7 100644 --- a/base_vat_optional_vies/__openerp__.py +++ b/base_vat_optional_vies/__openerp__.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3: Tecnativa S.L. - Antonio Espinosa # See README.rst file on addon root folder for more details { @@ -16,8 +16,9 @@ 'views/res_partner_view.xml', ], 'author': 'Antiun IngenierĂ­a S.L., ' + 'Tecnativa,' 'Odoo Community Association (OCA)', - 'website': 'http://www.antiun.com', + 'website': 'http://www.tecnativa.com', 'license': 'AGPL-3', 'images': [], 'installable': True, diff --git a/base_vat_optional_vies/models/__init__.py b/base_vat_optional_vies/models/__init__.py index 31fca90e..6097f3eb 100644 --- a/base_vat_optional_vies/models/__init__.py +++ b/base_vat_optional_vies/models/__init__.py @@ -1,5 +1,3 @@ -# -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa # See README.rst file on addon root folder for more details from . import res_partner diff --git a/base_vat_optional_vies/models/res_partner.py b/base_vat_optional_vies/models/res_partner.py index 20c7668e..4f114125 100644 --- a/base_vat_optional_vies/models/res_partner.py +++ b/base_vat_optional_vies/models/res_partner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3: Tecnativa S.L. - Antonio Espinosa # See README.rst file on addon root folder for more details import logging @@ -52,7 +52,7 @@ class ResPartner(models.Model): vat_country = 'XX' vat_number = vat if vat and re.match(r'[A-Za-z]{2}', vat): - vat_country = vat[:2].upper() + vat_country = vat[:2].lower() vat_number = vat[2:].replace(' ', '') elif country: vat_country = country @@ -89,7 +89,7 @@ class ResPartner(models.Model): # Can not be sure that this VAT is signed up in VIES data['vies_passed'] = False if res: - vat = country_code + vat_number + vat = country_code.upper() + vat_number if self.vat != vat: data['vat'] = vat if data: @@ -123,7 +123,7 @@ class ResPartner(models.Model): if self.vies_passed: data['vies_passed'] = False if res: - vat = country_code + vat_number + vat = country_code.upper() + vat_number if self.vat != vat: data['vat'] = vat if data: diff --git a/base_vat_optional_vies/tests/__init__.py b/base_vat_optional_vies/tests/__init__.py index 64a6a530..db0b977d 100644 --- a/base_vat_optional_vies/tests/__init__.py +++ b/base_vat_optional_vies/tests/__init__.py @@ -1,5 +1,3 @@ # -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa -# See README.rst file on addon root folder for more details from . import test_res_partner diff --git a/base_vat_optional_vies/tests/test_res_partner.py b/base_vat_optional_vies/tests/test_res_partner.py index 50dbd2e4..8aae1fd7 100644 --- a/base_vat_optional_vies/tests/test_res_partner.py +++ b/base_vat_optional_vies/tests/test_res_partner.py @@ -1,5 +1,5 @@ # -*- coding: utf-8 -*- -# License AGPL-3: Antiun Ingenieria S.L. - Antonio Espinosa +# License AGPL-3: Tecnativa S.L. - Antonio Espinosa # See README.rst file on addon root folder for more details from openerp.tests.common import TransactionCase