diff --git a/addons/hr_holidays/models/hr_leave_type.py b/addons/hr_holidays/models/hr_leave_type.py
index 43f89924158..618c8a3bf19 100644
--- a/addons/hr_holidays/models/hr_leave_type.py
+++ b/addons/hr_holidays/models/hr_leave_type.py
@@ -291,6 +291,8 @@ class HolidaysType(models.Model):
'max_leaves': ('%.2f' % self.max_leaves).rstrip('0').rstrip('.'),
'leaves_taken': ('%.2f' % self.leaves_taken).rstrip('0').rstrip('.'),
'virtual_leaves_taken': ('%.2f' % self.virtual_leaves_taken).rstrip('0').rstrip('.'),
+ 'leaves_requested': ('%.2f' % (self.max_leaves - self.virtual_remaining_leaves - self.leaves_taken)).rstrip('0').rstrip('.'),
+ 'leaves_approved': ('%.2f' % self.leaves_taken).rstrip('0').rstrip('.'),
'request_unit': self.request_unit,
'icon': self.sudo().icon_id.url,
}, self.requires_allocation, self.id)
diff --git a/addons/hr_holidays/static/src/js/time_off_calendar.js b/addons/hr_holidays/static/src/js/time_off_calendar.js
index d0e2daa56de..57d91e21fd7 100644
--- a/addons/hr_holidays/static/src/js/time_off_calendar.js
+++ b/addons/hr_holidays/static/src/js/time_off_calendar.js
@@ -208,6 +208,27 @@ odoo.define('hr_holidays.dashboard.view_custo', function(require) {
timeoffs: result,
});
self.$el.before(elem);
+
+ //add popover to the information tags
+ _.each(self.$el.parent().find('.fa-question-circle-o'), function(popup){
+ $(popup).popover({
+ trigger: 'hover',
+ html: true,
+ delay: {show: 300, hide: 0},
+ content: function () {
+ var data = {
+ allocated: popup.dataset.allocated,
+ approved: popup.dataset.approved,
+ planned: popup.dataset.planned,
+ left: popup.dataset.left
+ };
+ var elem_popover = QWeb.render('hr_holidays.dashboard_calendar_header_leave_type_popover', {
+ data: data,
+ });
+ return elem_popover
+ },
+ });
+ });
}
}
});
diff --git a/addons/hr_holidays/static/src/scss/time_off.scss b/addons/hr_holidays/static/src/scss/time_off.scss
index a85a6cad423..7ceeadab7e0 100644
--- a/addons/hr_holidays/static/src/scss/time_off.scss
+++ b/addons/hr_holidays/static/src/scss/time_off.scss
@@ -82,3 +82,17 @@
}
}
}
+
+.o_timeoff_dashboard_popover{
+
+ hr{
+ margin-top: 0px;
+ margin-bottom: 0px
+ }
+
+ ul{
+ list-style: none;
+ padding-left: 0;
+ margin:0px;
+ }
+}
diff --git a/addons/hr_holidays/static/src/xml/time_off_calendar.xml b/addons/hr_holidays/static/src/xml/time_off_calendar.xml
index a4b9d8e365b..e1c48ec96ac 100644
--- a/addons/hr_holidays/static/src/xml/time_off_calendar.xml
+++ b/addons/hr_holidays/static/src/xml/time_off_calendar.xml
@@ -14,6 +14,7 @@
![]()
HOURSDAYS AVAILABLE
+
![]()
@@ -24,6 +25,18 @@
+
+
+
+ - Allocated:
+ - Approved:
+ - Planned:
+
+ - Left:
+
+
+
+