OpenErp 7
In:
Vendite -> Ordini di vendita -> selezionando un ordine di vendita
Tentando di generare una fattura (di un ordine), ricevo il seguente errore:
Server Traceback (most recent call last):
File "/home/odoo/lp/openerp/openerp/addons/web/session.py", line 89, in send
return openerp.netsvc.dispatch_rpc(service_name, method, args)
File "/home/odoo/lp/openerp/openerp/netsvc.py", line 296, in dispatch_rpc
result = ExportService.getService(service_name).dispatch(method, params)
File "/home/odoo/lp/openerp/openerp/service/web_services.py", line 626, in dispatch
res = fn(db, uid, *params)
File "/home/odoo/lp/openerp/openerp/osv/osv.py", line 190, in execute_kw
return self.execute(db, uid, obj, method, *args, **kw or {})
File "/home/odoo/lp/openerp/openerp/osv/osv.py", line 132, in wrapper
return f(self, dbname, *args, **kwargs)
File "/home/odoo/lp/openerp/openerp/osv/osv.py", line 199, in execute
res = self.execute_cr(cr, uid, obj, method, *args, **kw)
File "/home/odoo/lp/openerp/openerp/osv/osv.py", line 187, in execute_cr
return getattr(object, method)(cr, uid, *args, **kw)
File "/home/odoo/lp/openerp/openerp/addons/sale/wizard/sale_make_invoice_advance.py", line 174, in create_invoices
res = sale_obj.manual_invoice(cr, uid, sale_ids, context)
File "/home/odoo/lp/openerp/openerp/addons/sale/sale.py", line 436, in manual_invoice
wf_service.trg_validate(uid, 'sale.order', id, 'manual_invoice', cr)
File "/home/odoo/lp/openerp/openerp/workflow/wkf_service.py", line 119, in trg_validate
res2 = instance.validate(cr, id, ident, signal)
File "/home/odoo/lp/openerp/openerp/workflow/instance.py", line 43, in validate
workitem.process(cr, witem, ident, signal, force_running, stack=stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 60, in process
ok = _split_test(cr, workitem, activity, ident, signal, stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 175, in _split_test
_join_test(cr, t[0], t[1], ident, stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 183, in _join_test
create(cr,[activity], inst_id, ident, stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 40, in create
process(cr, res, ident, stack=stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 52, in process
result = _execute(cr, workitem, activity, ident, stack)
File "/home/odoo/lp/openerp/openerp/workflow/workitem.py", line 127, in _execute
id_new = wkf_expr.execute(cr, ident, workitem, activity)
File "/home/odoo/lp/openerp/openerp/workflow/wkf_expr.py", line 67, in execute
return _eval_expr(cr, ident, workitem, activity)
File "/home/odoo/lp/openerp/openerp/workflow/wkf_expr.py", line 57, in _eval_expr
ret = eval(line, env, nocopy=True)
File "/home/odoo/lp/openerp/openerp/tools/safe_eval.py", line 285, in safe_eval
return eval(test_expr(expr, _SAFE_OPCODES, mode=mode), globals_dict, locals_dict)
File "", line 1, in <module>
File "/home/odoo/lp/openerp/openerp/osv/orm.py", line 377, in function_proxy
return attr(self._cr, self._uid, [self._id], *args, **kwargs)
File "/home/odoo/lp/openerp/openerp/addons/sale_stock/sale_stock.py", line 193, 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/odoo/lp/openerp/openerp/addons/sale/sale.py", line 541, in action_invoice_create
res = self._make_invoice(cr, uid, order, il, context=context)
File "/home/odoo/lp/openerp/openerp/addons/l10n_it_sale/sale/sale.py", line 52, in _make_invoice
partner.transportation_reason_id.id),
File "/home/odoo/lp/openerp/openerp/addons/account_makeover/invoice/account_invoice.py", line 583, in write
for t_id in ids:
TypeError: 'long' object is not iterable
questo è il codice rilevante in account_invoice.py :
def write(self, cr, uid, ids, vals, context=None):
if context is None:
context = {}
for t_id in ids:
t_acc_inv = self.browse(cr, uid, t_id)
...(continua)...
questo è il codice rilevante in sale.py :
def _make_invoice(self, cr, uid, order, lines, context={}):
inv_id = super(sale_order, self)._make_invoice(cr, uid, order, lines, context)
partner = self.pool.get('res.partner').browse(cr , uid, order.partner_id.id)
self.pool.get('account.invoice').write(cr, uid, inv_id, {
# 'order_id': order.id,
'carriage_condition_id': partner.carriage_condition_id.id,
'goods_description_id': partner.goods_description_id.id,
'transportation_reason_id': partner.transportation_reason_id.id,
})
return inv_id
A questo punto non mi è chiaro se l'errore sia in:
inv_id = super(sale_order, self)._make_invoice(cr, uid, order, lines, context)
O in
partner = self.pool.get('res.partner').browse(cr , uid, order.partner_id.id)
Qualunque suggerimento è benvenuto,
grazie.