Step-1 Install the avatax module.
Step-2 After that custmozie .py(Python file) file:
In below example, I have custmozied .py file. You can directly copy the below python code in your .py file -
profileNameSpace = ('ns1', 'http://avatax.avalara.com/services')
profile = suds.sax.element.Element('Profile', ns=profileNameSpace)
profile.append(suds.sax.element.Element('Client', ns=profileNameSpace).setText(CLIENT))
profile.append(suds.sax.element.Element('Adapter', ns=profileNameSpace).setText(ADAPTER))
hostname = socket.gethostname()
profile.append(suds.sax.element.Element('Machine', ns=profileNameSpace).setText(hostname))
return profile
def get_result(self, svc, operation, request):
try:
result = operation(request)
except suds.WebFault, e:
raise osv.except_osv(_('Avatax: Error'), _(e.fault.faultstring))
except urllib2.HTTPError, e:
raise osv.except_osv(_('Avatax: Server Failed to Response'), _(e.code))
except urllib2.URLError, details
0 Comment(s)