0

我按照以下步骤创建了一个名为 "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:

回溯(最近一次通话最后):

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...

我在通过 Web 界面创建模块方面是否有任何错误

4

1 回答 1

0

我有同样的问题,进入数据库并在表 x_test 中创建您在模型中添加的字段。

现在就我而言,它应该为您创建字段。但我不得不手动创建这些字段。

于 2013-11-19T13:06:30.990 回答