[IMP] improve code in for mrp stock.py
bzr revid: jap@tinyerp.com-20130503105029-d9eqs4curvxwuvra
This commit is contained in:
parent
8e8d370ba9
commit
555636280e
|
@ -840,9 +840,6 @@ class mrp_production(osv.osv):
|
|||
if not production.product_lines:
|
||||
if not self.action_compute(cr, uid, [production.id]):
|
||||
res = False
|
||||
for componant in production.bom_id.bom_lines:
|
||||
if componant.product_id.type == 'service' and not production.move_lines:
|
||||
res=True
|
||||
return res
|
||||
|
||||
def _get_auto_picking(self, cr, uid, production):
|
||||
|
@ -985,7 +982,6 @@ class mrp_production(osv.osv):
|
|||
wf_service = netsvc.LocalService("workflow")
|
||||
uncompute_ids = filter(lambda x:x, [not x.product_lines and x.id or False for x in self.browse(cr, uid, ids, context=context)])
|
||||
self.action_compute(cr, uid, uncompute_ids, context=context)
|
||||
|
||||
for production in self.browse(cr, uid, ids, context=context):
|
||||
shipment_id = self._make_production_internal_shipment(cr, uid, production, context=context)
|
||||
produce_move_id = self._make_production_produce_line(cr, uid, production, context=context)
|
||||
|
|
|
@ -164,6 +164,13 @@ class StockPicking(osv.osv):
|
|||
for move in move_obj.browse(cr, uid, move_ids):
|
||||
todo.extend(move_obj._action_explode(cr, uid, move))
|
||||
return list(set(todo))
|
||||
|
||||
def test_cancel(self, cr, uid, ids, context=None):
|
||||
res = super(StockPicking, self).test_cancel(cr, uid, ids, context=context)
|
||||
for pick in self.browse(cr, uid, ids, context=context):
|
||||
if not pick.move_lines:
|
||||
return False
|
||||
return res
|
||||
|
||||
StockPicking()
|
||||
|
||||
|
|
Loading…
Reference in New Issue