summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAchraf (abz) <abz@odoo.com>2020-10-30 10:00:25 +0000
committerAchraf (abz) <abz@odoo.com>2020-10-30 14:18:11 +0000
commit80926f582d88aae359a6b35ea521026a3804ce00 (patch)
tree1c5068d82cdf1c4542dd8cfa6e654b992ae4e5f3
parent4ec26d985f33e1fa391c312b89fc611b8d688c96 (diff)
[FIX] hr_holidays: Refuse approved time off
Issue - Install "Time Off" - Create new time off and approve it We can no longer refuse it Cause The refuse button is invisible if the status is not equal to 'validate', in this case it is equal to 'validate1' Solution Change the attrs to display the refuse button when the status is 'validate1' opw-2361929 closes odoo/odoo#61033 Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
-rw-r--r--addons/hr_holidays/views/hr_leave_allocation_views.xml4
-rw-r--r--addons/hr_holidays/views/hr_leave_views.xml2
2 files changed, 3 insertions, 3 deletions
diff --git a/addons/hr_holidays/views/hr_leave_allocation_views.xml b/addons/hr_holidays/views/hr_leave_allocation_views.xml
index abcd5393fbf..edf8a232401 100644
--- a/addons/hr_holidays/views/hr_leave_allocation_views.xml
+++ b/addons/hr_holidays/views/hr_leave_allocation_views.xml
@@ -133,8 +133,8 @@
<button string="Approve" name="action_approve" states="confirm" type="object" class="oe_highlight"
attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', '!=', 'confirm')]}"/>
<button string="Validate" name="action_validate" states="validate1" type="object" class="oe_highlight"/>
- <button string="Refuse" name="action_refuse" states="confirm,validate,validate1" type="object"
- attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1'))]}"/>
+ <button string="Refuse" name="action_refuse" type="object"
+ attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1','validate'))]}"/>
<button string="Mark as Draft" name="action_draft" type="object"
attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
</xpath>
diff --git a/addons/hr_holidays/views/hr_leave_views.xml b/addons/hr_holidays/views/hr_leave_views.xml
index 721053a2d5f..20e9675bc2d 100644
--- a/addons/hr_holidays/views/hr_leave_views.xml
+++ b/addons/hr_holidays/views/hr_leave_views.xml
@@ -202,7 +202,7 @@
<button string="Confirm" name="action_confirm" states="draft" type="object" class="oe_highlight"/>
<button string="Approve" name="action_approve" type="object" class="oe_highlight" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', '!=', 'confirm')]}"/>
<button string="Validate" name="action_validate" states="validate1" type="object" groups="hr_holidays.group_hr_holidays_manager" class="oe_highlight"/>
- <button string="Refuse" name="action_refuse" type="object" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1'))]}"/>
+ <button string="Refuse" name="action_refuse" type="object" attrs="{'invisible': ['|', ('can_approve', '=', False), ('state', 'not in', ('confirm','validate1','validate'))]}"/>
<button string="Mark as Draft" name="action_draft" type="object"
attrs="{'invisible': ['|', ('can_reset', '=', False), ('state', 'not in', ['confirm', 'refuse'])]}"/>
<field name="state" widget="statusbar" statusbar_visible="confirm,validate"/>