[FIX] web: readonly fields not transferred from dialog to 2many field

'write_function' transfer the options to 'write' method from the popup form

Steps to reproduce:
1. Create custom model to add a product quantity on hand(readonly) field on stock.move
2. Show this field on Warehouse>All operations>Create a Transfer> Create: Internal Moves
3. Add a Internal Move, then open it again, the quantity on hand field's value show 0. But change the product, the value is correct.
This commit is contained in:
Christophe Matthieu 2015-12-02 11:02:17 +01:00
parent 27d439901c
commit 4d8ec5f931
1 changed files with 4 additions and 4 deletions

View File

@ -4376,7 +4376,7 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({
});
},
write_function: function(id, data, options) {
return self.o2m.dataset.write(id, data, {}).done(function() {
return self.o2m.dataset.write(id, data, options).done(function() {
self.o2m.reload_current_view();
});
},
@ -4496,8 +4496,8 @@ instance.web.form.One2ManyListView = instance.web.ListView.extend({
var pop = new instance.web.form.FormOpenPopup(self);
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
title: _t("Open: ") + self.o2m.string,
write_function: function(id, data) {
return self.o2m.dataset.write(id, data, {}).done(function() {
write_function: function(id, data, options) {
return self.o2m.dataset.write(id, data, options).done(function() {
self.o2m.reload_current_view();
});
},
@ -5115,7 +5115,7 @@ instance.web.form.FieldMany2ManyKanban = instance.web.form.AbstractField.extend(
pop.show_element(self.field.relation, id, self.build_context(), {
title: _t("Open: ") + self.string,
write_function: function(id, data, options) {
return self.dataset.write(id, data, {}).done(function() {
return self.dataset.write(id, data, options).done(function() {
self.render_value();
});
},