تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
6748 أدوات العرض
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

الكاتب

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

الكاتب

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.

المنشورات ذات الصلة الردود أدوات العرض النشاط
2
يوليو 25
1668
1
أبريل 24
6439
0
نوفمبر 24
50
0
أبريل 22
109
1
أكتوبر 20
12536