Merge pull request #221 from odoo-dev/7.0-o2m-duplication-issue-msh
[FIX] Fix o2m record duplication when clicking on a button The button action will execute a write call, creating the new line. The reload is necessary to avoid recreating the line when using the save button.
This commit is contained in:
commit
aeaa826d2f
|
@ -3948,7 +3948,11 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
|
||||||
else
|
else
|
||||||
return $.when();
|
return $.when();
|
||||||
}).done(function () {
|
}).done(function () {
|
||||||
if (!self.o2m.options.reload_on_button) {
|
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);
|
self.handle_button(name, id, callback);
|
||||||
}else {
|
}else {
|
||||||
self.handle_button(name, id, function(){
|
self.handle_button(name, id, function(){
|
||||||
|
|
Loading…
Reference in New Issue