From 112bc6499a1c0816a2e6e1db4f0c88f5be9c8d48 Mon Sep 17 00:00:00 2001 From: niyasraphy Date: Tue, 25 Jul 2023 07:23:50 +0000 Subject: [PATCH] [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 --- .../work_entry_calendar/work_entry_calendar_controller.js | 1 + .../static/src/views/work_entry_hook.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/addons/hr_work_entry_contract/static/src/views/work_entry_calendar/work_entry_calendar_controller.js b/addons/hr_work_entry_contract/static/src/views/work_entry_calendar/work_entry_calendar_controller.js index 2b3acc05876..f3d9849a4b3 100644 --- a/addons/hr_work_entry_contract/static/src/views/work_entry_calendar/work_entry_calendar_controller.js +++ b/addons/hr_work_entry_contract/static/src/views/work_entry_calendar/work_entry_calendar_controller.js @@ -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; } diff --git a/addons/hr_work_entry_contract/static/src/views/work_entry_hook.js b/addons/hr_work_entry_contract/static/src/views/work_entry_hook.js index f34170ca9e9..b5df837b574 100644 --- a/addons/hr_work_entry_contract/static/src/views/work_entry_hook.js +++ b/addons/hr_work_entry_contract/static/src/views/work_entry_hook.js @@ -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: () => {