diff options
| author | jvm-odoo <jvm@odoo.com> | 2019-11-21 06:58:42 +0000 |
|---|---|---|
| committer | fw-bot <otis@odoo.com> | 2019-11-21 12:38:47 +0000 |
| commit | 6e1357e50085aa787eb263f62391bb7caa8a2a5a (patch) | |
| tree | fefe9714442adfd631434467e37934d7e77bbcb5 | |
| parent | 3fd2debdc822b17d51e5849d5e40e907e89e9c80 (diff) | |
[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 <jasonvanmalder@users.noreply.github.com>
| -rw-r--r-- | addons/hr_holidays/models/hr_leave_type.py | 2 |
1 files changed, 1 insertions, 1 deletions
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): |
