1
votes

When I click on the hr_attendance icon, this message appears:

The operation cannot be completed, probably due to the following:
- deletion: you may be trying to delete a record while other records still reference it
- creation/update: a mandatory field is not correctly set
[object with reference: employee_id - employee.id]

Going to the attendance.js, I put a lot of console.logs and I realized that inside the 'do_update_attendance' function, the variable self.employee_id is undefined, but this is the official code (I didn't changed anything).

Is this a bug or I have to modify some code?

1
i've tested it on latest possible odoo 9 runbot with admin and demo (demo has to be configured for attendances) and it worked without problems.CZoellner
@MouTio have you altered the records in the database?danidee
From experience i've noticed that this is always a database Integrity error, but it's not always the case, when you hit the button the next time and the error comes up, check the server logs and paste them here for us to seedanidee
@MouTio you need to set "Attendances" under user accesses to see the little button on an userCZoellner
employee_id on the INSERT is NULL, i bet it's a required field because the would be logical. I think you need to set an employee on the user itself or you need to set a user on an employee to use this feature.CZoellner

1 Answers

2
votes

Fixed it doing these steps for a new user:

  1. Log in as administrator

  2. Employees > Employees > Create button (Fill the name)

  3. Select the "HR Settings" tab > Related User -> Create and edit (Fill the name and email).

  4. Save the user and save the employee.

  5. Go to Developer mode (User menu > About > Activate the developer mode)

  6. Settings > User > Select the new created user > Edit > Mark the option "Attendances"

  7. Save the user.

Now it works :)