From 735692618065cba85e7453350d36c794402acf85 Mon Sep 17 00:00:00 2001 From: "Bharat R. Devnani (OpenERP)" Date: Mon, 19 Aug 2013 11:56:08 +0530 Subject: [PATCH] [ADD] added parameters in various methods in order to get proper output for picking-order-policy-yml test cases of sale_stock module bzr revid: bde@tinyerp.com-20130819062608-o51cjq7s4ayhsttx --- addons/sale/sale.py | 2 +- addons/stock/procurement.py | 2 ++ addons/stock/stock.py | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/sale/sale.py b/addons/sale/sale.py index b55fccc8984..f733cfd9ff1 100644 --- a/addons/sale/sale.py +++ b/addons/sale/sale.py @@ -658,7 +658,7 @@ class sale_order(osv.osv): for order in self.browse(cr, uid, ids, context=context): proc_ids = [] group_id = self.pool.get("procurement.group").create(cr, uid, { - 'name': order.name, 'partner_id': order.partner_shipping_id.id + 'name': order.name, 'partner_id': order.partner_shipping_id.id, 'move_type': order.picking_policy }, context=context) order.write({'procurement_group_id': group_id}, context=context) for line in order.order_line: diff --git a/addons/stock/procurement.py b/addons/stock/procurement.py index 7f36871b9d1..4eeca78e0a1 100644 --- a/addons/stock/procurement.py +++ b/addons/stock/procurement.py @@ -86,6 +86,7 @@ class procurement_order(osv.osv): 'rule_id': procurement.rule_id.id, 'origin': procurement.origin, 'picking_type_id': procurement.rule_id.picking_type_id.id, + 'price_unit': procurement.sale_line_id.product_id.standard_price } def _run(self, cr, uid, procurement, context=None): @@ -96,6 +97,7 @@ class procurement_order(osv.osv): move_obj = self.pool.get('stock.move') move_dict = self._run_move_create(cr, uid, procurement, context=context) move_id = move_obj.create(cr, uid, move_dict, context=context) + self.write(cr, uid, procurement.id, {'move_dest_id': move_id}, context=context) move_obj.action_confirm(cr, uid, [move_id], context=context) return move_id return super(procurement_order, self)._run(cr, uid, procurement, context) diff --git a/addons/stock/stock.py b/addons/stock/stock.py index 2dff89acfa2..af8e418002c 100644 --- a/addons/stock/stock.py +++ b/addons/stock/stock.py @@ -1212,6 +1212,7 @@ class stock_move(osv.osv): 'state': 'confirmed', 'group_id': move.group_id and move.group_id.id or False, 'picking_type_id': move.picking_type_id and move.picking_type_id.id or False, + 'move_lines': [(6, 0, [move.id])] } pick = pick_obj.create(cr, uid, values, context=context) move.write({'picking_id': pick})