[FIX] hr_holidays: date_from, date_to required in form view only for leave requests...
authorThibault Delavallée <tde@openerp.com>
Fri, 13 Jun 2014 07:25:48 +0000 (09:25 +0200)
committerThibault Delavallée <tde@openerp.com>
Fri, 13 Jun 2014 07:25:48 +0000 (09:25 +0200)
addons/hr_holidays/hr_holidays_view.xml

index c39adcb..7c5db33 100644 (file)
                 <sheet string="Leave Request">
                     <group>
                         <group>
+                            <field name="type" invisible="1"/>
                             <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
                             <field name="holiday_status_id" context="{'employee_id':employee_id}"/>
                             <label for="number_of_days_temp" string="Duration" help="The default duration interval between the start date and the end date is 8 hours.  Feel free to adapt it to your needs."/>
                             <div>
                                 <group col="3">
-                                    <field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)" required="1" class="oe_inline"/><label string="-" class="oe_inline"/>
-                                    <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)" required="1" class="oe_inline"/>
+                                    <field name="date_from" nolabel="1" on_change="onchange_date_from(date_to, date_from)"
+                                        attrs="{'required': [('type', '=', 'remove')]}" class="oe_inline"/><label string="-" class="oe_inline"/>
+                                    <field name="date_to" nolabel="1" on_change="onchange_date_to(date_to, date_from)"
+                                        attrs="{'required': [('type', '=', 'remove')]}" class="oe_inline"/>
                                 </group>
                                 <div>
                                     <field name="number_of_days_temp" class="oe_inline"/> days