raise osv.except_osv(_('Warning!'), _("You shouldn't manually invoice the following sale order %s") % (sale_order.name))
order_obj.action_invoice_create(cr, uid, context.get(('active_ids'), []), data['grouped'], date_invoice=data['invoice_date'])
-
- for o in order_obj.browse(cr, uid, context.get(('active_ids'), []), context=context):
+ orders = order_obj.browse(cr, uid, context.get(('active_ids'), []), context=context)
+ for o in orders:
for i in o.invoice_ids:
newinv.append(i.id)
-
+ # Dummy call to workflow, will not create another invoice but bind the new invoice to the subflow
+ order_obj.signal_manual_invoice(cr, uid, [o.id for o in orders if o.order_policy == 'manual'])
result = mod_obj.get_object_reference(cr, uid, 'account', 'action_invoice_tree1')
id = result and result[1] or False
result = act_obj.read(cr, uid, [id], context=context)[0]