diff options
Diffstat (limited to 'addons/web/static/src/js/views/basic')
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_controller.js | 6 | ||||
| -rw-r--r-- | addons/web/static/src/js/views/basic/basic_model.js | 8 |
2 files changed, 13 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/basic/basic_controller.js b/addons/web/static/src/js/views/basic/basic_controller.js index c899530de07..5fc68e3124e 100644 --- a/addons/web/static/src/js/views/basic/basic_controller.js +++ b/addons/web/static/src/js/views/basic/basic_controller.js @@ -447,7 +447,11 @@ var BasicController = AbstractController.extend(FieldManagerMixin, { */ _setMode: function (mode, recordID) { if ((recordID || this.handle) === this.handle) { - return this.update({mode: mode}, {reload: false}); + return this.update({mode: mode}, {reload: false}).then(function () { + // necessary to allow all sub widgets to use their dimensions in + // layout related activities, such as autoresize on fieldtexts + core.bus.trigger('DOM_updated'); + }); } return $.when(); }, diff --git a/addons/web/static/src/js/views/basic/basic_model.js b/addons/web/static/src/js/views/basic/basic_model.js index 1df118ecfd9..f3b23bdab7a 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -1092,6 +1092,9 @@ var BasicModel = AbstractModel.extend({ * @param {boolean} [options.doNotSetDirty=false] if this flag is set to * true, then we will not tag the record as dirty. This should be avoided * for most situations. + * @param {boolean} [options.notifyChange=true] if this flag is set to + * false, then we will not notify and not trigger the onchange, even though + * it was changed. * @param {string} [options.viewType] current viewType. If not set, we will assume * main viewType from the record * @returns {Deferred} @@ -1119,6 +1122,10 @@ var BasicModel = AbstractModel.extend({ } } + if (options.notifyChange === false) { + return $.when(); + } + return $.when.apply($, defs).then(function () { var onChangeFields = []; // the fields that have changed and that have an on_change for (var fieldName in changes) { @@ -2305,6 +2312,7 @@ var BasicModel = AbstractModel.extend({ var ids = record.data[fieldName] || []; var list = self._makeDataPoint({ count: ids.length, + context: record.context, fieldsInfo: fieldsInfo, fields: view ? view.fields : fieldInfo.relatedFields, limit: fieldInfo.limit, |
