[FIX] base: ir_attachment override traceback

When the _search method is called with, it passes this argument
to the other _search call in it con concatenate it with the
result. But when the count argument is true, it tries to take a sublist
of an integer which raise a traceback.

So we explicitly call it with count=False

closes odoo/odoo#108634

X-original-commit: 5c12edb989a044d35e8be93b40fdc0e3a66379ed
Signed-off-by: Julien Castiaux <juc@odoo.com>
This commit is contained in:
Pierre Masereel
2022-12-24 02:35:43 +01:00
parent 7c66694cdb
commit 4ac3fbc5e9
+1 -1
View File
@@ -592,7 +592,7 @@ class IrAttachment(models.Model):
if len(orig_ids) == limit and len(result) < self._context.get('need', limit):
need = self._context.get('need', limit) - len(result)
result.extend(self.with_context(need=need)._search(args, offset=offset + len(orig_ids),
limit=limit, order=order, count=count,
limit=limit, order=order, count=False,
access_rights_uid=access_rights_uid)[:limit - len(result)])
return len(result) if count else list(result)