diff --git a/addons/account_anglo_saxon/test/anglo_saxon.yml b/addons/account_anglo_saxon/test/anglo_saxon.yml index ca7195cb754..bb82803ee25 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon.yml @@ -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. - diff --git a/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml b/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml index d4a2fbaaab1..a30f947bfd8 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml @@ -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. - diff --git a/addons/purchase/test/average_price.yml b/addons/purchase/test/average_price.yml index f39a23076f0..0e2f0ff1240 100644 --- a/addons/purchase/test/average_price.yml +++ b/addons/purchase/test/average_price.yml @@ -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 - diff --git a/addons/purchase/test/costmethodchange.yml b/addons/purchase/test/costmethodchange.yml index 64af80763e6..f6b79587985 100644 --- a/addons/purchase/test/costmethodchange.yml +++ b/addons/purchase/test/costmethodchange.yml @@ -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' \ No newline at end of file + 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' diff --git a/addons/purchase/test/fifo_price.yml b/addons/purchase/test/fifo_price.yml index 50704435fd6..3ed82a74995 100644 --- a/addons/purchase/test/fifo_price.yml +++ b/addons/purchase/test/fifo_price.yml @@ -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 - diff --git a/addons/purchase/test/fifo_returns.yml b/addons/purchase/test/fifo_returns.yml index b6dad6d0fc9..44fad2f2047 100644 --- a/addons/purchase/test/fifo_returns.yml +++ b/addons/purchase/test/fifo_returns.yml @@ -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€) - diff --git a/addons/purchase/test/process/rfq2order2done.yml b/addons/purchase/test/process/rfq2order2done.yml index a6999686026..54de507286c 100644 --- a/addons/purchase/test/process/rfq2order2done.yml +++ b/addons/purchase/test/process/rfq2order2done.yml @@ -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. - diff --git a/addons/sale_stock/test/cancel_order_sale_stock.yml b/addons/sale_stock/test/cancel_order_sale_stock.yml index 9ea0ce3505c..d9116d843f5 100644 --- a/addons/sale_stock/test/cancel_order_sale_stock.yml +++ b/addons/sale_stock/test/cancel_order_sale_stock.yml @@ -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 - diff --git a/addons/sale_stock/test/picking_order_policy.yml b/addons/sale_stock/test/picking_order_policy.yml index a5143d6ca7d..bf7d24ec258 100644 --- a/addons/sale_stock/test/picking_order_policy.yml +++ b/addons/sale_stock/test/picking_order_policy.yml @@ -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. - diff --git a/addons/stock/security/ir.model.access.csv b/addons/stock/security/ir.model.access.csv index e30e3c96672..a4f4e249638 100644 --- a/addons/stock/security/ir.model.access.csv +++ b/addons/stock/security/ir.model.access.csv @@ -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 diff --git a/addons/stock/test/packing.yml b/addons/stock/test/packing.yml index d0edef15f7a..fc2015a8739 100644 --- a/addons/stock/test/packing.yml +++ b/addons/stock/test/packing.yml @@ -63,7 +63,7 @@ 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 - @@ -121,7 +121,7 @@ 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 - @@ -158,7 +158,7 @@ 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) + self.do_transfer(cr, uid, [backorder_id[0].id], context=context) - Check there are still 0 pieces in stock - @@ -169,4 +169,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" \ No newline at end of file + assert product.qty_available == 0, "Quantity available should be 0 too" diff --git a/addons/stock/test/packingneg.yml b/addons/stock/test/packingneg.yml index f0948557949..77080fdec9c 100644 --- a/addons/stock/test/packingneg.yml +++ b/addons/stock/test/packingneg.yml @@ -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 - @@ -91,7 +91,7 @@ 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] - \ No newline at end of file + diff --git a/addons/stock/test/shipment.yml b/addons/stock/test/shipment.yml index 66c76019044..5379cd8d4e0 100644 --- a/addons/stock/test/shipment.yml +++ b/addons/stock/test/shipment.yml @@ -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. - diff --git a/addons/stock_complex_routes/test/dropship.yml b/addons/stock_complex_routes/test/dropship.yml index 502231df81a..8ecda629037 100644 --- a/addons/stock_complex_routes/test/dropship.yml +++ b/addons/stock_complex_routes/test/dropship.yml @@ -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 - diff --git a/addons/stock_complex_routes/test/lifo_price.yml b/addons/stock_complex_routes/test/lifo_price.yml index a129cc3bf6d..a9a290761b4 100644 --- a/addons/stock_complex_routes/test/lifo_price.yml +++ b/addons/stock_complex_routes/test/lifo_price.yml @@ -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 - diff --git a/addons/stock_invoice_directly/test/stock_invoice_directly.yml b/addons/stock_invoice_directly/test/stock_invoice_directly.yml index c2687b2ef21..68cf8588bd2 100644 --- a/addons/stock_invoice_directly/test/stock_invoice_directly.yml +++ b/addons/stock_invoice_directly/test/stock_invoice_directly.yml @@ -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!' \ No newline at end of file + assert inv_ids, 'No Invoice is generated!' diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py index 5c126f33374..45f9f3bf9de 100644 --- a/addons/stock_invoice_directly/wizard/stock_invoice.py +++ b/addons/stock_invoice_directly/wizard/stock_invoice.py @@ -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])