[MERGE] merged the branch with the refactoring of picking partial processing and action_assign. overall cleanup
bzr revid: qdp-launchpad@openerp.com-20131119161554-2yipe2b5gs4z3v1l
This commit is contained in:
commit
81971e9994
|
@ -125,7 +125,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_id = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001")).picking_ids[0]
|
||||
picking_id.do_partial(context=context)
|
||||
picking_id.do_transfer(context=context)
|
||||
-
|
||||
I check the Stock Interim account (Received) is credited successfully.
|
||||
-
|
||||
|
@ -218,7 +218,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking = self.pool.get('stock.picking').browse(cr, uid, ref("stock_picking_out001"))
|
||||
picking.do_partial(context=context)
|
||||
picking.do_transfer(context=context)
|
||||
-
|
||||
I check Stock Interim account (Delivery) is debited successfully.
|
||||
-
|
||||
|
|
|
@ -133,7 +133,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_id = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001_fifo")).picking_ids[0]
|
||||
picking_id.do_partial(context=context)
|
||||
picking_id.do_transfer(context=context)
|
||||
-
|
||||
I check the Stock Interim account (Received) is credit successfully.
|
||||
-
|
||||
|
@ -218,7 +218,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking = self.pool.get('stock.picking').browse(cr, uid, ref("stock_picking_out001_fifo"))
|
||||
picking.do_partial(context=context)
|
||||
picking.do_transfer(context=context)
|
||||
-
|
||||
I check Stock Interim account (Delivery) is debited successfully.
|
||||
-
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_average1")).picking_ids
|
||||
self.do_partial(cr, uid, [pick_ids[0].id])
|
||||
self.do_transfer(cr, uid, [pick_ids[0].id])
|
||||
-
|
||||
Check the standard price of the product (average icecream).
|
||||
-
|
||||
|
@ -70,7 +70,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_average2")).picking_ids
|
||||
self.do_partial(cr, uid, [pick_ids[0].id])
|
||||
self.do_transfer(cr, uid, [pick_ids[0].id])
|
||||
-
|
||||
Check the standard price
|
||||
-
|
||||
|
@ -96,7 +96,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.action_assign(cr, uid, [ref("outgoing_average_shipment")])
|
||||
self.do_partial(cr, uid, [ref("outgoing_average_shipment")])
|
||||
self.do_transfer(cr, uid, [ref("outgoing_average_shipment")])
|
||||
-
|
||||
Check the standard price (60 * 10 + 30 * 80) / 40 = 75.0 did not change
|
||||
-
|
||||
|
@ -125,7 +125,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_average3")).picking_ids
|
||||
self.do_partial(cr, uid, [pick_ids[0].id])
|
||||
self.do_transfer(cr, uid, [pick_ids[0].id])
|
||||
-
|
||||
Check price is (75.0*20 + 200*0.5) / 20.5 = 78.04878
|
||||
-
|
||||
|
|
|
@ -59,7 +59,7 @@
|
|||
!python {model: stock.partial.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_variable1")).picking_ids
|
||||
partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
self.do_transfer(cr, uid, [partial_id])
|
||||
-
|
||||
Check the standard price of the product (variable icecream).
|
||||
-
|
||||
|
@ -73,7 +73,7 @@
|
|||
!python {model: stock.partial.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_variable2")).picking_ids
|
||||
partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
self.do_transfer(cr, uid, [partial_id])
|
||||
-
|
||||
Check the standard price and change the product's cost method towards fifo
|
||||
-
|
||||
|
@ -103,7 +103,7 @@
|
|||
-
|
||||
!python {model: stock.partial.picking}: |
|
||||
partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [ref("outgoing_variable_shipment")], 'default_type':'out'})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
self.do_transfer(cr, uid, [partial_id])
|
||||
-
|
||||
Check the standard price (60 * 10 + 30 * 80) / 40 = 75.0 did not change
|
||||
-
|
||||
|
@ -133,10 +133,10 @@
|
|||
!python {model: stock.partial.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_variable3")).picking_ids
|
||||
partial_id = self.create(cr, uid, {}, context={'active_model': 'stock.picking','active_ids': [pick_ids[0].id]})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
self.do_transfer(cr, uid, [partial_id])
|
||||
-
|
||||
Change the cost method back to average and check price on product changed back to 70.0 = (20*60 + 10*60 + 30*80) / 60
|
||||
-
|
||||
!python {model: product.product}: |
|
||||
self.write(cr, uid, [ref("product_variable_icecream")], {'cost_method': 'average'}, context=context)
|
||||
assert self.browse(cr, uid, ref("product_variable_icecream")).standard_price == 70.0, 'After third reception and changing to average again, we should have an average price of 70.0 on the product'
|
||||
assert self.browse(cr, uid, ref("product_variable_icecream")).standard_price == 70.0, 'After third reception and changing to average again, we should have an average price of 70.0 on the product'
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo1")).picking_ids[0]
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
Check the standard price of the product (fifo icecream), that should have not changed because the standard price is supposed to be updated only when goods are going out of the stock
|
||||
-
|
||||
|
@ -70,7 +70,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo2")).picking_ids[0]
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
Check the standard price of the product, that should have not changed because the standard price is supposed to be updated only when goods are going out of the stock
|
||||
-
|
||||
|
@ -102,7 +102,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment"))
|
||||
pick_obj.do_partial(context=context)
|
||||
pick_obj.do_transfer(context=context)
|
||||
-
|
||||
Check product standard price changed to 65.0 (because last outgoing shipment was made of 10 kg at 50€ and 10 kg at 80€)
|
||||
-
|
||||
|
@ -134,7 +134,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_uom"))
|
||||
pick_obj.do_partial(context=context)
|
||||
pick_obj.do_transfer(context=context)
|
||||
-
|
||||
Check product price changed to 80.0 (because last outgoing shipment was made of 0.5 kg at 80€)
|
||||
-
|
||||
|
@ -191,7 +191,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo_usd")).picking_ids[0]
|
||||
pick_obj.do_partial(context=context)
|
||||
pick_obj.do_transfer(context=context)
|
||||
-
|
||||
We create delivery order of 49.5 kg
|
||||
-
|
||||
|
@ -218,7 +218,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_cur"))
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
Check rounded price is 102 euro (because last outgoing shipment was made of 19.5kg at 80€ and 30kg at $150 (rate=1.2834)
|
||||
-
|
||||
|
@ -250,7 +250,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_fifo_shipment_ret"))
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
Check rounded price is 150.0 / 1.2834
|
||||
-
|
||||
|
@ -296,7 +296,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.browse(cr, uid, ref("outgoing_fifo_shipment_neg"))
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
The behavior of fifo/lifo is not garantee if the quants are created at the same second, so i just wait one second
|
||||
-
|
||||
|
@ -324,7 +324,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj1 = self.browse(cr, uid, ref("outgoing_fifo_shipment_neg2"))
|
||||
picking_obj1.do_partial(context=context)
|
||||
picking_obj1.do_transfer(context=context)
|
||||
|
||||
-
|
||||
Receive purchase order with 50 kg FIFO Ice Cream at 50 euro/kg
|
||||
|
@ -348,7 +348,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo_neg")).picking_ids[0]
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
Assert price on product is still the old price as the out move has not been received fully yet
|
||||
-
|
||||
|
@ -377,7 +377,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fifo_neg2")).picking_ids[0]
|
||||
picking_obj.do_partial(context=context)
|
||||
picking_obj.do_transfer(context=context)
|
||||
-
|
||||
The price of the product should have changed back to 65.0
|
||||
-
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fiforet1")).picking_ids[0]
|
||||
self.do_partial(cr,uid,[picking_obj.id], context=context)
|
||||
self.do_transfer(cr,uid,[picking_obj.id], context=context)
|
||||
-
|
||||
Check the standard price of the product (fifo icecream)
|
||||
-
|
||||
|
@ -64,7 +64,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking_obj = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fiforet2")).picking_ids[0]
|
||||
self.do_partial(cr,uid,[picking_obj.id], context=context)
|
||||
self.do_transfer(cr,uid,[picking_obj.id], context=context)
|
||||
-
|
||||
Return the goods of purchase order 2
|
||||
-
|
||||
|
@ -72,7 +72,7 @@
|
|||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_fiforet2")).picking_ids
|
||||
return_id = self.create(cr, uid, {}, context={'active_model':'stock.picking', 'active_id': pick_ids[0].id})
|
||||
return_picking_id, dummy = self._create_returns(cr, uid, [return_id], context={'active_id': pick_ids[0].id})
|
||||
self.pool.get('stock.picking').do_partial(cr, uid, [return_picking_id])
|
||||
self.pool.get('stock.picking').do_transfer(cr, uid, [return_picking_id])
|
||||
-
|
||||
Check the standard price of the product changed to 70.0 (as returns to supplier are processed as normal outgoing shipment we have sent 10kg at 50€ and 20kg at 80€, because of FIFO, so the average to store on the product is 70€)
|
||||
-
|
||||
|
|
|
@ -47,7 +47,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_1")).picking_ids[0]
|
||||
pick_ids.do_partial(context=context)
|
||||
pick_ids.do_transfer(context=context)
|
||||
-
|
||||
I check that purchase order is shipped.
|
||||
-
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
'product_uom_id': ref('product.product_uom_unit'),
|
||||
'product_qty': 1
|
||||
})
|
||||
pick.do_partial(context=context)
|
||||
pick.do_transfer(context=context)
|
||||
-
|
||||
I test that I have two pickings, one done and one backorder to do
|
||||
-
|
||||
|
|
|
@ -96,7 +96,7 @@
|
|||
for pick in order.picking_ids:
|
||||
data = pick.force_assign()
|
||||
if data == True:
|
||||
pick.do_partial(context=context)
|
||||
pick.do_transfer(context=context)
|
||||
-
|
||||
I run the scheduler.
|
||||
-
|
||||
|
|
|
@ -66,3 +66,6 @@ access_stock_pack_operation_all,stock.pack.operation all users,model_stock_pack_
|
|||
access_stock_putaway_all,stock.putaway all users,model_stock_move_putaway,base.group_user,1,0,0,0
|
||||
access_product_putaway_all,product.putaway all users,model_product_putaway,base.group_user,1,0,0,0
|
||||
access_stock_removal_all,product.removal all users,model_product_removal,base.group_user,1,0,0,0
|
||||
access_stock_move_operation_link_manager,stock.move.operation.link manager,model_stock_move_operation_link,stock.group_stock_manager,1,1,1,1
|
||||
access_stock_move_operation_link_user,stock.move.operation.link user,model_stock_move_operation_link,stock.group_stock_user,1,1,1,1
|
||||
access_stock_move_operation_link_all,stock.move.operation.link all users,model_stock_move_operation_link,base.group_user,1,0,0,0
|
||||
|
|
|
File diff suppressed because it is too large
Load Diff
|
@ -749,7 +749,7 @@
|
|||
<button name="action_confirm" states="draft" string="Mark as Todo" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="action_assign" states="confirmed" string="Check Availability" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="force_assign" states="confirmed" string="Force Availability" type="object" class="oe_highlight" groups="base.group_user"/>
|
||||
<button name="do_partial" states="assigned" string="Transfer Done" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
|
||||
<button name="do_transfer" states="assigned" string="Transfer Done" groups="stock.group_stock_user" type="object" class="oe_highlight"/>
|
||||
<button name="do_prepare_partial" string="Partial Transfer" groups="stock.group_stock_user" type="object" class="oe_highlight" attrs="{'invisible': ['|',('pack_operation_exist', '=', True),('state','!=','assigned')]}"/>
|
||||
<button name="%(act_stock_return_picking)d" string="Reverse Transfer" states="done" type="action" groups="base.group_user"/>
|
||||
<button name="action_cancel" states="assigned,confirmed,draft" string="Cancel Transfer" groups="base.group_user" type="object"/>
|
||||
|
@ -1039,6 +1039,7 @@
|
|||
groups="base.group_user"/>
|
||||
<field name="scrapped" invisible="1"/>
|
||||
<field name="location_dest_id" groups="stock.group_locations"/>
|
||||
<field name="remaining_qty"/>
|
||||
<field name="state"/>
|
||||
</tree>
|
||||
</field>
|
||||
|
|
|
@ -51,19 +51,11 @@
|
|||
stock_pack.write(cr, uid, record.pack_operation_ids[0].id, {'result_package_id': package1, 'product_qty': 120})
|
||||
new_pack1 = stock_pack.create(cr, uid, {'product_id': ref('product1'), 'product_uom_id': ref('product.product_uom_unit'), 'picking_id': ref('pick1'), 'lot_id': lot_a, 'result_package_id': package2, 'product_qty': 120}, context=context)
|
||||
new_pack2 = stock_pack.create(cr, uid, {'product_id': ref('product1'), 'product_uom_id': ref('product.product_uom_unit'), 'picking_id': ref('pick1'), 'result_package_id': package3, 'product_qty': 60}, context=context)
|
||||
-
|
||||
Use button rereserve and check the qtyremaining on the moves are correct (=original quantities)
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.rereserve(cr, uid, [ref('pick1')], context=context)
|
||||
picking = self.browse(cr, uid, ref('pick1'), context=context)
|
||||
move_reco = picking.move_lines[0]
|
||||
assert move_reco.remaining_qty == 300.0, "Remaining quantities should not change upon receiving"
|
||||
-
|
||||
Transfer the reception
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.do_partial(cr, uid, [ref('pick1')], context=context)
|
||||
self.do_transfer(cr, uid, [ref('pick1')], context=context)
|
||||
-
|
||||
Check the system created 3 quants one with 120 pieces on pallet 1, one with 120 pieces on pallet 2 with lot A and 60 pieces on pallet 3
|
||||
-
|
||||
|
@ -114,14 +106,14 @@
|
|||
for rec in delivery_id.pack_operation_ids:
|
||||
if rec.package_id.name == 'Pallet 2':
|
||||
lot_ids = self.pool.get("stock.production.lot").search(cr, uid, [('product_id', '=', ref('product1')), ('name','=','Lot A')])
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product1'), 'product_qty': 20, 'lot_id': lot_ids[0]}, context=context)
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product1'), 'product_qty': 20, 'lot_id': lot_ids[0], 'package_id': False, 'product_uom_id': ref('product.product_uom_unit')}, context=context)
|
||||
if rec.package_id.name == 'Pallet 3':
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product1'),'product_qty': 10}, context=context)
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product1'),'product_qty': 10, 'product_uom_id': ref('product.product_uom_unit')}, context=context)
|
||||
-
|
||||
Process this picking
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.do_partial(cr, uid, [ref('delivery_order1')], context=context)
|
||||
self.do_transfer(cr, uid, [ref('delivery_order1')], context=context)
|
||||
-
|
||||
Check the quants that you have 120 pieces pallet 1 in customers, 100 pieces pallet 2 in stock and 20 with customers and 50 in stock, 10 in customers from pallet 3
|
||||
-
|
||||
|
@ -141,24 +133,15 @@
|
|||
else:
|
||||
assert False, "Unrecognized quant"
|
||||
-
|
||||
Check a backorder was created and on that backorder, prepare partial
|
||||
Check a backorder was created and on that backorder, prepare partial and process backorder
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking = self.browse(cr, uid, ref('delivery_order1'), context=context)
|
||||
backorder = self.search(cr, uid, [('backorder_id.id', '=', picking.id)], context=context)
|
||||
assert backorder, "Backorder should have been created"
|
||||
backorder_id = self.browse(cr, uid, backorder, context=context)
|
||||
self.do_prepare_partial(cr, uid, backorder, context=context)
|
||||
stock_pack = self.pool.get('stock.pack.operation').create(cr, uid, {'picking_id': backorder_id[0].id, 'product_qty': 20})
|
||||
-
|
||||
Process this backorder
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
picking = self.browse(cr, uid, ref('delivery_order1'), context=context)
|
||||
backorder = self.search(cr, uid, [('backorder_id.id', '=', picking.id)], context=context)
|
||||
backorder_id = self.browse(cr, uid, backorder, context=context)
|
||||
self.rereserve(cr, uid, [backorder_id[0].id], context=context)
|
||||
self.do_partial(cr, uid, [backorder_id[0].id], context=context)
|
||||
backorder_ids = self.search(cr, uid, [('backorder_id', '=', ref('delivery_order1'))], context=context)
|
||||
assert backorder_ids, "Backorder should have been created"
|
||||
self.do_prepare_partial(cr, uid, backorder_ids, context=context)
|
||||
stock_pack = self.pool.get('stock.pack.operation').create(cr, uid, {'picking_id': backorder_ids[0], 'product_qty': 20})
|
||||
self.action_assign(cr, uid, backorder_ids, context=context)
|
||||
self.do_transfer(cr, uid, backorder_ids, context=context)
|
||||
-
|
||||
Check there are still 0 pieces in stock
|
||||
-
|
||||
|
@ -169,4 +152,4 @@
|
|||
total_qty += rec.qty
|
||||
product = self.pool.get("product.product").browse(cr, uid, ref('product1'))
|
||||
assert total_qty == 0, "Total quantity in stock should be 0 as the backorder took everything out of stock"
|
||||
assert product.qty_available == 0, "Quantity available should be 0 too"
|
||||
assert product.qty_available == 0, "Quantity available should be 0 too"
|
||||
|
|
|
@ -55,7 +55,7 @@
|
|||
Transfer the reception
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.do_partial(cr, uid, [ref('pick_neg')], context=context)
|
||||
self.do_transfer(cr, uid, [ref('pick_neg')], context=context)
|
||||
-
|
||||
Make a delivery order of 300 pieces to the customer
|
||||
-
|
||||
|
@ -84,14 +84,14 @@
|
|||
for rec in delivery_id.pack_operation_ids:
|
||||
if rec.package_id.name == 'Palneg 2':
|
||||
lot_ids = self.pool.get("stock.production.lot").search(cr, uid, [('product_id', '=', ref('product_neg')), ('name','=','Lot neg')])
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product_neg'), 'product_qty': 140, 'lot_id': lot_ids[0]}, context=context)
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product_neg'), 'product_qty': 140, 'lot_id': lot_ids[0], 'product_uom_id': ref('product.product_uom_unit')}, context=context)
|
||||
if rec.package_id.name == 'Palneg 3':
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product_neg'),'product_qty': 10}, context=context)
|
||||
stock_pack.write(cr, uid, [rec.id], {'product_id': ref('product_neg'),'product_qty': 10, 'product_uom_id': ref('product.product_uom_unit')}, context=context)
|
||||
-
|
||||
Process this picking
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
self.do_partial(cr, uid, [ref('delivery_order_neg')], context=context)
|
||||
self.do_transfer(cr, uid, [ref('delivery_order_neg')], context=context)
|
||||
-
|
||||
Check the quants that you have 120 pieces pallet 1 in customers, -20 pieces pallet 2 in stock and 120 and 20 with customers and 20/30 in stock, 10 in customers from pallet 3
|
||||
-
|
||||
|
@ -136,7 +136,7 @@
|
|||
lot_ids = self.pool.get("stock.production.lot").search(cr, uid, [('product_id', '=', ref('product_neg')), ('name','=','Lot neg')])
|
||||
pack_ids = pack_obj.search(cr, uid, [('name', '=', 'Palneg 2')])
|
||||
ops_obj.write(cr, uid, [pick.pack_operation_ids[0].id], {'lot_id': lot_ids[0], 'result_package_id': pack_ids[0]})
|
||||
self.do_partial(cr, uid, [ref("delivery_reconcile")])
|
||||
self.do_transfer(cr, uid, [ref("delivery_reconcile")])
|
||||
-
|
||||
Check the negative quant was reconciled and the 20 pieces of lot neg at customers have the incoming shipments in the history_ids
|
||||
-
|
||||
|
@ -146,4 +146,4 @@
|
|||
pick = self.pool.get('stock.picking').browse(cr, uid, ref('delivery_reconcile'))
|
||||
customer_quant = self.search(cr, uid, [('product_id', '=', ref('product_neg')), ('location_id', '=', ref('stock_location_customers')), ('lot_id.name','=', 'Lot neg'), ('qty','=', 20)])
|
||||
assert pick.move_lines[0].id in [x.id for x in self.browse(cr, uid, customer_quant[0]).history_ids]
|
||||
|
||||
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
'product_qty': 40
|
||||
})
|
||||
context.update({'active_model': 'stock.picking', 'active_id': ref('incomming_shipment'), 'active_ids': [ref('incomming_shipment')]})
|
||||
pick.do_partial(context=context)
|
||||
pick.do_transfer(context=context)
|
||||
-
|
||||
I check backorder shipment after received partial shipment and check remaining shipment.
|
||||
-
|
||||
|
@ -48,7 +48,7 @@
|
|||
'product_uom_id': ref('product.product_uom_kgm'),
|
||||
'product_qty': 10
|
||||
})
|
||||
backorder.do_partial(context=context)
|
||||
backorder.do_transfer(context=context)
|
||||
-
|
||||
I check incomming shipment after reception.
|
||||
-
|
||||
|
|
|
@ -85,7 +85,7 @@ class stock_quant(osv.osv):
|
|||
"""
|
||||
def _account_entry_move(self, cr, uid, quant, move, context=None):
|
||||
location_from = move.location_id
|
||||
location_to = move.location_dest_id
|
||||
location_to = quant.location_id
|
||||
if context is None:
|
||||
context = {}
|
||||
if quant.product_id.valuation != 'real_time':
|
||||
|
@ -126,9 +126,9 @@ class stock_quant(osv.osv):
|
|||
self._create_account_move_line(cr, uid, quant, move, acc_valuation, acc_dest, journal_id, context=ctx)
|
||||
|
||||
|
||||
def move_single_quant(self, cr, uid, quant, qty, move, lot_id=False, owner_id=False, package_id= False, context=None):
|
||||
quant_record = super(stock_quant, self).move_single_quant(cr, uid, quant, qty, move, lot_id = lot_id, owner_id = owner_id, package_id = package_id, context=context)
|
||||
self._account_entry_move(cr, uid, quant_record, move, context=context)
|
||||
def move_single_quant(self, cr, uid, quant, location_to, qty, move, context=None):
|
||||
quant_record = super(stock_quant, self).move_single_quant(cr, uid, quant, location_to, qty, move, context=context)
|
||||
self._account_entry_move(cr, uid, quant, move, context=context)
|
||||
return quant_record
|
||||
|
||||
|
||||
|
@ -229,9 +229,9 @@ class stock_quant(osv.osv):
|
|||
class stock_move(osv.osv):
|
||||
_inherit = "stock.move"
|
||||
|
||||
def action_done(self, cr, uid, ids, negatives = False, context=None):
|
||||
def action_done(self, cr, uid, ids, context=None):
|
||||
self.product_price_update_before_done(cr, uid, ids, context=context)
|
||||
super(stock_move, self).action_done(cr, uid, ids, negatives=negatives, context=context)
|
||||
super(stock_move, self).action_done(cr, uid, ids, context=context)
|
||||
self.product_price_update_after_done(cr, uid, ids, context=context)
|
||||
|
||||
def _store_average_cost_price(self, cr, uid, move, context=None):
|
||||
|
|
|
@ -73,7 +73,7 @@
|
|||
po_id = self.pool.get('purchase.order').search(cr, uid, [('partner_id', '=', ref('supplier_dropship'))])
|
||||
assert po_id and len(po_id) == 1, 'Problem with the Purchase Order detected'
|
||||
picking_ids = [pick.id for pick in self.pool.get('purchase.order').browse(cr, uid, po_id[0]).picking_ids]
|
||||
self.do_partial(cr, uid, picking_ids)
|
||||
self.do_transfer(cr, uid, picking_ids)
|
||||
-
|
||||
Check one quant was created in Customers location with 200 pieces and one move in the history_ids
|
||||
-
|
||||
|
|
|
@ -63,7 +63,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
order = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo1")).picking_ids[0]
|
||||
order.do_partial(context=context)
|
||||
order.do_transfer(context=context)
|
||||
-
|
||||
Check the standard price of the product (lifo icecream)
|
||||
-
|
||||
|
@ -78,7 +78,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
order = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_lifo2")).picking_ids[0]
|
||||
order.do_partial(context=context)
|
||||
order.do_transfer(context=context)
|
||||
-
|
||||
Check the standard price should not have changed
|
||||
-
|
||||
|
@ -110,7 +110,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_order = self.pool.get('stock.picking').browse(cr, uid, ref("outgoing_lifo_shipment"))
|
||||
pick_order.do_partial(context=context)
|
||||
pick_order.do_transfer(context=context)
|
||||
-
|
||||
Check standard price became 80 euro
|
||||
-
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
-
|
||||
!python {model: stock.picking}: |
|
||||
partial_id = ref("stock_picking_out0")
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
self.do_transfer(cr, uid, [partial_id])
|
||||
|
||||
-
|
||||
As the Invoice state of the picking order is To be invoiced. I create invoice for my outgoing picking order.
|
||||
|
@ -54,4 +54,4 @@
|
|||
picking = picking_obj.browse(cr, uid, [ref('stock_picking_out0')])
|
||||
partner = picking[0].partner_id.id
|
||||
inv_ids = self.search(cr, uid, [('type','=','out_invoice'),('partner_id','=',partner)])
|
||||
assert inv_ids, 'No Invoice is generated!'
|
||||
assert inv_ids, 'No Invoice is generated!'
|
||||
|
|
|
@ -24,12 +24,12 @@ from openerp.osv import fields, osv
|
|||
# class invoice_directly(osv.osv_memory):
|
||||
# _inherit = 'stock.partial.picking'
|
||||
#
|
||||
# def do_partial(self, cr, uid, ids, context=None):
|
||||
# def do_transfer(self, cr, uid, ids, context=None):
|
||||
# """Launch Create invoice wizard if invoice state is To be Invoiced,
|
||||
# after processing the partial picking.
|
||||
# """
|
||||
# if context is None: context = {}
|
||||
# result = super(invoice_directly, self).do_partial(cr, uid, ids, context)
|
||||
# result = super(invoice_directly, self).do_transfer(cr, uid, ids, context)
|
||||
# partial = self.browse(cr, uid, ids[0], context)
|
||||
# context.update(active_model='stock.picking',
|
||||
# active_ids=[partial.picking_id.id])
|
||||
|
|
Loading…
Reference in New Issue