You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Odoo standard project task has read_group overridden and loops on domains. When we create a true domain (1, '=', 1) with web_domain_field it is created as [1, '=', 1], so it's not recognised as true leaf by odoo osv, causing this overridden read_group to try splitting "1" like a field name.
To Reproduce
16.0:
Steps to reproduce the behavior:
Use a dynamic domain on a project.task field.
Add that field into a tree view.
Try to group by.
Expected behavior
Right now I cannot see a proper solution for this other than overridding the read_group on project.task like this:
@api.model
def read_group(self, domain, fields, groupby, offset=0, limit=None, orderby=False, lazy=True):
fields_list = ([f.split(':')[0] for f in fields] or [])
if groupby:
fields_groupby = [groupby] if isinstance(groupby, str) else groupby
# only take field name when having ':' e.g 'date_deadline:week' => 'date_deadline'
fields_list += [f.split(':')[0] for f in fields_groupby]
if domain:
for term in domain:
if isinstance(term, (tuple, list)) and term not in [expression.TRUE_LEAF, expression.FALSE_LEAF, [1, '=', 1]]:
fields_list += [term[0].split('.')[0]]
self._ensure_fields_are_accessible(fields_list)
return super(models.Model, self).read_group(domain, fields, groupby, offset=offset, limit=limit, orderby=orderby, lazy=lazy)
Watch how [1, '=', 1] is excluded for parsing and then the models.Model super read_group is called.
The text was updated successfully, but these errors were encountered:
Module
Web Domain Field - web_domain_field
Describe the bug
Odoo standard project task has read_group overridden and loops on domains. When we create a true domain (1, '=', 1) with web_domain_field it is created as [1, '=', 1], so it's not recognised as true leaf by odoo osv, causing this overridden read_group to try splitting "1" like a field name.
To Reproduce
16.0:
Steps to reproduce the behavior:
Expected behavior
Right now I cannot see a proper solution for this other than overridding the read_group on project.task like this:
Watch how [1, '=', 1] is excluded for parsing and then the models.Model super read_group is called.
The text was updated successfully, but these errors were encountered: