[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:
parent
27d439901c
commit
4d8ec5f931
|
@ -4376,7 +4376,7 @@ instance.web.form.One2ManyViewManager = instance.web.ViewManager.extend({
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
write_function: function(id, data, options) {
|
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();
|
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);
|
var pop = new instance.web.form.FormOpenPopup(self);
|
||||||
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
|
pop.show_element(self.o2m.field.relation, id, self.o2m.build_context(), {
|
||||||
title: _t("Open: ") + self.o2m.string,
|
title: _t("Open: ") + self.o2m.string,
|
||||||
write_function: function(id, data) {
|
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();
|
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(), {
|
pop.show_element(self.field.relation, id, self.build_context(), {
|
||||||
title: _t("Open: ") + self.string,
|
title: _t("Open: ") + self.string,
|
||||||
write_function: function(id, data, options) {
|
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();
|
self.render_value();
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
Loading…
Reference in New Issue