[FIX] mrp: Corrected error on saving production order record.

bzr revid: uco@tinyerp.com-20100924053535-qnt5or0p9lpg1h15
This commit is contained in:
uco (Open ERP) 2010-09-24 11:05:35 +05:30
parent cf4b9b9a45
commit fa9a98c692
1 changed files with 6 additions and 5 deletions

View File

@ -361,11 +361,12 @@ class many2many_domain(fields.many2many):
for i in ids:
res[i] = []
valid_move_ids = move_obj.search(cr, user, self._domain) # move ids relative to domain argument
cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
[tuple(ids), tuple(valid_move_ids)])
related_move_map = cr.fetchall()
related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
res.update(related_move_dict)
if valid_move_ids:
cr.execute("SELECT production_id, move_id from mrp_production_move_ids where production_id in %s and move_id in %s",
[tuple(ids), tuple(valid_move_ids)])
related_move_map = cr.fetchall()
related_move_dict = dict((k, list(set([v[1] for v in itr]))) for k, itr in groupby(related_move_map, itemgetter(0)))
res.update(related_move_dict)
return res