[base_vat] Basic VAT check when country specific check not defined in the module

Bug #876200 reported by Jordi Ballester (www.avangard-eis.com)
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Odoo Addons (MOVED TO GITHUB)
Won't Fix
Undecided
Unassigned

Bug Description

The module base_vat does not consider all VAT countries worldwide.

In case that a country specific validation is not defined in the base_vat module, only a basic country check should be performed, but otherwise should allow the VAT code to be introduced.

The basic check should be as per http://en.wikipedia.org/wiki/VAT_identification_number#VAT_numbers_by_countries:

The full identifier starts with an ISO 3166-1 alpha-2 country code (except for Greece which uses the non-standard country code EL) and then has between 5 and 12 characters. These 5 to 12 characters are numeric in most countries but in some countries they may contain letters.

Related branches

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Jordi Ballester,

I have checked your issue as per your specification but it's working normally at my end (ex., CY99999999L,

FRXX999999999). Supported countries currently include EU countries, and a few non-EU countries

such as Chile, Colombia, Mexico, Norway or Russia. For unsupported countries, only the country code will be

validated. If you enter wrong country code it is not allowed. Would you please provide example in which case you

faced the problem.

Thanks and waiting for your reply.

Changed in openobject-addons:
status: New → Incomplete
Revision history for this message
Jordi Ballester (www.avangard-eis.com) (jordi-ballester-avangard-eis) wrote :

Hello Vishal,

I'm using version 6.0.3

What I mean is, if you enter country code + vat number for a country which does not include a specific validation module, the application will issue the error message "The Vat does not seems to be correct. You should have entered something like this : Country Code + Vat Number", and won't allow the VAT to be entered.

If the country code is not entered, the application issues the error message "The VAT is invalid, It should begin with the country code".

For example, enter AR03023023, for Argentina VAT. The system won't allow to enter this VAT.

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Jordi Ballester,

Yes, I agree with you.

We have followed the standard for base_vat module from this web-site http://sima-pc.com/nif.php.

So would you please check it and notify us.

Thanks.

Revision history for this message
Jordi Ballester (www.avangard-eis.com) (jordi-ballester-avangard-eis) wrote :

Vishal,

The web-site http://sima-pc.com/nif.php defines the VAT rules for the EU countries, but not for non-EU countries. For example, it does not cover India VAT rules.

What I'm saying is, if a company has a customer or vendor in India, at this moment it is not possible to register the india VAT for this partner, becuase the application won't allow it.

To me, this is a blocking error.

The application should allow to enter any VAT, as long as the basic rules of country code is followed.

Thanks!

Revision history for this message
Vishal Parmar(Open ERP) (vpa-openerp) wrote :

Hello Jordi Ballester,

This issue is already fix in trunk version and working fine.

Our R&D Teams are focused on the latest OpenERP version, and this issue does not affect it.

Our policy is to keep the changes applied on stable branches to a minimum, in order to limit the regression risks

for customers that are in production. This means that bugs reported on Launchpad are fixed in the trunk branch

only by default, even if they were reported against other stable versions.

We stand of course ready to backport the change to stable releases if it has an impact on any customer. If you

have a support and maintenance contract with us then you can contact our OPW team at

<email address hidden> will quickly help solve the issue and backport the fix if needed.

Thank you for your understanding!

Changed in openobject-addons:
status: Incomplete → Won't Fix
Revision history for this message
xrg (xrg) wrote : Re: [Bug 876200] Re: [base_vat] Basic VAT check when country specific check not defined in the module

On Monday 17 October 2011, you wrote:
> To me, this is a blocking error.
>
> The application should allow to enter any VAT, as long as the basic
> rules of country code is followed.

Well, please consider the inverse logic, which is in fact applied in the
"trunk-xrg" series (long ago):
 - if letters are provided, the VAT is checked against the country's specific
algorithm (if available)
 - if they are /not/ provided, country is assumed to be partner's country.
Fair, isn't it?
 - if the partner's country is not set, the current company's country is
assumed (that's usually the case)

So, it is more usable, because we don't need to enter these letters. Then, for
each country, there is a boolean field in country's settings to enable/disable
VAT num. calculation, and another field to select default letters (used for the
"EL" case, here).
In "trunk-xrg", you can add extra countries like that, just by adding their
letters to "res.country" and disabling the check. Would that cover you?

At the end, this functionality (although inverse) is similar to what you're
asking. The only missing is a check that VAT num's country must agree with
partner's country (would we have any exceptions?).

--
Say NO to spam and viruses. Stop using Microsoft Windows!

Revision history for this message
Jordi Ballester (www.avangard-eis.com) (jordi-ballester-avangard-eis) wrote :

Hi Xrg, your approach is brilliant!

I would agree that the check of VAT num's country must agree with the country where the partner is established. But then, what happens when partners have multiple addresses? It's not a critical check to me, so far.

Thanks!
Jordi.

Revision history for this message
Leonardo Pistone (lepistone) wrote :

Hi all.

I particularly agree with comment #4: vat checking is a nice plus, but customers must be able to enter any VAT code, even from an unsupported country.

There are many better approaches to to this check, like the xrg one, or the one in 6.1 (not tested yet). Still, the general idea should be that the module tries to check what it can, and only give an error when it knows that the number is incorrect.

A quick fix for v6 is just to "return True" instead of "return False" when we have an unknown country. I think we can get that in, since my customer has a service contract ) . General improvements can still go to 6.1.

Thanks!

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.