[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
This commit is contained in:
parent
6ba2b16969
commit
36106a4d8a
@ -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 <https://github.com/OCA/account-financial-tools/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 <https://github.com/OCA/account-financial-tools/issues/new?body=module:%20base_vat_optional_vies%0Aversion:%208.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
|
||||
Bugs are tracked on `GitHub Issues
|
||||
<https://github.com/OCA/account-financial-tools/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 <rafabn@antiun.com>
|
||||
* Antonio Espinosa <antonioea@antiun.com>
|
||||
* Sergio Teruel <sergio.teruel@tecnativa.com>
|
||||
|
||||
|
||||
Maintainer
|
||||
|
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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
|
||||
|
@ -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:
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user