如何修复此错误?
关键mydb2 openerp.modules.module:无法加载模块exp_edit
关键的mydb2 openerp.modules.module:unindent不匹配任何外部缩进级别(hredit.py,第61行)
我的py文件代码如下所示
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
emp_obj = self.pool.get('hr.employee')
first = False
if employee_id:
employee = emp_obj.browse(cr, uid, employee_id, context=context)
first = employee.first.id
return {'value': {'first': first}}
答案 0 :(得分:0)
请在提问前先做一些研究。这只是一个python缩进错误粘贴此代码。
def onchange_employee_id(self, cr, uid, ids, employee_id, context=None):
emp_obj = self.pool.get('hr.employee')
first = False
if employee_id:
employee = emp_obj.browse(cr, uid, employee_id, context=context) //unindent this line
first = employee.first.id
return {'value': {'first': first}}