diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2017-04-05 11:09:26 +0200 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2017-04-05 11:09:26 +0200 |
| commit | 8f39ad2be645dfbbc323ba8cc7feeb3fdcf58d32 (patch) | |
| tree | f4c7e860caed3bba06530e36a2a9830b10a8e45c | |
| parent | 0b2fd60041f746f083f44afe5b6ba2c0b95ba1ee (diff) | |
[FIX] point_of_sale: action_assign before force_assign
This allows the reservation in sub-locations before forcing the
availability.
opw-726060
| -rw-r--r-- | addons/point_of_sale/point_of_sale.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/addons/point_of_sale/point_of_sale.py b/addons/point_of_sale/point_of_sale.py index 879fc1b388d..af05f3e25b8 100644 --- a/addons/point_of_sale/point_of_sale.py +++ b/addons/point_of_sale/point_of_sale.py @@ -975,7 +975,7 @@ class pos_order(osv.osv): def _force_picking_done(self, cr, uid, picking_id, context=None): context = context or {} picking_obj = self.pool.get('stock.picking') - picking_obj.action_confirm(cr, uid, [picking_id], context=context) + picking_obj.action_assign(cr, uid, [picking_id], context=context) picking_obj.force_assign(cr, uid, [picking_id], context=context) # Mark pack operations as done pick = picking_obj.browse(cr, uid, picking_id, context=context) @@ -1062,7 +1062,9 @@ class pos_order(osv.osv): # when the pos.config has no picking_type_id set only the moves will be created if move_list and not return_picking_id and not order_picking_id: move_obj.action_confirm(cr, uid, move_list, context=context) - move_obj.force_assign(cr, uid, move_list, context=context) + move_obj.action_assign(cr, uid, move_list, context=context) + move_list_to_force = move_obj.browse(cr, uid, move_list, context=context).filtered(lambda m: m.state in ['confirmed', 'waiting']).ids + move_obj.force_assign(cr, uid, move_list_to_force, context=context) active_move_list = [x.id for x in move_obj.browse(cr, uid, move_list, context=context) if x.product_id.tracking == 'none'] if active_move_list: move_obj.action_done(cr, uid, active_move_list, context=context) |
