Do not use Literal to count in SQL
The * is not actually a parameter of the aggregate function so it is better to let python-sql manage it with its default value.
This commit is contained in:
@@ -120,7 +120,7 @@ class Abstract(ModelSQL):
|
||||
return [
|
||||
cls._column_id(tables, withs).as_('id'),
|
||||
opportunity.company.as_('company'),
|
||||
Count(Literal(1)).as_('number'),
|
||||
Count().as_('number'),
|
||||
Sum(opportunity.amount).as_('amount'),
|
||||
Sum(Case(
|
||||
(opportunity.state.in_(cls._converted_states()),
|
||||
|
||||
@@ -54,7 +54,7 @@ exclude = ['doc']
|
||||
[tool.hatch.metadata.hooks.tryton]
|
||||
dependencies = [
|
||||
'python-dateutil',
|
||||
'python-sql >= 0.4',
|
||||
'python-sql >= 1.4',
|
||||
]
|
||||
copyright = 'COPYRIGHT'
|
||||
readme = 'README.rst'
|
||||
|
||||
Reference in New Issue
Block a user