[FIX] hr_payroll: do not display conflicting leave button when no type

Basically you can have two types of error when using benefits, the
conflicting leave error and the no benefit type set error.
You can have either one of them or both of them at the same time.

The problem is that when there is an error, we currently have no way of
knowing which error it is.

To resolve this we only display one error at a time starting with the
no benefit type error and then if there is a conflicting leave we
display the next error

closes odoo/odoo#30259
This commit is contained in:
RomainLibert
2019-01-16 12:47:47 +00:00
parent dad7d80a93
commit 2f526dcd65
+2 -2
View File
@@ -67,7 +67,7 @@ if records:
<header>
<field name="display_warning" invisible="1"/>
<field name="leave_id" invisible="1"/>
<button string="Go To Conflicting Leave" name="action_leave" type="object" attrs="{'invisible': ['|', '!',('display_warning', '=', True), '!', ('leave_id', '!=', False)]}"/>
<button string="Go To Conflicting Leave" name="action_leave" type="object" attrs="{'invisible': ['|', '|', '!',('display_warning', '=', True), '!', ('leave_id', '!=', False), ('benefit_type_id', '=', False)]}"/>
<field name="state" widget="statusbar" options="{'clickable': '1'}"/>
</header>
<sheet>
@@ -160,4 +160,4 @@ if records:
sequence="25"
/>
</odoo>
</odoo>