扩展的属性-传统继承-数据库中未创建odoo模块
Attributes of extended - traditional inheritance - odoo module not created in the database
我用下面的代码扩展了'res.partner'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')
当我尝试转到 apps 中的模块升级模块时,我重新启动了 Odoo 服务器 nut,apps 页面显示为白屏
在odoo日志中发现如下错误。
ProgrammingError: column res_partner.ake_code does not exist
问题不是在继承机制,而是升级模块只是不够,我不得不卸载并重新安装模块。
我评论了 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')
有关 我必须将相关字段 id
写成sales_force_ids = fields.One2many('sales_calc.sales_calc', 'id')
才能正常安装模块,没有这个警告。
我用下面的代码扩展了'res.partner'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')
当我尝试转到 apps 中的模块升级模块时,我重新启动了 Odoo 服务器 nut,apps 页面显示为白屏
在odoo日志中发现如下错误。
ProgrammingError: column res_partner.ake_code does not exist
问题不是在继承机制,而是升级模块只是不够,我不得不卸载并重新安装模块。
我评论了 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')
有关 我必须将相关字段 id
写成sales_force_ids = fields.One2many('sales_calc.sales_calc', 'id')
才能正常安装模块,没有这个警告。