summaryrefslogtreecommitdiff
path: root/addons/web/models
diff options
context:
space:
mode:
authorJason Van Malder <jvm@odoo.com>2020-01-07 13:17:33 +0000
committerJason Van Malder <jvm@odoo.com>2020-01-10 17:50:18 +0000
commit01137414a55ab6a86738b645352784d86539f208 (patch)
tree40701cd952dd9f76e64d1b1b98c66ca0b1445f44 /addons/web/models
parentb1075b36d18fdff17172a56f636c04b5890cedb1 (diff)
[FIX] mail, web: fix activities count when they are uniquified
Issue - Install CRM for example - Add 41 leads - Create an activity on each of them Everything ok, load more shows up - Add another activity on one of them Load more doesn't shows up Cause The uniquify method: https://github.com/odoo/odoo/blob/saas-12.3/odoo/models.py#L4187:#L4191 Consider the second activity as a duplicate and removes it. So, in `web_search_read`: `len(records) <= limit` is `True` and we ignore all the others records Solution Add `force_search_count` in the context when using this action to avoid uniquify to falsify the records length. I added the tree view for this action too. It improves UX. OPW-2165455 closes odoo/odoo#43149 X-original-commit: 13ec3503fbfb5d3d2b1e824059737bd866a3a9f4 Signed-off-by: Jason Van Malder <jvm-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/web/models')
-rw-r--r--addons/web/models/models.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/models/models.py b/addons/web/models/models.py
index 3ef871cabe0..0d03d950b9f 100644
--- a/addons/web/models/models.py
+++ b/addons/web/models/models.py
@@ -39,7 +39,7 @@ class Base(models.AbstractModel):
'length': 0,
'records': []
}
- if limit and len(records) == limit:
+ if limit and (len(records) == limit or self.env.context.get('force_search_count')):
length = self.search_count(domain)
else:
length = len(records) + offset