[FIX] double-include of ids in the dataset, and double-save in some cases ~/projects/tiny/web/current
on [change] of a listview record, if there was no id on the record (id=false) we need to add one. But depending how the creation/addition of the record was done, the id may already have been inserted e.g. by the formview. So first check if the record's id is already in the dataset, and add it if it's not. bzr revid: xmo@openerp.com-20120709092401-p1in6bvs5e2ptp5p
This commit is contained in:
parent
853c5a70c0
commit
d51c9a8590
|
@ -919,9 +919,12 @@ instance.web.ListView.List = instance.web.Class.extend( /** @lends instance.web.
|
|||
throw new Error("Setting 'id' attribute on existing record "
|
||||
+ JSON.stringify(record.attributes));
|
||||
}
|
||||
// add record to dataset
|
||||
self.dataset.ids.splice(
|
||||
self.records.indexOf(record), 0, value);
|
||||
if (!_.contains(self.dataset.ids, value)) {
|
||||
// add record to dataset if not already in (added by
|
||||
// the form view?)
|
||||
self.dataset.ids.splice(
|
||||
self.records.indexOf(record), 0, value);
|
||||
}
|
||||
// Set id on new record
|
||||
$row = self.$current.children('[data-id=false]');
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue