From 5fce37486a707c19ba4c751b234f5620ed066aa7 Mon Sep 17 00:00:00 2001 From: Aaron Bohy Date: Fri, 11 Aug 2017 10:23:55 +0200 Subject: [FIX] web: BasicModel: default_get: false m2o inside o2m Sometimes, a default_get returns a create command for a one2many, with a dict of values containing value 'false' for a many2one. This is strictly equivalent to the case where the many2one field isn't in the dict of values, but we have to handle both cases, and before this rev., we only handled the latter one. This happens for example in Sales > Leads (must be activated in the Settings) > in the list view, check several leads > in 'Action', click on 'Forward to Partner' > crash. --- addons/web/static/src/js/views/basic/basic_model.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views/basic/basic_model.js') 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 8bb46ea68aa..72a89a23cc2 100644 --- a/addons/web/static/src/js/views/basic/basic_model.js +++ b/addons/web/static/src/js/views/basic/basic_model.js @@ -2922,7 +2922,7 @@ var BasicModel = AbstractModel.extend({ r._changes = _.defaults(value[2], r.data); for (var name in r._changes) { - if (r._changes[name] === null) { + if (!r._changes[name]) { continue; } var isFieldInView = name in r.fields; -- cgit v1.2.3