Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

DataError: invalid input syntax for type date: "False"

By
Gratien HOUNDAKO
on 5/27/15, 4:42 AM 947 views

Hi please tell me how to fix this error:


Server Traceback (most recent call last):

File "/opt/openerp/server/openerp/addons/web/session.py", line 89, in send

return openerp.netsvc.dispatch_rpc(service_name, method, args)

File "/opt/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc

result = ExportService.getService(service_name).dispatch(method, params)

File "/opt/openerp/server/openerp/service/web_services.py", line 626, in dispatch

res = fn(db, uid, *params)

File "/opt/openerp/server/openerp/osv/osv.py", line 188, in execute_kw

return self.execute(db, uid, obj, method, *args, **kw or {})

File "/opt/openerp/server/openerp/osv/osv.py", line 131, in wrapper

return f(self, dbname, *args, **kwargs)

File "/opt/openerp/server/openerp/osv/osv.py", line 197, in execute

res = self.execute_cr(cr, uid, obj, method, *args, **kw)

File "/opt/openerp/server/openerp/addons/audittrail/audittrail.py", line 514, in execute_cr

return fct_src(cr, uid, model, method, *args, **kw)

File "/opt/openerp/server/openerp/osv/osv.py", line 185, in execute_cr

return getattr(object, method)(cr, uid, *args, **kw)

File "/opt/openerp/server/openerp/osv/orm.py", line 3620, in read

result = self._read_flat(cr, user, select, fields, context, load)

File "/opt/openerp/server/openerp/osv/orm.py", line 3741, in _read_flat

res2 = self._columns[f].get(cr, self, ids, f, user, context=context, values=res)

File "/opt/openerp/server/openerp/osv/fields.py", line 1141, in get

result = self._fnct(obj, cr, uid, ids, name, self._arg, context)

File "/opt/openerp/server/openerp/addons/invoice_print_report_balance_payment/account_invoice.py", line 59, in _to_pay_get

context=context

File "/opt/openerp/server/openerp/addons/invoice_print_report_balance_payment/partner.py", line 44, in get_balance_at_date

cr.execute(sql)

File "/opt/openerp/server/openerp/sql_db.py", line 161, in wrapper

return f(self, *args, **kwargs)

File "/opt/openerp/server/openerp/sql_db.py", line 226, in execute

res = self._obj.execute(query, params)

DataError: invalid input syntax for type date: "False"

LINE 7: AND m.date <= 'False'

0
Gerhard Baumgartner
On 2/4/16, 7:26 AM

LINE 7: AND m.date <= 'False'

Line 7 does not mean Line 7 in a file. This is an error your database is throwing.

The faulty query should be somewhere near

invoice_print_report_balance_payment/partner.py", line 44, in get_balance_at_date

I assume you're trying to make sure that the date is not empty, because odoo usually translates an empty field to False. 

In this case change the query to AND m.date IS NOT NULL



I have removed addon

Gratien HOUNDAKO
on 5/20/16, 8:48 AM
0
Gratien HOUNDAKO
On 5/29/15, 5:06 AM

Hello,

My problem is still not resolved.

In fact I do not know where to correct. I do not master well traceback

LINE 7: AND m.date &lt;= 'False

LINE 7 of which file

Thk.

0
John Touba
On 5/27/15, 4:45 AM

 if you want test, if your date is not empty . you just write "and m.date" .

0
Gülhan Celik
On 5/28/15, 9:18 AM

Hi Gratien,

- you can test the type of the attribute eg. >> if type(m.date) == 'date' and m.date <= ...

- you can also test if the attribute is not empty eg. >> if m.date (if m.date == True) and m.date <= ...

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 5/27/15, 4:42 AM
Seen: 947 times
Last updated: 5/20/16, 8:28 AM