Python 重写Odoo中的Create函数
我试图覆盖“hr.employee”对象中的“创建”按钮。但我得到了错误 类型错误:必须是类型,而不是str 我的代码清单如下所示Python 重写Odoo中的Create函数,python,python-2.7,odoo,openerp-7,Python,Python 2.7,Odoo,Openerp 7,我试图覆盖“hr.employee”对象中的“创建”按钮。但我得到了错误 类型错误:必须是类型,而不是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.
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
我不知道这里出了什么问题。
希望得到建议试试这个:
return super(hrEmployee, self).create(cr, uid, ids, context)
试试这个:
return super(hrEmployee, self).create(cr, uid, ids, context)
以同样的方式,如何覆盖odoo 9中的写入方法以同样的方式,如何覆盖odoo 9中的写入方法