[FIX] hr_work_entry_contract: avoid infinite reload
Versions:
---------
- 16.0
- saas-16.1
Issue:
------
In the Payroll module, in the Gantt view of work entries,
when a work entry is deleted, the wizard doesn't close.
Cause:
------
When we go to the Gantt view of work entries, we trigger
the function `_generateWorkEntries` (because we trigger an update at `start`).
An RPC call will be made, and the response will be the new work entries
that have been generated in string format (`'hr.work.entry()'`).
This response will always be interpreted as `true` in an if condition.
If there are new work entries, a reload is triggered,
leaving no time to close the wizard.
These steps are repeated
and we are "stuck" in an infinite loop.
Note:
The problem doesn't occur in the calendar view,
as a hook is provided for this purpose
and we will trigger the `generateWorkEntries` function
which won't have a reload effect if work entry has been generated.
Solution:
---------
Create a method that returns an array with
the ids of the new work entries generated.
This response will be more easily interpreted by the frontend
to decide whether or not we have to reload the page.
opw-3504435
closes odoo/odoo#136101
Signed-off-by:
Sofie Gvaladze (sgv) <sgv@odoo.com>
Please register or sign in to comment