diff --git a/addons/account_anglo_saxon/test/anglo_saxon.yml b/addons/account_anglo_saxon/test/anglo_saxon.yml index ecb5d291535..73034497d14 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon.yml @@ -202,7 +202,7 @@ product_uom: product.product_uom_unit location_dest_id: stock.stock_location_customers move_type: direct - picking_type_id: self.pool.get('ir.model.data').get_object(cr, uid, 'stock', 'picking_type_out', context=context).id + picking_type_id: 1 - I need to check the availability of the product, So I make my picking order for processing later. - 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 f7d52f4f5a8..387f9bce715 100644 --- a/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml +++ b/addons/account_anglo_saxon/test/anglo_saxon_avg_fifo.yml @@ -131,10 +131,14 @@ - Reception is ready for process so now done the reception. - - !python {model: stock.partial.picking}: | - pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001_fifo")).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]) + !python {model: stock.picking}: | + order = self.pool.get('purchase.order').browse(cr, uid, ref("purchase_order_001_fifo")) + for pick in order.picking_ids: + self.pool.get('stock.pack.operation').create(cr, uid, { + 'picking_id': pick.id, + 'product_qty': 1 + }) + pick.do_partial(context=context) - I check the Stock Interim account (Received) is credit successfully. - @@ -192,7 +196,6 @@ - !record {model: stock.picking, id: stock_picking_out001_fifo}: partner_id: base.res_partner_13 - invoice_state: 2binvoiced move_lines: - company_id: base.main_company location_id: stock.stock_location_stock @@ -200,29 +203,30 @@ product_qty: 1.0 location_dest_id: stock.stock_location_customers move_type: direct - type: out + picking_type_id: 1 - I need to check the availability of the product, So I make my picking order for processing later. - !python {model: stock.picking}: | - self.draft_force_assign(cr, uid, [ref("stock_picking_out001_fifo")], {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", - "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"), - }) + self.action_confirm(cr, uid, [ref('stock_picking_out001')], context=context) - I check the product availability, Product is available in the stock and ready to be sent. - !python {model: stock.picking}: | - self.action_assign(cr, uid, [ref("stock_picking_out001_fifo")], {"lang": "en_US", "search_default_available": - 1, "tz": False, "active_model": "ir.ui.menu", "contact_display": "partner", - "active_ids": [ref("stock.menu_action_picking_tree")], "active_id": ref("stock.menu_action_picking_tree"), - }) + picking = self.browse(cr, uid, ref("stock_picking_out001")) + assert picking.state == "confirmed", "Picking should be confirmed." + for move_line in picking.move_lines: + assert move_line.state == "confirmed", "Move should be confirmed." - I process the delivery. - - !python {model: stock.partial.picking}: | - partial_id = self.create(cr, uid, {}, context={'active_model':'stock.picking','active_ids':[ref('stock_picking_out001_fifo')]}) - self.do_partial(cr, uid, [partial_id]) + !python {model: stock.picking}: | + pick_order = self.pool.get('stock.picking').browse(cr, uid, ref("stock_picking_out001_fifo")) + self.pool.get('stock.pack.operation').create(cr, uid, { + 'picking_id': pick_order.id, + 'product_qty': 1 + }) + pick_order.do_partial(context=context) - I check Stock Interim account (Delivery) is debited successfully. - diff --git a/addons/stock_invoice_directly/wizard/stock_invoice.py b/addons/stock_invoice_directly/wizard/stock_invoice.py index ba41de626da..171eda3d5ab 100644 --- a/addons/stock_invoice_directly/wizard/stock_invoice.py +++ b/addons/stock_invoice_directly/wizard/stock_invoice.py @@ -22,7 +22,7 @@ from openerp.osv import fields, osv class invoice_directly(osv.osv_memory): - _inherit = 'stock.partial.picking' + _inherit = 'stock.picking' def do_partial(self, cr, uid, ids, context=None): """Launch Create invoice wizard if invoice state is To be Invoiced,