Do not convert into float search amount of invoice if it is None

(grafted from 38c0a7d9d64b5e1fcec2a8cee10dcf71c15c9d57)

--HG--
branch : 6.0
This commit is contained in:
Cédric Krier
2023-01-12 11:36:01 +01:00
parent 9ad8667308
commit 091bc56ea9
+3 -3
View File
@@ -782,7 +782,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
invoice_query = Rule.query_get('account.invoice')
Operator = fields.SQL_OPERATORS[operator]
# SQLite uses float for sum
if backend.name == 'sqlite':
if value is not None and backend.name == 'sqlite':
value = float(value)
union = (line.join(invoice, condition=(invoice.id == line.invoice)
@@ -818,7 +818,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
invoice_query = Rule.query_get('account.invoice')
Operator = fields.SQL_OPERATORS[operator]
# SQLite uses float for sum
if backend.name == 'sqlite':
if value is not None and backend.name == 'sqlite':
value = float(value)
query = line.join(invoice,
@@ -847,7 +847,7 @@ class Invoice(Workflow, ModelSQL, ModelView, TaxableMixin):
invoice_query = Rule.query_get('account.invoice')
Operator = fields.SQL_OPERATORS[operator]
# SQLite uses float for sum
if backend.name == 'sqlite':
if value is not None and backend.name == 'sqlite':
value = float(value)
query = tax.select(tax.invoice,