hr_holiday_workflow_policy/views/hr_holidays_views.xml
<?xml version="1.0" encoding="utf-8" ?>
<!-- Copyright 2017 OpenSynergy Indonesia
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -->
<openerp>
<data>
<record id="hr_holidays_request_view_form" model="ir.ui.view">
<field name="name">hr.holidays request form</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays.allocation_company_new" />
<field name="arch" type="xml">
<data>
<xpath expr="//button[@name='confirm']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','draft'),('confirm_ok','=',False)]}</attribute>
</xpath>
<xpath expr="//button[@name='validate']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','confirm'),('approve_ok','=',False)]}</attribute>
</xpath>
<xpath expr="//button[@name='refuse']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','not in',['draft','confirm','validate']),('refuse_ok','=',False)]}</attribute>
</xpath>
<xpath expr="//button[@name='reset']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','confirm'),('restart_ok','=',False)]}</attribute>
<attribute name="groups" />
</xpath>
<xpath expr="//field[@name='name']" position="after">
<group name="policy" colspan="4" col="2" groups="base.group_system">
<field name="confirm_ok" />
<field name="approve_ok" />
<field name="validate_ok" />
<field name="refuse_ok" />
<field name="restart_ok" />
</group>
</xpath>
</data>
</field>
</record>
<record id="hr_holidays_allocation_view_form" model="ir.ui.view">
<field name="name">hr.holidays allocation form</field>
<field name="model">hr.holidays</field>
<field name="inherit_id" ref="hr_holidays.edit_holiday_new" />
<field name="arch" type="xml">
<data>
<xpath expr="//button[@name='confirm']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','draft'),('confirm_ok','=',False)]}</attribute>
</xpath>
<xpath expr="//button[@name='validate']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','confirm'),('approve_ok','=',False)]}</attribute>
<attribute name="groups" />
</xpath>
<xpath expr="//button[@name='second_validate']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','!=','validate1'),('validate_ok','=',False)]}</attribute>
<attribute name="groups" />
</xpath>
<xpath expr="//button[@name='refuse']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','not in',['draft','confirm','valid']),('refuse_ok','=',False)]}</attribute>
<attribute name="groups" />
</xpath>
<xpath expr="//button[@name='reset']" position="attributes">
<attribute name="states" />
<attribute
name="attrs"
>{'invisible':['|',('state','not in',['confirm','refuse']),('restart_ok','=',False)]}</attribute>
<attribute name="groups" />
</xpath>
<xpath expr="//field[@name='notes']" position="after">
<group name="policy" colspan="4" col="2" groups="base.group_system">
<field name="confirm_ok" />
<field name="validate_ok" />
<field name="approve_ok" />
<field name="refuse_ok" />
<field name="restart_ok" />
</group>
</xpath>
</data>
</field>
</record>
</data>
</openerp>