[imp] removed useless additional code in o2m

bzr revid: nicolas.vanhoren@openerp.com-20110630074616-43tq258uu9otewp1
This commit is contained in:
niv-openerp
2011-06-30 09:46:16 +02:00
parent 62fc1d41ba
commit cd19d41e8c
-26
View File
@@ -1503,18 +1503,6 @@ openerp.base.form.FieldOne2Many = openerp.base.form.Field.extend({
});
this._super(ids);
this.dataset.set_ids(ids);
} else if (value.length >= 1 && typeof(value[0]) === "object") {
var ids = [];
this.dataset.delete_all = true;
_.each(value, function(command) {
var obj = {values: command};
obj['id'] = _.uniqueId(self.dataset.virtual_id_prefix);
self.dataset.to_create.push(obj);
self.dataset.cache.push(_.clone(obj));
ids.push(obj.id);
});
this._super(ids);
this.dataset.set_ids(ids);
} else {
this._super(value);
this.dataset.reset_ids(value);
@@ -1543,20 +1531,6 @@ openerp.base.form.FieldOne2Many = openerp.base.form.Field.extend({
this.dataset.to_delete, function(x) {
return commands['delete'](x.id);}));
},
get_on_change_value: function() {
var self;
return _.map(this.dataset.ids, function(id) {
var values = _.detect(self.dataset.cache, function(x) {return x.id === id});
if (values) {
values = _.clone(values);
delete values["id"];
return values;
} else {
console.info("trying to get value in a o2m before that value is loaded");
return {};
}
});
},
validate: function() {
this.invalid = false;
// TODO niv