[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:
parent
de802a9c1a
commit
a8a085eabb
|
@ -537,7 +537,7 @@ class pos_order(osv.osv):
|
|||
try:
|
||||
wf_service.trg_validate(uid, 'pos.order', order_id, 'paid', cr)
|
||||
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
|
||||
|
||||
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')
|
||||
|
||||
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 {}
|
||||
picking_id = picking_obj.create(cr, uid, {
|
||||
'origin': order.name,
|
||||
|
@ -1136,8 +1134,8 @@ class pos_order(osv.osv):
|
|||
return self.write(cr, uid, ids, {'state': 'payment'}, context=context)
|
||||
|
||||
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.create_picking(cr, uid, ids, context=context)
|
||||
return True
|
||||
|
||||
def action_cancel(self, cr, uid, ids, context=None):
|
||||
|
|
Loading…
Reference in New Issue