2013-04-01 06:43:59 +00:00
-
2013-11-12 16:58:09 +00:00
Stock manager can only test whole process related to Shipment, so we check data with stock manager.
2013-03-29 15:34:03 +00:00
-
!context
uid : 'res_users_stock_manager'
2011-12-21 11:38:22 +00:00
-
2014-11-25 16:37:12 +00:00
I confirm incoming move of 50 kgm Ice-cream
2011-12-21 11:38:22 +00:00
-
2013-11-12 16:58:09 +00:00
!python {model: stock.move}: |
2014-11-25 16:37:12 +00:00
incoming_move = self.browse(cr, uid, ref("incomming_shipment_icecream"))
self.action_confirm(cr, uid, [incoming_move.id])
2011-12-21 11:38:22 +00:00
-
2013-08-30 10:01:53 +00:00
I receive 40kgm Ice-cream so It will make backorder of incomming shipment for 10 kgm.
2011-12-21 11:38:22 +00:00
-
2013-08-29 09:58:33 +00:00
!python {model: stock.picking}: |
pick = self.browse(cr, uid, ref("incomming_shipment"), context=context)
self.pool.get('stock.pack.operation').create(cr, uid, {
'picking_id' : pick.id,
'product_id' : ref('product_icecream'),
'product_uom_id' : ref('product.product_uom_kgm'),
2014-03-12 08:10:10 +00:00
'product_qty' : 40 ,
2014-03-11 17:14:43 +00:00
'location_id' : ref('stock.stock_location_suppliers'),
'location_dest_id' : ref('stock.stock_location_14')
2013-08-29 09:58:33 +00:00
})
2011-12-22 06:06:59 +00:00
context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]})
2014-07-06 14:44:26 +00:00
pick = self.browse(cr, uid, pick.id, context=context)
pick.do_transfer()
2011-12-21 11:38:22 +00:00
-
2013-08-29 09:58:33 +00:00
I check backorder shipment after received partial shipment and check remaining shipment.
2011-12-21 11:38:22 +00:00
-
!python {model: stock.picking}: |
2011-12-22 06:06:59 +00:00
shipment = self.browse(cr, uid, ref("incomming_shipment"))
2013-08-29 09:58:33 +00:00
for move_line in shipment.move_lines :
assert move_line.product_qty == 40, "Qty in shipment does not correspond."
assert move_line.state == 'done', "Move line of shipment should be closed."
backorder_id = self.search(cr, uid, [('backorder_id', '=', ref("incomming_shipment"))],context=context)
backorder = self.browse(cr, uid, backorder_id)[0]
2011-12-22 10:06:58 +00:00
for move_line in backorder.move_lines :
2013-08-29 09:58:33 +00:00
assert move_line.product_qty == 10, "Qty in backorder does not correspond."
2013-09-11 10:10:44 +00:00
assert (move_line.state == 'assigned' or move_line.state == 'waiting' or move_line.state == 'confirmed'), "Move line of backorder should be assigned, confirmed or waiting."
2013-08-29 09:58:33 +00:00
context.update({'active_model': 'stock.picking', 'active_id': backorder_id[0], 'active_ids': backorder_id})
2011-12-21 11:38:22 +00:00
-
2013-09-03 10:43:20 +00:00
I receive the remaining 10kgm Ice-cream from the backorder.
2011-12-22 10:06:58 +00:00
-
2013-08-29 09:58:33 +00:00
!python {model: stock.picking}: |
2013-09-03 10:43:20 +00:00
backorder_id = self.search(cr, uid, [('backorder_id', '=', ref("incomming_shipment"))],context=context)
2014-07-06 14:44:26 +00:00
backorder = self.browse(cr, uid, backorder_id, context=context)[0]
2013-08-29 09:58:33 +00:00
self.pool.get('stock.pack.operation').create(cr, uid, {
2013-09-03 10:43:20 +00:00
'picking_id' : backorder.id,
2013-08-29 09:58:33 +00:00
'product_id' : ref('product_icecream'),
'product_uom_id' : ref('product.product_uom_kgm'),
2014-03-12 08:10:10 +00:00
'product_qty' : 10 ,
2014-03-11 17:14:43 +00:00
'location_id' : ref('stock.stock_location_suppliers'),
'location_dest_id' : ref('stock.stock_location_14')
2013-08-29 09:58:33 +00:00
})
2014-07-06 14:44:26 +00:00
backorder.do_transfer()
2011-12-22 10:06:58 +00:00
-
2014-07-16 09:58:22 +00:00
I check incomming shipment after receipt.
2011-12-21 11:38:22 +00:00
-
2011-12-22 06:06:59 +00:00
!python {model: stock.picking}: |
2013-08-29 09:58:33 +00:00
shipment = self.browse(cr, uid, self.search(cr, uid, [('backorder_id', '=', ref("incomming_shipment"))]))[0]
2011-12-22 10:06:58 +00:00
assert shipment.state == 'done', "shipment should be close after received."
for move_line in shipment.move_lines :
assert move_line.state == 'done', "Move line should be closed."