From 6e1357e50085aa787eb263f62391bb7caa8a2a5a Mon Sep 17 00:00:00 2001 From: jvm-odoo Date: Thu, 21 Nov 2019 06:58:42 +0000 Subject: [PATCH] [FIX] hr_holidays: fix no id to export when selecting all in tree view Reproduce the issue - Install Time Off - Select all the lines - Action > Export The file has only columns but no data Cause In `hr_leave_type.py` the `_search` method's limit is `False` when we select all the lines. In 04e85ef, we return the leaves ids with `[:limit]` so `[:False]` that always returns an empty array instead of `[:None]` that returns the full list. This commit replaces the `[:limit]` by `[:limit or None]` OPW-2126109 closes odoo/odoo#40622 X-original-commit: 2c0b58c161dff4fe9a8f953463ed2b1efdf7b431 Signed-off-by: Jason Van Malder --- addons/hr_holidays/models/hr_leave_type.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py index 1d23d4db5f7..1357371b1dc 100644 --- a/addons/hr_holidays/models/hr_leave_type.py +++ b/addons/hr_holidays/models/hr_leave_type.py @@ -330,7 +330,7 @@ class HolidaysType(models.Model): leave_ids = super(HolidaysType, self)._search(args, offset=offset, limit=(None if post_sort else limit), order=order, count=count, access_rights_uid=access_rights_uid) leaves = self.browse(leave_ids) if post_sort: - return leaves.sorted(key=self._model_sorting_key, reverse=True).ids[:limit] + return leaves.sorted(key=self._model_sorting_key, reverse=True).ids[:limit or None] return leave_ids def action_see_days_allocated(self):