Comment 0 for bug 1222867

Revision history for this message
Brendan Clune (Logic Supply) (brendan-clune) wrote :

When attempting to confirm a draft sales order that raises connector exceptions, the user must first ignore the exceptions, then attempt to confirm the sales order again. This seems unnecessary to me, because the exceptions are only visible when attempting to confirm the order in the first place. That is, if a user chooses to ignore exceptions, he or she has already expressed intent to confirm the order.

Firing the workflow in the sale exception wizard eliminates the need for extra button presses and streamlines the sale confirmation dialog:

         if form.ignore:
             self.pool.get('sale.order').write(cr, uid, form.sale_id.id,
                     {'ignore_exceptions': True}, context=context)
+ wf_service = netsvc.LocalService('workflow')
+ wf_service.trg_validate(uid, 'sale.order', form.sale_id.id, 'order_confirm', cr)
         return {'type': 'ir.actions.act_window_close'}

A patch is attached.