From 4ac3fbc5e9fb6510ed4243745d70d65209835b08 Mon Sep 17 00:00:00 2001 From: Pierre Masereel Date: Fri, 23 Dec 2022 12:38:58 +0000 Subject: [PATCH] [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 --- odoo/addons/base/models/ir_attachment.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/addons/base/models/ir_attachment.py b/odoo/addons/base/models/ir_attachment.py index 895524f6098..4ae5b3684ab 100644 --- a/odoo/addons/base/models/ir_attachment.py +++ b/odoo/addons/base/models/ir_attachment.py @@ -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)