← Back to team overview

openerp-india team mailing list archive

[Bug 939387] Re: check vat using vies will always fail GRAVE

 

BTW the check should be a onchange trigger not a button

-- 
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):
  Invalid

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