所以我试图在odoo中继承hr.employee,但是有一个错误,我不知道为什么,因为我像在教程中那样做。(链接到教程)
这是我的代码:在
员工.py
class Employee(models.Model):
""" Class Employee """
_inherit = 'hr.employee'
_description = 'A custom class of employee'
esia = fields.Float(digits=(12, 2))
cnaps = fields.Float(digits=(12, 2))
员工.xml
<record model="ir.ui.view" id="employee_form_view">
<field name="name">employee.form</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<notebook position="inside">
<page string="Sécurité Sociale">
<group>
<field name="cnaps"/>
<field name="esia"/>
</group>
</page>
</notebook>
</field>
</record>
<record model="ir.actions.act_window" id="employee_list_action">
<field name="name">Employees</field>
<field name="res_model">hr.employee</field>
<field name="view_mode">tree,form</field>
</record>
尝试升级模块时出现的错误是:
Invalid model name 'hr.employee' in action definition