summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorChristophe Simonis <chs@odoo.com>2018-11-23 12:11:32 +0100
committerChristophe Simonis <chs@odoo.com>2018-11-23 12:11:32 +0100
commit7a0243ec15d916102ec4502db01ae5e70d6912cd (patch)
tree29c940dcab4e9f7c834b8a5e899e394d8f821794 /addons/web/static/src/js/views/basic
parent75477052a03530df791348cdcf819f5bedd46284 (diff)
parentb3052b690fad15feb3211525666d4962bc1a24ac (diff)
[MERGE] forward port branch 12.0 up to b3052b690fa
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 d0f15aeb369..345b76856b6 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1492,6 +1492,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') {
@@ -2838,11 +2843,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 () {
@@ -3674,7 +3674,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,
@@ -4382,6 +4382,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;