我试图覆盖'创建'按钮' hr.employee'宾语。但是我收到了错误
类型错误:必须是type,而不是str
我的代码块如下所示
from openerp import models, fields,api
class hrEmployee(models.Model):
_inherit = "hr.employee"
def create(self, cr, uid, ids, context):
#Todo code
super('hr.employee', self).create(cr, uid, ids, context=context)
# return True
我不知道这里出了什么问题。 希望提出建议
答案 0 :(得分:6)
from openerp import models, fields,api
class hrEmployee(models.Model):
_inherit = "hr.employee"
@api.model
def create(self, values):
res_id = super(hrEmployee, self).create(values)
return res_id
答案 1 :(得分:2)
试试这个:
return super(hrEmployee, self).create(cr, uid, ids, context)