我试图继承res.partner和hr.employee,当我运行/重新启动odoo服务器时,我得到了这个错误
错误500内部服务器错误
不管怎样,这是我的密码
1-模型/Conact.py
from odoo import models,fields
class ResPartner(models.Model):
_inherit= 'res.partner'
con_prenom = fields.Char(string="Prénom")
con_n_cin = fields.Char(string="N° CIN")2-模特/雇员
from odoo import models,fields
class HrEmployee(models.Model):
_inherit=['hr.employee']
em_prenom = fields.Char(string="Prénom")
em_matricule = fields.Char(string="Matricule")
em_cin = fields.Char(string="CIN")3-舱单.py
{
'name': 'Duplicated Contacts',
'version': '1.3',
'category': 'Hidden',
'description': """
Duplicated Contacts To Add Fields To Contact view.
===================================================
""",
'depends': [
'base',
'hr'
],
'data': [
'views/contact.xml',
'views/employee.xml',
],
'sequence':'-100',
'demo': [
],
'test': [],
'installable': True,
'auto_install': True,
'application': True,
'license': 'LGPL-3',
}4- init.py
from . import models5- models/init.py
from . import contact
from . import employee发布于 2022-10-25 15:44:36
如果没有日志,错误可能出现在这一行_inherit=['hr.employee']上,在这里,它应该读取不带括号的_inherit='hr.employee'。要使用括号,最后需要使用_inherits和s,但是仍然需要普通的_inherit,这完全是另一种情况。
https://stackoverflow.com/questions/74191977
复制相似问题