gpt4 book ai didi

python - 无法卸载模块 - Openerp

转载 作者:数据小太阳 更新时间:2023-10-29 02:41:23 26 4
gpt4 key购买 nike

当我要卸载我自己的模块时,它给出了一个错误。 (OpenErp ver 7)在我的课上我也输入了不同的不同修改。但我没有清除所有这些东西并只保留下面的代码。请帮助我找出问题所在..现在当我尝试安装 address_book 模块时也发生了这个错误

  File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/registry.py", line 218, in new
openerp.modules.load_modules(registry.db, force_demo, status, update_module)
File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/modules/loading.py", line 416, in load_modules
pool.get('ir.module.module').module_uninstall(cr, SUPERUSER_ID, mod_ids_to_remove)
File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/base/module/module.py", line 439, in module_uninstall
ir_model_constraint._module_data_uninstall(cr, uid, constraint_ids, context)
File "/home/priyan/Software/openerp-7.0-20130309-002120/openerp/addons/base/ir/ir_model.py", line 533, in _module_data_uninstall
WHERE cs.contype=%s and cs.conname=%s and cl.relname=%s""", ('f', name, model_obj._table))
AttributeError: 'NoneType' object has no attribute '_table'

这是我的 view.xml 文件

<?xml version="1.0"?>
<openerp>
<data>
<!-- 1st part of the sim_view start -->
<record model="ir.ui.view" id="worker_form">
<field name="name">Basic Data</field>
<field name="model">checkroll.plucker</field>
<field name="type">form</field>
<field name="arch" type="xml">
<form string="Worker_test">
<field name="reg_no" />
<field name="worker_name" />
<field name="spouse_name" />
<field name="gender" />
<field name="epf_no" />
</form>
</field>
</record>
<!--2nd part of the sim_view start -->
<record model="ir.ui.view" id="worker_tree">
<field name="name">Basic Data</field>
<field name="model">checkroll.plucker</field>
<field name="type">tree</field>
<field name="arch" type="xml">
<tree string="Worker_test"><!-- which columns need to shows in OpenERP List View -->
<field name="reg_no" />
<field name="worker_name" />
<field name="spouse_name" />
</tree>
</field>
</record>
<!-- 3rd part of the sim_view start -->
<record model="ir.actions.act_window" id="action_worker_reg">
<field name="name">Worker Registration</field><!-- This shows what should
screen caption in form/tree views -->
<field name="res_model">checkroll.plucker</field>
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>



</data>
</openerp>

这是我的类(class)文件

from openerp.osv import fields, osv
import random

class checkroll(osv.osv):
_name = "checkroll.plucker"
_description = "This table is for keeping personal data of plucker"
_columns = {
'reg_no': fields.char('Registration Number', size=256, required=True),
'worker_name': fields.char('Worker Name', size=256, required=True),
'spouse_name': fields.char('Spouse Name', size=256),
'gender' : fields.selection((('male', 'Male'), ('female', 'Female'), ('middle', 'Test')), 'Gender', required=True),
'epf_no':fields.char('EPF Number', size=256)
}

checkroll()

最佳答案

我后端的数据映射似乎有问题。所以我以管理员身份登录到 openerp 并创建新数据库并将我的模块迁移到那里。现在它完美地工作

谢谢大家

希望得到这个错误的任何人都能从这个答案中得到帮助

关于python - 无法卸载模块 - Openerp,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15490833/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com