summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHelly kapatel <hpl@odoo.com>2020-03-13 09:41:47 +0000
committerBarad Mahendra <mba@openerp.com>2020-03-25 13:46:11 +0000
commite4ebd3e6e3223df2c75ce26beb98b829b5442f7d (patch)
tree4023a5126e73b010340a96649377827c9a1c126e
parentad69cc13d3f4cdb3565b937b2331c7a7fd50c61d (diff)
[IMP] hr_holidays: show the initial duration while the accrual is selected
Purpose of the task is, when the accrual is selected, the field for duration is hidden but the feature allows to use it. So in this commit,when accrual is selected, display number of days (duration) to provide an intial allocation while accrual is selected. Also change label and tooltip according to allocation type. closes odoo/odoo#48354 Taskid: 2199324 Closes: #47598 X-original-commit: 74df5cbaf37d3cc6da0b15efa9d7f4a4ec265ec5 Signed-off-by: Yannick Tivisse (yti) <yti@odoo.com>
-rw-r--r--addons/hr_holidays/i18n/hr_holidays.pot12
-rw-r--r--addons/hr_holidays/models/hr_leave_allocation.py4
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml7
3 files changed, 15 insertions, 8 deletions
diff --git a/addons/hr_holidays/i18n/hr_holidays.pot b/addons/hr_holidays/i18n/hr_holidays.pot
index fe272f2c958..c7e4a0f87a9 100644
--- a/addons/hr_holidays/i18n/hr_holidays.pot
+++ b/addons/hr_holidays/i18n/hr_holidays.pot
@@ -1276,6 +1276,12 @@ msgid "Duration"
msgstr ""
#. module: hr_holidays
+#: model_terms:ir.ui.view,arch_db:hr_holidays.hr_leave_allocation_view_form
+#: model_terms:ir.ui.view,arch_db:hr_holidays.hr_leave_view_form
+msgid "Extra days"
+msgstr ""
+
+#. module: hr_holidays
#: model:ir.model.fields,field_description:hr_holidays.field_hr_leave__number_of_days
msgid "Duration (Days)"
msgstr ""
@@ -2805,15 +2811,13 @@ msgstr ""
#. module: hr_holidays
#: model:ir.model.fields,help:hr_holidays.field_hr_leave_allocation__number_of_days_display
msgid ""
-"UX field allowing to see and modify the allocation duration, computed in "
-"days."
+"If Accrual Allocation: Number of days allocated in addition to the ones you will get via the accrual' system."
msgstr ""
#. module: hr_holidays
#: model:ir.model.fields,help:hr_holidays.field_hr_leave_allocation__number_of_hours_display
msgid ""
-"UX field allowing to see and modify the allocation duration, computed in "
-"hours."
+"If Accrual Allocation: Number of hours allocated in addition to the ones you will get via the accrual' system."
msgstr ""
#. module: hr_holidays
diff --git a/addons/hr_holidays/models/hr_leave_allocation.py b/addons/hr_holidays/models/hr_leave_allocation.py
index f4143fec516..b5c07f5d2ee 100644
--- a/addons/hr_holidays/models/hr_leave_allocation.py
+++ b/addons/hr_holidays/models/hr_leave_allocation.py
@@ -77,10 +77,10 @@ class HolidaysAllocation(models.Model):
number_of_days_display = fields.Float(
'Duration (days)', compute='_compute_number_of_days_display',
states={'draft': [('readonly', False)], 'confirm': [('readonly', False)]},
- help="UX field allowing to see and modify the allocation duration, computed in days.")
+ help="If Accrual Allocation: Number of days allocated in addition to the ones you will get via the accrual' system.")
number_of_hours_display = fields.Float(
'Duration (hours)', compute='_compute_number_of_hours_display',
- help="UX field allowing to see and modify the allocation duration, computed in hours.")
+ help="If Accrual Allocation: Number of hours allocated in addition to the ones you will get via the accrual' system.")
duration_display = fields.Char('Allocated (Days/Hours)', compute='_compute_duration_display',
help="Field allowing to see the allocation duration in days or hours depending on the type_request_unit")
# details
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
index 64a6db5c833..68212af9c7f 100644
--- a/addons/hr_holidays/views/hr_leave_allocation_views.xml
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -91,8 +91,11 @@
<field name="allocation_type" invisible="1" widget="radio"/>
<field name="number_of_days" invisible="1"/>
- <label for="number_of_days" string="Duration" attrs="{'invisible': [('allocation_type', '=', 'accrual')]}"/>
- <div attrs="{'invisible': [('allocation_type', '=', 'accrual')]}">
+ <div class="o_td_label">
+ <label for="number_of_days" string="Duration" attrs="{'invisible': [('allocation_type', '=', 'accrual')]}"/>
+ <label for="number_of_days" string="Extra days" attrs="{'invisible': [('allocation_type', '!=', 'accrual')]}"/>
+ </div>
+ <div>
<field name="number_of_days_display" class="oe_inline" nolabel="1"
attrs="{'readonly': ['|', ('type_request_unit', '=', 'hour'), ('state', 'not in', ('draft', 'confirm'))], 'invisible': [('type_request_unit', '=', 'hour')]}"/>
<field name="number_of_hours_display" class="oe_inline" nolabel="1"