Hi,
There is a problem creating invoice from sale order when more than one company uses AVATAX tax,
[Configuration]
* Create two companies A (US) and B (Canada)
* Create two taxes with name AVATAX
* Configure AVATAX tax
[Steps to reproduce bug]
* Create sale order with US delivery address
* Calculate tax
* Create invoice from sale order
[Traceback]
2014-08-13 15:48:30,700 1715 ERROR production openerp.tools.safe_eval: Cannot eval u'action_invoice_create()'
Traceback (most recent call last):
File "/home/openerp/7.0/server/openerp/tools/safe_eval.py", line 284, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "", line 1, in <module>
File "/home/openerp/7.0/server/openerp/osv/orm.py", line 377, in function_proxy
return attr(self._cr, self._uid, [self._id], *args, **kwargs)
File "/home/openerp/7.0/7.0-fixes/sale_stock/sale_stock.py", line 192, in action_invoice_create
res = super(sale_order,self).action_invoice_create( cr, uid, ids, grouped=grouped, states=states, date_invoice = date_invoice, context=context)
File "/home/openerp/7.0/7.0-fixes/sale/sale.py", line 547, in action_invoice_create
res = self._make_invoice(cr, uid, order, il, context=context)
File "/home/openerp/7.0/avatax/avalara_salestax/sale_order.py", line 110, in _make_invoice
inv_id = super(sale_order, self)._make_invoice(cr, uid, order, lines, context=None)
File "/home/openerp/7.0/7.0-fixes/sale/sale.py", line 413, in _make_invoice
inv_obj.button_compute(cr, uid, [inv_id])
File "/home/openerp/7.0/7.0-fixes/account/account_invoice.py", line 750, in button_compute
self.button_reset_taxes(cr, uid, ids, context)
File "/home/openerp/7.0/7.0-fixes/account/account_invoice.py", line 743, in button_reset_taxes
for taxe in ait_obj.compute(cr, uid, id, context=ctx).values():
File "/home/openerp/7.0/avatax/avalara_salestax/account_invoice.py", line 642, in compute
if not tax_brw.account_collected_id or not tax_brw.account_paid_id or not tax_brw.base_code_id or not tax_brw.tax_code_id or not tax_brw.ref_base_code_id or not tax_brw.ref_tax_code_id:
except_osv: (u'AvaTax: Warning !', u'Please configure tax code information in "AVATAX" settings \n\n Accounting->Configuration->Taxes->Taxes')
2014-08-13 15:48:30,712 1715 ERROR production openerp.netsvc: AvaTax: Warning !
Please configure tax code information in "AVATAX" settings
Accounting->Configuration->Taxes->Taxes
Traceback (most recent call last):
File "/home/openerp/7.0/server/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home/openerp/7.0/server/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/home/openerp/7.0/server/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/openerp/7.0/server/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/openerp/7.0/server/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/openerp/7.0/server/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/openerp/7.0/7.0-fixes/sale/wizard/sale_make_invoice_advance.py", line 170, in create_invoices
res = sale_obj.manual_invoice(cr, uid, sale_ids, context)
File "/home/openerp/7.0/7.0-fixes/sale/sale.py", line 440, in manual_invoice
wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)
File "/home/openerp/7.0/server/openerp/workflow/wkf_service.py", line 119, in trg_validate
res2 = instance.validate(cr, id, ident, signal)
File "/home/openerp/7.0/server/openerp/workflow/instance.py", line 43, in validate
workitem.process(cr, witem, ident, signal, force_running, stack=stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 60, in process
ok = _split_test(cr, workitem, activity['split_mode'], ident, signal, stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 175, in _split_test
_join_test(cr, t[0], t[1], ident, stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 183, in _join_test
create(cr,[activity], inst_id, ident, stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 40, in create
process(cr, res, ident, stack=stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 52, in process
result = _execute(cr, workitem, activity, ident, stack)
File "/home/openerp/7.0/server/openerp/workflow/workitem.py", line 127, in _execute
id_new = wkf_expr.execute(cr, ident, workitem, activity)
File "/home/openerp/7.0/server/openerp/workflow/wkf_expr.py", line 67, in execute
return _eval_expr(cr, ident, workitem, activity['action'])
File "/home/openerp/7.0/server/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
ret = eval(line, env, nocopy=True)
File "/home/openerp/7.0/server/openerp/tools/safe_eval.py", line 284, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "", line 1, in <module>
File "/home/openerp/7.0/server/openerp/osv/orm.py", line 377, in function_proxy
return attr(self._cr, self._uid, [self._id], *args, **kwargs)
File "/home/openerp/7.0/7.0-fixes/sale_stock/sale_stock.py", line 192, in action_invoice_create
res = super(sale_order,self).action_invoice_create( cr, uid, ids, grouped=grouped, states=states, date_invoice = date_invoice, context=context)
File "/home/openerp/7.0/7.0-fixes/sale/sale.py", line 547, in action_invoice_create
res = self._make_invoice(cr, uid, order, il, context=context)
File "/home/openerp/7.0/avatax/avalara_salestax/sale_order.py", line 110, in _make_invoice
inv_id = super(sale_order, self)._make_invoice(cr, uid, order, lines, context=None)
File "/home/openerp/7.0/7.0-fixes/sale/sale.py", line 413, in _make_invoice
inv_obj.button_compute(cr, uid, [inv_id])
File "/home/openerp/7.0/7.0-fixes/account/account_invoice.py", line 750, in button_compute
self.button_reset_taxes(cr, uid, ids, context)
File "/home/openerp/7.0/7.0-fixes/account/account_invoice.py", line 743, in button_reset_taxes
for taxe in ait_obj.compute(cr, uid, id, context=ctx).values():
File "/home/openerp/7.0/avatax/avalara_salestax/account_invoice.py", line 642, in compute
if not tax_brw.account_collected_id or not tax_brw.account_paid_id or not tax_brw.base_code_id or not tax_brw.tax_code_id or not tax_brw.ref_base_code_id or not tax_brw.ref_tax_code_id:
except_osv: (u'AvaTax: Warning !', u'Please configure tax code information in "AVATAX" settings \n\n Accounting->Configuration->Taxes->Taxes')
Resolved in update