Odoo Help


New Model - Cannot find field

dave ellis
on 7/11/13, 11:02 AM 1,936 views
Update  **The below example is not exclusive to my model design.**

Certainly tested 6.1 and 7.0. When using the model screen and creating a new model, the database table does not have the correct columns, hence the error. I can manually add the colums to the database table, but this didn't used to work like this. I really think I am missing something or there is a problem, but even looking at my old documents for 5.x the steps were create the model and the correct table/columns were created.

I have tested 6.1 and 7.0. It seems that if you literally go to settings>technical>database structure. Add a model with just x_name field and then create a menu. Go to add a new record via the new menu, it cannot find the new field in the new database table. Have I missed a simple setup??

I created a new model within Settings>Technical>Database Structure called x_contracts.

name                  field-label field-type required readonly searchable-Type
x_name                Title       char       True     False    Custom Field
x_expired             Expired     boolean    False    False    Custom Field
x_last_payment_date   Date        Date       False    False    Custom Field

I am extending the res.partner by adding a custom field called x_contracts manytomany using model x_contracts. Now if I add the new field x_contracts to my view res.partner, in page:

<page string="Maintenance" attrs="{'invisible': [('is_company','=',False)]}"> <field name="x_contracts"> </field></page>

This is done via development mode>manage views under debug>edit (res.partner.form) and adding the field in there.

I get the error, when I go to the page tab under customers and select the dropdown create and edit, then save the new record:

ProgrammingError: column "x_last_payment_date" of relation "x_contracts" does not exist

LINE 1: insert into "x_contracts" (id,"x_last_payment_date","x_maint...

Now checking the database, yes there is no x_last_payment_date in the table x_contracts physically in PostgreSQL. However when using the interface to create a new model, I believe it is stored else where.

So the question may be, have I missed a step or mis-configured it?

How do I display the data in a page within the customers screen and link the two.

'x_last_payment_date' may not be created in the x_contracts so plz try to create the filed x_last_payment_date in your x_contracts and try again

Lithin T
on 7/15/13, 6:15 AM

Hi thanks for the response. Directly in the table or via the OpenERP system within the models menu?

dave ellis
on 7/15/13, 6:17 AM

So if I create the fields manually in the table, it works. But in version 5 and earlier version 6 installs, adding a model has created the necessary information to be able to just start adding records. That's without going to the database direct and adding fields.

dave ellis
on 7/15/13, 8:13 AM

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.


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

0 follower(s)


Asked: 7/11/13, 11:02 AM
Seen: 1936 times
Last updated: 3/16/15, 8:10 AM