[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>
This commit is contained in:
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user