Odoo Help

Welcome!

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.

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,256 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

--Med Said BARA--
2664
| 5 5 7
Algeria
--Med Said BARA--
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

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

2 follower(s)

Stats

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