From 20454038d08913404b5a039ef06182227052d2da Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=A9ry=20Debongnie?= Date: Mon, 28 May 2018 16:32:33 +0200 Subject: [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. --- addons/web/static/src/js/views/calendar/calendar_model.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'addons/web/static/src/js/views') 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; -- cgit v1.2.3