[FIX]Refixed the issue of o2m record duplication

This commit is contained in:
Mohammed Shekha 2014-05-27 19:35:09 +05:30
parent 477fa85e55
commit 26cb208903
1 changed files with 5 additions and 2 deletions

View File

@ -3948,8 +3948,11 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
else
return $.when();
}).done(function () {
if (!self.o2m.options.reload_on_button) {
self.o2m.dataset.reset_ids([]);
var ds = self.o2m.dataset;
var cached_records = _.any([ds.to_create, ds.to_delete, ds.to_write], function(value) {
return value.length;
});
if (!self.o2m.options.reload_on_button && !cached_records) {
self.handle_button(name, id, callback);
}else {
self.handle_button(name, id, function(){