Ensure to use an estimated count greater than 1 when applying log10
Closes #15038 (grafted from ff2281026e58f4d7a8c9823837ce16a9bb0fa09b) --HG-- branch : 8.0
This commit is contained in:
@@ -262,13 +262,13 @@ class Many2One(Field):
|
||||
return expression
|
||||
elif (self.left and self.right
|
||||
and len(ids) <= math.floor(math.log10(
|
||||
Target.estimated_count() or 1))):
|
||||
max(Target.estimated_count(), 1)))):
|
||||
return self.convert_domain_mptt(
|
||||
(name, operator, ids), tables)
|
||||
elif (self.path
|
||||
and (operator.endswith('parent_of')
|
||||
or len(ids) <= math.floor(math.log10(
|
||||
Target.estimated_count() or 1)))):
|
||||
max(Target.estimated_count(), 1))))):
|
||||
return self.convert_domain_path(
|
||||
(name, operator, ids), tables)
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user