[FIX] hr_work_entry_contract: reload calender from regenerate work entries

before this commit, if user try to regenerate the work entries
from the button 'Regenerate Work Entries' in the work entries
calendar view, the generated entries will not shown to the
user immediately without reloading the screen.

* payroll -> work entries -> work entries
* switch to calendar view
* click on Regenerate Work Entries button
* select employee's and click Regenerate Work Entries
* generated work entries will not be shown in calendar

after this commit, the generated work entries will be shown
in the calendar immediately.

closes odoo/odoo#129647

X-original-commit: 1ea504e6ee794be7513d8de20304527261548849
Signed-off-by: Kevin Baptiste <kba@odoo.com>
This commit is contained in:
niyasraphy
2023-07-26 09:22:17 +02:00
parent 0f0fc727da
commit 112bc6499a
2 changed files with 3 additions and 2 deletions
@@ -12,6 +12,7 @@ export class WorkEntryCalendarController extends CalendarController {
const { onRegenerateWorkEntries } = useWorkEntry({
getEmployeeIds: this.getEmployeeIds.bind(this),
getRange: this.model.computeRange.bind(this.model),
onClose: this.model.load.bind(this.model)
});
this.onRegenerateWorkEntries = onRegenerateWorkEntries;
}
@@ -3,7 +3,7 @@
import { serializeDate } from "@web/core/l10n/dates";
import { useService } from "@web/core/utils/hooks";
export function useWorkEntry({ getEmployeeIds, getRange }) {
export function useWorkEntry({ getEmployeeIds, getRange, onClose}) {
const orm = useService("orm");
const action = useService("action");
@@ -15,7 +15,7 @@ export function useWorkEntry({ getEmployeeIds, getRange }) {
default_employee_ids: getEmployeeIds(),
date_start: serializeDate(start),
date_end: serializeDate(end),
}
}, onClose: onClose
});
},
generateWorkEntries: () => {