summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-22 20:06:48 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-22 20:06:48 +0100
commitb4e1be8ab07d883637a7f0f00c37d9bbf5ef6ee8 (patch)
tree591d7ce8d61d9a9e5d35a695f6a2276066f1a4a3 /addons/web/static/src/js/views/basic
parent1c4d49330e7f9719e372040f0c8729d3cf3d09fa (diff)
parentb09f624f20781d65baf2060df40383898e6f86e5 (diff)
[MERGE] forward port branch saas-11.3 up to b09f624f207
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js13
1 files changed, 7 insertions, 6 deletions
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 f87106ec0c2..b31106b151e 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1596,6 +1596,11 @@ var BasicModel = AbstractModel.extend({
record._rawChanges[name] = val;
return;
}
+ if (record._rawChanges[name]) {
+ // if previous _rawChanges exists, clear them since the field is now knwon
+ // and restoring outdated onchange over posterious change is wrong
+ delete record._rawChanges[name];
+ }
var oldValue = name in record._changes ? record._changes[name] : record.data[name];
var id;
if (field.type === 'many2one') {
@@ -2733,11 +2738,6 @@ var BasicModel = AbstractModel.extend({
relationField: field.relation_field,
viewType: view ? view.type : fieldInfo.viewType,
});
- // set existing changes to the list
- if (record._changes && record._changes[fieldName]) {
- list._changes = self.localData[record._changes[fieldName]]._changes;
- record._changes[fieldName] = list.id;
- }
record.data[fieldName] = list.id;
if (!fieldInfo.__no_fetch) {
var def = self._readUngroupedList(list).then(function () {
@@ -3528,7 +3528,7 @@ var BasicModel = AbstractModel.extend({
model: params.modelName,
offset: params.offset || (type === 'record' ? _.indexOf(res_ids, res_id) : 0),
openGroupByDefault: params.openGroupByDefault,
- orderedBy: params.orderedBy || [],
+ orderedBy: params.orderedBy || (params.context && params.context.orderedBy) || [],
orderedResIDs: params.orderedResIDs,
parentID: params.parentID,
rawContext: params.rawContext,
@@ -4230,6 +4230,7 @@ var BasicModel = AbstractModel.extend({
if (options.context !== undefined) {
element.context = options.context;
+ element.orderedBy = options.context.orderedBy || element.orderedBy;
}
if (options.domain !== undefined) {
element.domain = options.domain;