Hi,
I just updated Odoo Enterprise from v12 to v12.3. In v12 the Attendance application is linked to the manual_attendance boolean field from the Employee model.
The manual_attendance field has beind removed from Odoo v12.3. I have been trying to replicate this behaviour following this guide:
https://www.odoo.com/forum/help-1/question/how-to-assign-group-for-a-particular-employee-via-python-code-odoo11-148769
I created two boolean fields on the Employee Model (x_manual_attendance, x_manual_attendance_copy), x_manual_attendance_copy is dependend of x_manual_attendance and I added this python code:
Compute:
for rec in self:
if rec.x_manual_attendance:
your_group = self.env.ref('hr_attendance.group_hr_attendance_user')
users = self.env['res.users'].sudo().search([('name', '=', rec.resource_id.name)], limit=1)
for user in users:
your_group.write({'users': [(4, user.id)]})
rec['x_manual_attendance_copy'] = rec.x_manual_attendance
I'm getting this error:
Odoo Server Error
Error while validating constraint
maximum recursion depth exceeded while calling a Python object
I cannot figure out what is wrong. Some help please?