[FIX] stock: picking: immediate and state
Issue: create an immediate transfer, add a move and a done quantity, the
picking is in waiting state instead of ready.
Due to rev[0], the moves added in an immediate transfer have an initial
demand. After auto-confirming them, their state were 'confirmed' and not
'assigned'.
Solution: we force the state to assigned
[0] 8303b1a69e
closes odoo/odoo#39492
Signed-off-by: Simon Lejeune (sle) <sle@openerp.com>
This commit is contained in:
@@ -907,6 +907,9 @@ class Picking(models.Model):
|
||||
continue
|
||||
if picking.immediate_transfer or any(move.additional for move in picking.move_lines):
|
||||
picking.action_confirm()
|
||||
# Make sure the reservation is bypassed in immediate transfer mode.
|
||||
if picking.immediate_transfer:
|
||||
picking.move_lines.write({'state': 'assigned'})
|
||||
|
||||
def _create_backorder(self):
|
||||
""" This method is called when the user chose to create a backorder. It will create a new
|
||||
|
||||
@@ -1880,6 +1880,7 @@ class TestSinglePicking(TestStockCommon):
|
||||
'product_uom': self.productA.uom_id.id,
|
||||
'location_id': self.stock_location,
|
||||
'location_dest_id': self.customer_location,
|
||||
'quantity_done': 5,
|
||||
})],
|
||||
})
|
||||
self.assertEqual(delivery_order.state, 'assigned')
|
||||
|
||||
Reference in New Issue
Block a user