所以我试图在odoo中继承hr.employee,但是由于我像在教程中那样进行操作,所以我不知道为什么会出错。 (Link to the tutorial)
这是我的代码:
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))
employees.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