[IMP] hr_holidays: Add expiration date in dashboard

closes odoo/odoo#44669

Taskid: 2166745
Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
This commit is contained in:
jbm-odoo
2020-02-07 08:39:15 +00:00
parent 2d470a423f
commit dd37b849d8
3 changed files with 6 additions and 3 deletions
@@ -391,7 +391,7 @@ class HolidaysAllocation(models.Model):
today = fields.Date.today()
if vstop < today:
raise ValidationError(_('You can allocate %s only before %s') % (allocation.holiday_status_id.display_name, allocation.holiday_status_id.validity_stop))
raise ValidationError(_('You can allocate %s only before %s.') % (allocation.holiday_status_id.display_name, allocation.holiday_status_id.validity_stop))
@api.model
def create(self, values):
+1 -1
View File
@@ -241,7 +241,7 @@ class HolidaysType(models.Model):
'max_leaves': ('%.2f' % lt.max_leaves).rstrip('0').rstrip('.'),
'leaves_taken': ('%.2f' % lt.leaves_taken).rstrip('0').rstrip('.'),
'request_unit': lt.request_unit,
}, lt.allocation_type)
}, lt.allocation_type, lt.validity_stop)
for lt in leave_types]
def _get_contextual_employee_id(self):
@@ -22,7 +22,10 @@
<b><span t-esc="timeoff[0]" class="o_timeoff_name"/></b>
<span class="mb-4" t-if="need_allocation"><span t-attf-class="mr-1 font-weight-bold {{ cl }}" t-esc="timeoff[1]['remaining_leaves']"/><span>remaining</span></span>
<span class="mb-4" t-if="need_allocation">
<span t-attf-class="mr-1 font-weight-bold {{ cl }}" t-esc="timeoff[1]['remaining_leaves']"/><span>remaining</span>
<t t-if="timeoff[3]"> (Expire on <span t-esc="moment(timeoff[3]).format('L')"/>)</t>
</span>
</div>
</div>
</t>