Does OpenERP convert False value to NULL when affected to integer?
Yes, when issuing a ORM '.search' query, pass in Python False to represent database nulls. The ORM has no 'is' operator, so you must query for ('column', '=', False). Similarly, when '.browse' returns rows, database nulls are converted into Python False.
I believe the reason for this is that xmlrpc (which is used to send these queries to your OpenERP server) does not have any way to represent None/null values in its 'out of the box' configuration. Xmlrpc can be configured to allow nulls, but OpenERP does not use this.
The obvious question this raises is what happens for nullable boolean fields, where False is a valid value? Based on personal experiments: When creating row with a nullable boolean fields, if you pass Python False, then the database ends up containing false, not null as for other datatypes. I don't think there is any way to set such fields to null: It doesn't work to pass Python None, nor setting the default value to None and not passing this column at all.
Where is this documented? I can't find it.
It's all crazy. Welcome to Odoo!
Within OpenERP, when you define a new char field in python and set False as default value, the field will be set to NULL in the db, the ORM taking care of the conversion. Does the ORM also convert integer type the same way, or should I be careful that it may convert it to 0 instead of NULL?
Where could I find the on the fly value conversion rules of OSV (OpenERP ORM)?