2016-12-05 56 views
1

我延长了“res.partnerodoo模块用下面的代码属性odoo模块数据库

class ResPartner(models.Model): _name = 'res.partner' _inherit = 'res.partner' sales_force_ids = fields.One2many('sales_calc.sales_calc') ake_code = fields.Char('AKE Code')

我重新启动Odoo服务器螺母时未创建我试图去模块中的模块升级模块,应用程序页面显示为白色屏幕

在odoo log中发现以下错误。

ProgrammingError: column res_partner.ake_code does not exist

回答

0

问题在继承机制升级模块不不仅是不够,我不得不卸载并重新安装模块

我评论ake_code = fields.Char('AKE Code')重启odoo服务器,卸载模块注释掉ake_code = fields.Char('AKE Code')重启odoo服务器和最后安装模块再次

困惑通过另一提出警告而重新安装该模块:

There is no reference field 'None' found for 'sales_calc.sales_calc'

的问题与sales_force_ids = fields.One2many('sales_calc.sales_calc')我不得不写的相关领域idsales_force_ids = fields.One2many('sales_calc.sales_calc', 'id')安装该模块通常没有这个警告。

+0

根本问题是你指定'_name ='res.partner'',如果你只是扩展一个Odoo模型,你不需要再指定名称'_inherit ='res.partner''就够了 – danidee

+0

**不,这根本不是问题**,它是** optiona ** l参数,我知道它**不重要**在**扩展模块的情况下写**。事实上,当**问题已经存在时,**并没有被写入**,并且**仍然被写入**,而**问题被解决**根据上面的书面**答案**。 **注意**:我重新解决了这个问题,并且不止一次地解决了它,以确定答案。谢谢@danidee。 –

+0

@danidee在odoo文档中看到**类的继承**,它写在**图**中**继承标题**'_name ='obj1'',它不同于**原型继承* *'_name ='new',尽管这两种类型的继承具有'_inherit = obj1'。 'https:// www.odoo.com/documentation/8.0/howtos/backend.html' –