[IMP]improve and clean hr_timesheet_sheet
authorSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Thu, 21 Jun 2012 09:56:46 +0000 (15:26 +0530)
committerSanjay Gohel (Open ERP) <sgo@tinyerp.com>
Thu, 21 Jun 2012 09:56:46 +0000 (15:26 +0530)
bzr revid: sgo@tinyerp.com-20120621095646-t6dv93hfv8x1jkww

addons/hr_holidays/hr_holidays_view.xml
addons/hr_timesheet_sheet/hr_timesheet_sheet_view.xml

index cd43704..66c0ec0 100644 (file)
                     <field name="state" widget="statusbar" statusbar_visible="draft,confirm,validate" statusbar_colors='{"confirm":"blue","validate1":"blue","refuse":"red"}'/>
                 </header>
                 <sheet string="Leave Request" layout="auto">
-                    <group col="8" colspan="4">
+                    <group col="4" colspan="4">
                     <field name="name" attrs="{'readonly':[('state','!=','draft'),('state','!=','confirm')]}"/>
+                    <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')],'invisible':[('holiday_type','=','employee')]}"/>
                     <field name="holiday_type" on_change="onchange_type(holiday_type)" attrs="{'readonly':[('state','!=','draft')]}" width="130" string="Mode" groups="base.group_hr_user"/>
-                    <group attrs="{'invisible':[('holiday_type','=','employee')]}">
-                        <field name="category_id" attrs="{'required':[('holiday_type','=','category')], 'readonly':[('state','!=','draft'), ('state','!=','confirm')]}"/>
-                        </group>
-                        <group attrs="{'invisible':[('holiday_type','=','category')]}">
-                        <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')]}" groups="base.group_hr_user"/>
-                        </group>
+                    <group>
+                        <field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
+                        <field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
+                        <field name="number_of_days_temp"/>
+                    </group>
+                    <field name="employee_id" attrs="{'required':[('holiday_type','=','employee')],'invisible':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
                     </group>
                     <notebook colspan="4">
                         <page string="General">
                             <field name="holiday_status_id" on_change="onchange_sec_id(holiday_status_id)" context="{'employee_id':employee_id}"/>
                             <field name="department_id" attrs="{'readonly':[('holiday_type','=','category')]}" groups="base.group_hr_user"/>
-                            <field name="date_from" on_change="onchange_date_from(date_to, date_from)" required="1"/>
-                            <field name="date_to" on_change="onchange_date_from(date_to, date_from)" required="1"/>
-                            <field name="number_of_days_temp"/>
                             <field name="double_validation" invisible="1"/>
                             <newline/>
                             <field name="manager_id" groups="base.group_no_one"/>
index 1486a34..e2f60eb 100644 (file)
                         From <field name="date_from" />
                         to <field name="date_to"/>
                     </h2>
-                    <group col="4">
-                        <field name="name" class="oe_edit_only"/>
-                        <field name="department_id" class="oe_edit_only"/>
-                        <field name="company_id" groups="base.group_multi_company" class="oe_edit_only"/>
-                        <field name="user_id" invisible="1" class="oe_edit_only"/>
+                    <group col="4" class="oe_edit_only">
+                        <field name="name"/>
+                        <field name="department_id"/>
+                        <field name="company_id" groups="base.group_multi_company"/>
+                        <field name="user_id" invisible="1"/>
                     </group>
                     <notebook>
                         <page string="Daily">
                                 <button name="date_today" string="Today" type="object" icon="terp-go-today"/>
                                 <button icon="terp-gtk-go-back-rtl" name="date_next" string="" type="object"/>
                             </group>
-
-                            <field colspan="3" context="{'name':date_current,'user_id':user_id}" height="100" name="attendances_ids" nolabel="1">
-                                <tree string="Attendances" editable="bottom">
-                                    <field name="name"/>
-                                    <field name="action"/>
-                                    <field invisible="1" name="employee_id"/>
-                                </tree>
-                            </field>
-                            <group col="4" colspan="1">
+                            <group colspan="4" col="3">
+                                <field context="{'name':date_current,'user_id':user_id}" name="attendances_ids" nolabel="1">
+                                    <tree string="Attendances" editable="bottom">
+                                        <field name="name"/>
+                                        <field name="action"/>
+                                        <field invisible="1" name="employee_id"/>
+                                    </tree>
+                                </field>
+                                <group colspan="2" col="2">
+                                    <button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr"/>
+                                    <button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl"/>
+                                </group>
+                            </group>
+                            
+                            <group col="4">
                                 <field name="state_attendance"/>
-                                <button name="sign_in" string="Sign In" type="object" icon="terp-gtk-jump-to-ltr"/>
-                                <button name="sign_out" string="Sign Out" type="object" icon="terp-gtk-jump-to-rtl"/>
-                                <field name="total_attendance_day" widget="float_time" colspan="4"/>
+                                <field name="total_attendance_day" widget="float_time"/>
                             </group>
                             <field colspan="4" context="{'date':date_current,'user_id':user_id}" domain="[('name','=',date_current)]" name="timesheet_ids" nolabel="1">
                                 <tree editable="top" string="Timesheet Lines">