[FIX] mrp. fix in function _moves_assigned

bzr revid: qdp-launchpad@openerp.com-20130909232102-ldbugx011vavy9jm
This commit is contained in:
Quentin (OpenERP) 2013-09-10 01:21:02 +02:00
commit 97cf5b2f28
1 changed files with 3 additions and 2 deletions

View File

@ -453,11 +453,12 @@ class mrp_production(osv.osv):
def _moves_assigned(self, cr, uid, ids, name, arg, context=None):
""" Test whether all the consume lines are assigned """
res = True
res = {}
for production in self.browse(cr, uid, ids, context=context):
res[production.id] = True
states = [x.state != 'assigned' for x in production.move_lines if x]
if any(states) or len(states) == 0:
return False
res[production.id] = False
return res