Skip to content

Commit

Permalink
fixup! [ADD] allow adding calendar links to time off calendar, defaul…
Browse files Browse the repository at this point in the history
…t icals
  • Loading branch information
hbrunn committed Sep 25, 2023
1 parent 0fdbe99 commit d9b765d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 16 deletions.
24 changes: 8 additions & 16 deletions verdigado_attendance/data/base_ical.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,10 @@
<field name="model_id" ref="hr_holidays.model_hr_leave" />
<field name="domain">[('user_id', '=', user.id)]</field>
<field name="expression_uid">str(record.id)</field>
<field name="expression_dtstart">
(record.request_unit_half or record.request_unit_hours) and record.date_from
or record.date_from.date()
</field>
<field name="expression_dtend">
(record.request_unit_half or record.request_unit_hours) and record.date_to
or (record.date_to.date() + timedelta(days=1))
</field>
<!-- prettier-ignore-start -->
<field name="expression_dtstart">(record.request_unit_half or record.request_unit_hours) and record.date_from or record.date_from.date()</field>
<field name="expression_dtend">(record.request_unit_half or record.request_unit_hours) and record.date_to or (record.date_to.date() + timedelta(days=1))</field>
<!-- prettier-ignore-end -->
<field name="expression_summary">record.name</field>
<field name="auto" eval="True" />
<field name="show_on_holiday_calendar" eval="True" />
Expand All @@ -25,14 +21,10 @@
user.employee_id.department_id.id), ('user_id', '!=', user.id)]
</field>
<field name="expression_uid">str(record.id)</field>
<field name="expression_dtstart">
(record.request_unit_half or record.request_unit_hours) and record.date_from
or record.date_from.date()
</field>
<field name="expression_dtend">
(record.request_unit_half or record.request_unit_hours) and record.date_to
or (record.date_to.date() + timedelta(days=1))
</field>
<!-- prettier-ignore-start -->
<field name="expression_dtstart">(record.request_unit_half or record.request_unit_hours) and record.date_from or record.date_from.date()</field>
<field name="expression_dtend">(record.request_unit_half or record.request_unit_hours) and record.date_to or (record.date_to.date() + timedelta(days=1))</field>
<!-- prettier-ignore-end -->
<field name="expression_summary">record.name</field>
<field name="auto" eval="True" />
<field name="show_on_holiday_calendar" eval="True" />
Expand Down
2 changes: 2 additions & 0 deletions verdigado_attendance/static/src/js/time_off_calendar.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ odoo.define("verdigado_attendance.time_off_calendar", function (require) {
if (ical_calendars.length === 0) {
$links.hide();
} else {
$links.children("a").remove();
$links.children("br").remove();
_.chain(ical_calendars)
.filter("user_active")
.each(function (ical) {
Expand Down

0 comments on commit d9b765d

Please sign in to comment.