Odoo is the world's easiest all-in-one management software. It includes hundreds of business apps:
CRM | e-Commerce | Accounting | Inventory | PoS | Project management | MRP | etc.
I am trying to retrieve some values that matches date but i am getting error.
I created like this self.search([('date', '=', datetime.now().date())])
ERROR openerp.sql_db: Programming error: COALESCE types text and date cannot be matched
LINE 2: ... SELECT ct.id, coalesce(it.value,ct."date")
, in query SELECT "table_table".id FROM "table_table" WHERE ("table_table"."id" in (WITH temp_irt_current (id, name) as (
SELECT ct.id, coalesce(it.value,ct."date")
FROM bill_records ct
LEFT JOIN ir_translation it ON (it.name = %s and
it.lang = %s and
it.type = %s and
it.res_id = ct.id and
it.value != '')
SELECT id FROM temp_irt_current WHERE name = %s order by name
)) ORDER BY "table_table"."id"
I tried like you said but i am getting the same
self.search([('date', '=', fields.Date.to_string(datetime.today().date()))])
Sample out put from your code
print fields.Date.to_string(datetime.today().date()) -----------2016-05-26
print type(fields.Date.to_string(datetime.today().date())) ---------<type 'str'>
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 platform 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.Register
Odoo Training Center
Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.Test it now
|Asked: 5/26/16, 11:26 AM|
|Seen: 399 times|
|Last updated: 5/26/16, 1:51 PM|