summaryrefslogtreecommitdiff
path: root/addons/web/static/src/js/views/basic
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-13 13:56:39 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commit9636e05bf01d708da148591423bc32dd8e100434 (patch)
tree62fb43585a9e41348fe83c68f7968b6b6834fd00 /addons/web/static/src/js/views/basic
parent26f91c429cd5dac112e74793c43b828872a90051 (diff)
[FIX] web: use correct domain when fetching status values
The m2o choices that a status field works with are determined using the associated domain. If the current value is not matched by this domain, the current value should still be visible so the domain is automatically extended to match this current value. The problem is that the current value in edit mode or in create mode is not given by the `data` attribute of the associated datapoint. Indeed, user changes and default get are stored in the `_changes` key and it is those values that must be used if they exist.
Diffstat (limited to 'addons/web/static/src/js/views/basic')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js2
1 files changed, 1 insertions, 1 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 8e534d4eda1..7797abfc3f6 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1413,7 +1413,7 @@ var BasicModel = AbstractModel.extend({
var context = record.getContext({fieldName: fieldName});
var domain = record.getDomain({fieldName: fieldName});
if (domain.length) {
- var localID = record.data[fieldName];
+ var localID = record._changes && record._changes[fieldName] || record.data[fieldName];
if (localID) {
var element = this.localData[localID];
domain = ["|", ["id", "=", element.data.id]].concat(domain);