This question has been flagged
4164 Views

Hi friendz,

I followed the following steps to create a module named "x_test" :

1. Settings -->Technical --> Database Structure --> Models --> Create
Model Description : Test
Model :x_test

2. Add Fields
Name: x_sample
Field Label: sample
Field Type: boolean

3. Save 

4. Click on Create a Menu

5. Select appropriate menu and click on "CREATE MENU"

6. Click on the menu provided and try to provide values for my custom module

7. When I "SAVE" my record, I am getting the following error:

Traceback (most recent call last):

 File "/var/app/openerp/server/openerp/netsvc.py", line 292, in dispatch_rpc
    result = ExportService.getService(service_name).dispatch(method, params)
  File "/var/app/openerp/server/openerp/service/web_services.py", line 626, in dispatch
    res = fn(db, uid, *params)
  File "/var/app/openerp/server/openerp/osv/osv.py", line 188, in execute_kw
    return self.execute(db, uid, obj, method, *args, **kw or {})
  File "/var/app/openerp/server/openerp/osv/osv.py", line 131, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/var/app/openerp/server/openerp/osv/osv.py", line 197, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/var/app/openerp/server/openerp/osv/osv.py", line 185, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/var/app/openerp/server/openerp/osv/orm.py", line 4434, in create
    cr.execute('insert into "'+self._table+'" (id'+upd0+") values ("+str(id_new)+upd1+')', tuple(upd2))
  File "/var/app/openerp/server/openerp/sql_db.py", line 161, in wrapper
    return f(self, *args, **kwargs)
  File "/var/app/openerp/server/openerp/sql_db.py", line 228, in execute
    res = self._obj.execute(query, params)
ProgrammingError: column "x_sample" of relation "x_test" does not exist
LINE 1: insert into "x_test" (id,"x_sample",create_uid,create_date,wri...

Is there any mistake in my regards of creating a module via Web Interface

When I checked using "Eclipse Debugger mode", field not available in the module
Avatar
Discard

Check your steps again. Check that when you save the field, you also save the model. Check that the model has the field. I followed your exact steps and was about to create a new 'Test' record and set the 'Sample' field to True.

Author

So there is no error in my steps...

Always save the model first, then add columns for the model