summaryrefslogtreecommitdiff
path: root/addons/web/static/src
diff options
context:
space:
mode:
authorqsm-odoo <qsm@odoo.com>2017-03-13 11:48:03 +0100
committerAaron Bohy <aab@odoo.com>2017-04-11 19:44:38 +0200
commitc1256d1453078d9ceb64ea308efc39acb6cd4465 (patch)
treea946ad71e8d1222b98d3663280289c8f8381abd3 /addons/web/static/src
parentfc8cfc57627bf57686b7e93749c8b4f9a05622f5 (diff)
[FIX] web: record with field status with domain
If a m2o field status has an associated domain, it is used to match the records to display as status choices. This domain is extended so that it always matches the current status value. The code which was in charge of that was buggy when the status had no value (in that case the domain should not be extended).
Diffstat (limited to 'addons/web/static/src')
-rw-r--r--addons/web/static/src/js/views/basic/basic_model.js6
1 files changed, 4 insertions, 2 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 2cfa96a3015..8e534d4eda1 100644
--- a/addons/web/static/src/js/views/basic/basic_model.js
+++ b/addons/web/static/src/js/views/basic/basic_model.js
@@ -1414,8 +1414,10 @@ var BasicModel = AbstractModel.extend({
var domain = record.getDomain({fieldName: fieldName});
if (domain.length) {
var localID = record.data[fieldName];
- var element = this.localData[localID];
- domain = ["|", ["id", "=", element.data.id]].concat(domain);
+ if (localID) {
+ var element = this.localData[localID];
+ domain = ["|", ["id", "=", element.data.id]].concat(domain);
+ }
}
// avoid rpc if not necessary