[FIX] point_of_sale: opw-607551, mark the pos order as paid before trying to create the picking, so in case the picking could not be created for one reason or another, the pos order workflow process continue.

This commit partially reverts rev. 6036 revid:fp@tinyerp.com-20111219220053-tn5gc1lmc13fjpyf, the second part of this commit already has been revert in a previous revision.
This commit is contained in:
Denis Ledoux 2014-05-19 15:33:39 +02:00
parent de802a9c1a
commit a8a085eabb
1 changed files with 2 additions and 4 deletions

View File

@ -537,7 +537,7 @@ class pos_order(osv.osv):
try: try:
wf_service.trg_validate(uid, 'pos.order', order_id, 'paid', cr) wf_service.trg_validate(uid, 'pos.order', order_id, 'paid', cr)
except Exception: except Exception:
_logger.error('ERROR: Could not mark POS Order as Paid.', exc_info=True) _logger.error('ERROR: Could not fully process the POS Order', exc_info=True)
return order_ids return order_ids
def write(self, cr, uid, ids, vals, context=None): def write(self, cr, uid, ids, vals, context=None):
@ -692,8 +692,6 @@ class pos_order(osv.osv):
move_obj = self.pool.get('stock.move') move_obj = self.pool.get('stock.move')
for order in self.browse(cr, uid, ids, context=context): for order in self.browse(cr, uid, ids, context=context):
if not order.state=='draft':
continue
addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {} addr = order.partner_id and partner_obj.address_get(cr, uid, [order.partner_id.id], ['delivery']) or {}
picking_id = picking_obj.create(cr, uid, { picking_id = picking_obj.create(cr, uid, {
'origin': order.name, 'origin': order.name,
@ -1136,8 +1134,8 @@ class pos_order(osv.osv):
return self.write(cr, uid, ids, {'state': 'payment'}, context=context) return self.write(cr, uid, ids, {'state': 'payment'}, context=context)
def action_paid(self, cr, uid, ids, context=None): def action_paid(self, cr, uid, ids, context=None):
self.create_picking(cr, uid, ids, context=context)
self.write(cr, uid, ids, {'state': 'paid'}, context=context) self.write(cr, uid, ids, {'state': 'paid'}, context=context)
self.create_picking(cr, uid, ids, context=context)
return True return True
def action_cancel(self, cr, uid, ids, context=None): def action_cancel(self, cr, uid, ids, context=None):