Odoo Help

1

Getting this : Warning - If you want to have it, you should update the records and execute manually: the code... What do I do?

By
John Baldwin
on 12/28/14, 2:47 AM 1,875 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.

1
Med Said BARA
On 12/28/14, 7:38 AM

 

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

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

Question tools

2 follower(s)

Stats

Asked: 12/28/14, 2:47 AM
Seen: 1875 times
Last updated: 2/2/16, 1:08 AM