[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#61079

X-original-commit: 80926f582d88aae359a6b35ea521026a3804ce00
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Signed-off-by: Achraf <abz-odoo@users.noreply.github.com>
This commit is contained in:
Achraf (abz)
2020-10-30 16:40:25 +00:00
parent 0edf1ce246
commit 69e3f42bbc
2 changed files with 3 additions and 3 deletions
@@ -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>
+1 -1
View File
@@ -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"/>