[IMP]stock: Improve code for validation and assigning and cancelation process of picking.

bzr revid: dbr@tinyerp.com-20111216125933-dufhrv1x6u6tntf2
This commit is contained in:
DBR (OpenERP) 2011-12-16 18:29:33 +05:30
parent 0448127f9d
commit 35c5f3d165
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@
import netsvc
wf_service = netsvc.LocalService("workflow")
pick_id = context.get('id2')
self.cancel_assign(cr, uid, [pick_id])
picking = self.browse(cr, uid, pick_id, context=context)
wf_service.trg_validate(uid, 'stock.picking', pick_id, 'button_cancel', cr)
assert picking.state == 'cancel',"Delivery order should be cancelled."

View File

@ -5,6 +5,11 @@
-
!python {model: stock.picking}: |
self.draft_force_assign(cr, uid, [ref('stock.stock_picking_1')], {})
self.draft_validate(cr, uid, [ref('stock.stock_picking_1')], {})
try:
self.action_assign(cr, uid, [ref('stock.stock_picking_1')], {})
except:
pass
self.force_assign(cr, uid, [ref('stock.stock_picking_1')], {})
-
I add a new move line in the delivery order.
@ -66,3 +71,4 @@
assert move.state == 'done',"Stock move of %s picking should be in 'Done' state"%(move.picking_id.name)
for move in stock.browse(cr, uid, assign_move):
assert move.state == 'assigned' or 'draft',"Stock move of %s picking should be in 'Available' state"%(move.picking_id.name)