From 82c9e8f85c53e62d67450242f07a6c36d3d5ff3f Mon Sep 17 00:00:00 2001 From: Leonardo Pavan Rocha Date: Wed, 25 Oct 2023 14:40:24 +0200 Subject: [PATCH] [FIX] hr_homeworking: fix homeworking button not clickable in week scale https://github.com/odoo/odoo/pull/138670 changed how the set location buttons look, however this change started causing the button not to be clickable. This commit fixes this issue. Also we change the button text from "add location" to "set location". On top of that, the "set location" button takes too much space, creating a big gap between the date and the events for that day. To make the gap smaller, we reduced the size of the button. task-3570053 Part-of: odoo/odoo#139736 --- .../static/src/calendar/common/calendar_common_renderer.js | 2 +- .../src/calendar/common/calendar_common_renderer.scss | 4 +--- .../static/src/calendar/common/calender_common_renderer.xml | 6 +++--- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.js b/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.js index 7c4c4f66558..c49b35711ea 100644 --- a/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.js +++ b/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.js @@ -93,7 +93,7 @@ patch(AttendeeCalendarCommonRenderer.prototype, { onDayRender(info){ const parsedDate = DateTime.fromJSDate(info.date).toISODate(); if (this.props.model.scale === 'week' || this.props.model.scale === 'day'){ - const button = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] o_worklocation_text`) + const button = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] .o_worklocation_text`) const line = info.view.context.calendar.el.querySelector(`.fc-day-header[data-date='${parsedDate}'] .o_worklocation_line`) if (!button || !line) return; diff --git a/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.scss b/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.scss index c3e78ad3657..fdb883f763c 100644 --- a/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.scss +++ b/addons/hr_homeworking/static/src/calendar/common/calendar_common_renderer.scss @@ -1,12 +1,10 @@ .o_worklocation_btn { - margin: 2px; - .o_worklocation_text, .o_worklocation_line { box-shadow: 0 1px 0 rgba(0,0,0, 0.3) } .o_worklocation_text { - font-size: $o-font-size-base-smaller; + font-size: o-to-rem(10px); } } diff --git a/addons/hr_homeworking/static/src/calendar/common/calender_common_renderer.xml b/addons/hr_homeworking/static/src/calendar/common/calender_common_renderer.xml index ac6121c9e19..0d6b7f8502c 100644 --- a/addons/hr_homeworking/static/src/calendar/common/calender_common_renderer.xml +++ b/addons/hr_homeworking/static/src/calendar/common/calender_common_renderer.xml @@ -38,12 +38,12 @@ -
+
-