This question has been flagged
1 Reply
10266 Views

So I made several fields required and when I restart odoo from command line in putty I see this warning:

WARNING app openerp.models.schema: Table 'crm_lead': unable to set a NOT NULL constraint on column 'zip' !
If you want to have it, you should update the records and execute manually:
ALTER TABLE crm_lead ALTER COLUMN zip SET NOT NULL

What should I do to remedy this? Any help appreciated.

Avatar
Discard
Best Answer

 

This means that in the crm_lead Table there is some records with a NULL value for the column zip, and probably this column is set to NOT NULL (or required= Need some value ==> Not Null):

http://www.tutorialspoint.com/postgresql/postgresql_null_values.htm

<<< The PostgreSQL NULL is the term used to represent a missing value. A NULL value in a table is a value in a field that appears to be blank.

A field with a NULL value is a field with no value. It is very important to understand that a NULL value is different than a zero value or a field that contains spaces. >>>

You can use a tool like PgADMIN 3 or the postgresql console (psql) and fill in some values for records in column zip and after that execute the scrip :    

ALTER TABLE crm_lead ALTER COLUMN zip SET NOT NULL

Avatar
Discard