openerp-india team mailing list archive
-
openerp-india team
-
Mailing list archive
-
Message #08029
[Bug 939387] Re: check vat using vies will always fail GRAVE
** Changed in: openobject-addons
Importance: Undecided => Low
** Changed in: openobject-addons
Status: New => Confirmed
** Changed in: openobject-addons
Assignee: (unassigned) => OpenERP R&D Addons Team 3 (openerp-dev-addons3)
--
You received this bug notification because you are a member of OpenERP
Indian Team, which is subscribed to OpenERP Addons.
https://bugs.launchpad.net/bugs/939387
Title:
check vat using vies will always fail GRAVE
Status in OpenERP Addons (modules):
Confirmed
Bug description:
gr py check_vies
./addons/base_vat/base_vat.py:114: if user_company.vat_check_vies:
./addons/base_vat/base_vat.py:98: return vatnumber.check_vies(country_code.upper()+vat_number)
./addons/base_vat/res_company.py:27: 'vat_check_vies': fields.boolean('VIES VAT Check',
check_vies is not defined anywhere
def vies_vat_check(self, cr, uid, country_code, vat_number, context=None):
try:
# Validate against VAT Information Exchange System (VIES)
# see also http://ec.europa.eu/taxation_customs/vies/
return vatnumber.check_vies(country_code.upper()+vat_number)
except Exception:
# see http://ec.europa.eu/taxation_customs/vies/checkVatService.wsdl
# Fault code may contain INVALID_INPUT, SERVICE_UNAVAILABLE, MS_UNAVAILABLE,
# TIMEOUT or SERVER_BUSY. There is no way we can validate the input
# with VIES if any of these arise, including the first one (it means invalid
# country code or empty VAT number), so we fall back to the simple check.
return self.simple_vat_check(cr, uid, country_code, vat_number, context=context)
IMHO this should be done by a on change trigger (not a button)
storing unchecked (false) numbers does not make sense at all - and has
legal consequences
I strongly suggest to store the date/time of the VIES check not just set
def vat_change(self, cr, uid, ids, value, context=None):
return {'value': {'vat_subjected': bool(value)}}
which can be overriden manualy
To manage notifications about this bug go to:
https://bugs.launchpad.net/openobject-addons/+bug/939387/+subscriptions
References