Odoo Help


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.


how can i filter a view by null value (using domain operator ) ?

Michael REMY
on 3/4/13, 11:40 AM 8,176 views

hi !

i wish to create a view where data is filtered on a datetime field which is null

so in domain statement, i enter :

Code: domain="[('mydatetime','ISNULL,'')]

but i have to enter the third parameter after 'ISNULL', ! openerp does not let me pass 2 values only. what can i do ? i also tried Code: domain="[('mydatetime','=,'NULL')]

but it produced an error in sql (generate "mydatetime='NULL' whic cause a type error in sql)

so, what is the right syntaxe for null in the domain clause ?

thank for help


Andreas Brueckl

--Andreas Brueckl--
| 7 8 7
Vienna, Austria
--Andreas Brueckl--
OpenERP Consulting and Development
Andreas Brueckl
On 3/4/13, 11:46 AM

In python there is no null value, use False instead.

domain= [('mydatetime','=',False)]

I think that we can use also None, agree with me ?

Yug Faa
on 3/5/13, 5:37 AM
Michael REMY
On 3/4/13, 5:49 PM

thank ! it works !

ps : i don't find the "solve" button, where is it ?

Please use the "post a comment" button for a comment :) you have created a new answer! If you want to mark a question as "solved" just press the "correct answer" icon so that it becomes green.

Andreas Brueckl
on 3/4/13, 6:04 PM

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

0 follower(s)


Asked: 3/4/13, 11:40 AM
Seen: 8176 times
Last updated: 6/16/16, 10:13 AM