我正在尝试使用员工的onchange函数获取CTC,具体取决于hr.employee中选定的用户,并且已遵循上述方法但结果未反映可以帮助我解决这个问题
def get_emp_ctc(self, cr, uid, ids, user_id, context=None):
v={}
if user_id:
employee = self.pool.get('hr.employee').browse(cr, uid, user_id, context=context)
if employee.nf_ctc.id:
v['emp_ctc'] = employee.nf_ctc and employee.nf_ctc.id or False
return {'value': v}