[FIX] fields.related._fnct_write: handle the case where ids is a single id

bzr revid: rco@openerp.com-20121105082259-rcmcjs5n1eimtcpl
This commit is contained in:
Raphael Collet 2012-11-05 09:22:59 +01:00
parent ba9a47a771
commit db13e8591a
1 changed files with 2 additions and 0 deletions

View File

@ -1158,6 +1158,8 @@ class related(function):
return map(lambda x: (field, x[1], x[2]), domain)
def _fnct_write(self,obj,cr, uid, ids, field_name, values, args, context=None):
if isinstance(ids, (int, long)):
ids = [ids]
for record in obj.browse(cr, uid, ids, context=context):
# traverse all fields except the last one
for field in self.arg[:-1]: