[IMP]purchase:
Improve code for validating the reception [RMV]stock: Remove the do_validate method bzr revid: dbr@tinyerp.com-20111025084530-8f8ejryly8a2jrvu
This commit is contained in:
@@ -73,13 +73,13 @@
|
||||
assert picking.move_lines[index].product_uos_qty == purchase_order.order_line[index].product_qty,"UOS Quantity is not correspond"
|
||||
assert picking.move_lines[index].product_uos == purchase_order.order_line[index].product_uom ,"UOS is not correspond"
|
||||
assert picking.move_lines[index].price_unit == purchase_order.order_line[index].price_unit ,"Price unit is not correspond"
|
||||
|
||||
-
|
||||
Reception is ready for process so now done the reception.
|
||||
-
|
||||
!python {model: stock.picking}: |
|
||||
pick_ids = self.search(cr, uid, [('purchase_id','=',ref('order_purchase1'))])
|
||||
self.do_validate(cr, uid, pick_ids)
|
||||
!python {model: stock.partial.picking}: |
|
||||
pick_ids = self.pool.get('purchase.order').browse(cr, uid, ref("order_purchase1")).picking_ids
|
||||
partial_id = self.create(cr, uid, {},context={'active_model': 'stock.picking','active_ids': [pick_ids[1].id]})
|
||||
self.do_partial(cr, uid, [partial_id])
|
||||
-
|
||||
I check that purchase order is shipped.
|
||||
-
|
||||
|
||||
+1
-19
@@ -1145,25 +1145,7 @@ class stock_picking(osv.osv):
|
||||
move_obj.unlink(cr, uid, ids2, ctx)
|
||||
|
||||
return super(stock_picking, self).unlink(cr, uid, ids, context=context)
|
||||
|
||||
def do_validate(self, cr, uid, ids, context=None):
|
||||
"""
|
||||
forcefully to validate picking with move lines
|
||||
"""
|
||||
for picking in self.browse(cr, uid, ids, context=context):
|
||||
partial_datas = {
|
||||
'partner_id': picking.address_id.partner_id.id,
|
||||
'address_id': picking.address_id.id,
|
||||
'delivery_date' : time.strftime('%Y-%m-%d')
|
||||
}
|
||||
for move in picking.move_lines:
|
||||
partial_datas['move%s'%(move.id)]= {
|
||||
'product_id': move.product_id,
|
||||
'product_qty': move.product_qty,
|
||||
'product_uom': move.product_uom.id,
|
||||
}
|
||||
val = self.do_partial(cr, uid, [picking.id], partial_datas, context=context)
|
||||
return val
|
||||
|
||||
# FIXME: needs refactoring, this code is partially duplicated in stock_move.do_partial()!
|
||||
def do_partial(self, cr, uid, ids, partial_datas, context=None):
|
||||
""" Makes partial picking and moves done.
|
||||
|
||||
Reference in New Issue
Block a user