[IMP] use introduced variable across function

bzr revid: xmo@openerp.com-20130610071036-8w771r4urq5j31zz
This commit is contained in:
Xavier Morel 2013-06-10 09:10:36 +02:00
parent 48d28c8726
commit aa416a9951
1 changed files with 4 additions and 4 deletions

View File

@ -527,13 +527,13 @@ instance.web.ListView = instance.web.View.extend( /** @lends instance.web.ListVi
return r.tag === 'field'; return r.tag === 'field';
}), 'name') }), 'name')
).done(function (records) { ).done(function (records) {
if (!records[0]) { var values = records[0];
if (!values) {
self.records.remove(record); self.records.remove(record);
return; return;
} }
var transfer_value = records[0]; _(_.keys(values)).each(function(key){
_(_.keys(transfer_value)).each(function(key){ record.set(key, values[key], {silent: true});
record.set(key, transfer_value[key], {silent: true});
}); });
record.trigger('change', record); record.trigger('change', record);
}); });