diff options
| author | Géry Debongnie <ged@odoo.com> | 2018-05-28 16:32:33 +0200 |
|---|---|---|
| committer | Géry Debongnie <ged@odoo.com> | 2018-05-29 09:34:55 +0200 |
| commit | 20454038d08913404b5a039ef06182227052d2da (patch) | |
| tree | 6013068bd887cbe035d9ba912262628ad3438eb2 /addons/web/static/src | |
| parent | 59636caebae77a527b1e62f85b6a741d4ef029d9 (diff) | |
[IMP] web: small optimization in calendar view
In some cases, the calendar view sends a trivial domain, such as
["partner_id", "not in", []]
This is clearly not really useful, and it could hurt performances in
some cases (for example, if the partner_id field is a related on a large
table, and non stored).
This is clearly not a complete fix, but it is easy, safe and does not
hurt.
Diffstat (limited to 'addons/web/static/src')
| -rw-r--r-- | addons/web/static/src/js/views/calendar/calendar_model.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/addons/web/static/src/js/views/calendar/calendar_model.js b/addons/web/static/src/js/views/calendar/calendar_model.js index 240beb9f1dc..63a35171a30 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -373,7 +373,9 @@ return AbstractModel.extend({ domain.push([field, 'in', authorizedValues[field]]); } for (var field in avoidValues) { - domain.push([field, 'not in', avoidValues[field]]); + if (avoidValues[field].length > 0) { + domain.push([field, 'not in', avoidValues[field]]); + } } return domain; |
