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-30 11:47:06 +0200 |
| commit | aaea6fd08817f28cd47e67c4c7227969a5e4956f (patch) | |
| tree | e5d189742ee77696d1ce9a09ec9dfa1a0ec9660a /addons/web/static/src | |
| parent | a2f275dfc48281648ce4f17b3444f52a25f2595b (diff) | |
[FIX] web: small performance fix 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 ba34d754bdb..9285034398d 100644 --- a/addons/web/static/src/js/views/calendar/calendar_model.js +++ b/addons/web/static/src/js/views/calendar/calendar_model.js @@ -355,7 +355,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; |
