This is the confirm sale code :
def action_button_confirm(self, cr, uid, ids, context=None):
assert len(ids) == 1, 'This option should only be used for a single id at a time.'
wf_service = netsvc.LocalService('workflow')
wf_service.trg_validate(uid, 'sale.order', ids[0], 'order_confirm', cr)
# redisplay the record as a sales order
view_ref = self.pool.get('ir.model.data').get_object_reference(cr, uid, 'sale', 'view_order_form')
view_id = view_ref and view_ref[1] or False,
return {
'type': 'ir.actions.act_window',
'name': _('Sales Order'),
'res_model': 'sale.order',
'res_id': ids[0],
'view_type': 'form',
'view_mode': 'form',
'view_id': view_id,
'target': 'current',
'nodestroy': True,
}
It write "assert len(ids) == 1, 'This option should only be used for a single id at a time.'"
So how can I change it , then I can do it with many ids at a time. I try to delete this sentence, but it doesn't work. Should I change the "return" and "ids[0]"as well ?
if you change the return ids[0] to ids then it will give you trace-back, because it gives ids in list and in form view it will give you [oneid] thats y they pass ids[0]