Esempio n. 1
0
 def cancel_tax(self, cr, uid, avatax_config, doc_code, doc_type, cancel_code):
      """Sometimes we have not need to tax calculation, then method is used to cancel taxation"""
      avalara_obj = AvaTaxService(avatax_config.account_number, avatax_config.license_key,
                               avatax_config.service_url, avatax_config.request_timeout,
                               avatax_config.logging)
      avalara_obj.create_tax_service()
      result = avalara_obj.cancel_tax(avatax_config.company_code, doc_code, doc_type, cancel_code)
      return result
 def cancel_tax(self, cr, uid, avatax_config, doc_code, doc_type, cancel_code):
      """Sometimes we have not need to tax calculation, then method is used to cancel taxation"""
      avalara_obj = AvaTaxService(avatax_config.account_number, avatax_config.license_key,
                               avatax_config.service_url, avatax_config.request_timeout,
                               avatax_config.logging)
      avalara_obj.create_tax_service()
      try:
          result = avalara_obj.get_tax_history(avatax_config.company_code, doc_code, doc_type)
      except:
          return True
     
      result = avalara_obj.cancel_tax(avatax_config.company_code, doc_code, doc_type, cancel_code)
      return result