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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user