定时任务代码如下:
records = env['hr.employee'].search(cr, 1, [('active', '=', True)])
for record in records:
employee = env['hr.employee'].browse(cr, 1, record)
if employee:
if employee.category_ids:
employee.write(
定时任务代码如下:
records = env ['hr.employee'] .search(cr, 1, [('active', '=', True)] )
for record in records:
employee = env ['hr.employee'] .browse(cr, 1, record)
if employee:
if employee.category_ids:
employee.write(
{'x_emp_label': employee.category_ids.ids[0]}
)