From f85aab4edfb5bf8c58f4df7b627534c3749ca6f2 Mon Sep 17 00:00:00 2001 From: Laetitia Da Costa Date: Thu, 30 Jan 2025 12:09:34 +0100 Subject: [PATCH] [IMP]allow_negative_leave_and_allocation:display negative holidays in dashbaord --- allow_negative_leave_and_allocation/__manifest__.py | 7 ++++++- .../models/hr_leave_type.py | 5 +++++ .../static/src/xml/time_off_card.xml | 9 +++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml diff --git a/allow_negative_leave_and_allocation/__manifest__.py b/allow_negative_leave_and_allocation/__manifest__.py index 34e765e..2c4044e 100644 --- a/allow_negative_leave_and_allocation/__manifest__.py +++ b/allow_negative_leave_and_allocation/__manifest__.py @@ -3,7 +3,7 @@ { "name": "allow_negative_leave_and_allocation", - "version": "16.0.1.0.0", + "version": "16.0.1.0.1", "author": "Elabore", "website": "https://elabore.coop", "maintainer": "Elabore", @@ -23,6 +23,11 @@ "views/hr_leave_type_views.xml", "views/hr_leave_views.xml", ], + "assets": { + 'web.assets_backend': [ + 'allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml', + ], + }, # only loaded in demonstration mode "demo": [], "js": [], diff --git a/allow_negative_leave_and_allocation/models/hr_leave_type.py b/allow_negative_leave_and_allocation/models/hr_leave_type.py index d810e1d..e90d35c 100644 --- a/allow_negative_leave_and_allocation/models/hr_leave_type.py +++ b/allow_negative_leave_and_allocation/models/hr_leave_type.py @@ -18,3 +18,8 @@ class HolidaysType(models.Model): for holiday_type in res: if not holiday_type.has_valid_allocation: holiday_type.has_valid_allocation = holiday_type.allows_negative + + def _get_days_request(self): + res = super()._get_days_request() + res[1]['allows_negative'] = self.allows_negative + return res diff --git a/allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml b/allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml new file mode 100644 index 0000000..f0bf77c --- /dev/null +++ b/allow_negative_leave_and_allocation/static/src/xml/time_off_card.xml @@ -0,0 +1,9 @@ + \ No newline at end of file