[FIX] base: count attachment correctly

Since _search return a query object, we cannot slice it. So we listify
it.

Thanks to XMO and RYV for their very valuable input.

closes odoo/odoo#122589

X-original-commit: 2e51b638232aff90405f318abb849f8b8db38496
Signed-off-by: Masereel Pierre <pim@odoo.com>
This commit is contained in:
Pierre Masereel
2023-05-26 10:29:24 +02:00
parent 428b78e9bd
commit 74c14ac2f0
+1 -1
View File
@@ -579,7 +579,7 @@ class IrAttachment(models.Model):
more_ids = self.with_context(need=need)._search(
domain, offset + len(all_ids), limit, order, access_rights_uid,
)
result.extend(more_ids[:limit - len(result)])
result.extend(list(more_ids)[:limit - len(result)])
return self.browse(result)._as_query(order)