[MERGE] merge with latest stable
[odoo/odoo.git] / addons / hr_payroll / hr_payroll_view.xml
index 430c548..78b9da0 100644 (file)
@@ -2,9 +2,10 @@
 <openerp>
     <data>
         <!-- Root Menus -->
-        <menuitem id="menu_hr_root_payroll" parent="hr.menu_hr_root" name="Payroll"/>
+        <menuitem id="menu_hr_root_payroll" parent="hr.menu_hr_root" name="Payroll" sequence="9"/>
         <menuitem id="payroll_configure" parent="hr.menu_hr_configuration" name="Payroll"/>
-        
+        <menuitem id="menu_hr_payroll_reporting" parent="hr.menu_hr_reporting" name="Payroll" groups="base.group_hr_manager"/>
+
         <!-- Passport Views    -->
         <record id="hr_passport_form" model="ir.ui.view">
             <field name="name">hr.passport.form</field>
@@ -14,7 +15,7 @@
                 <form string="Passport">
                     <group col="6" colspan="4">
                         <field name="name" select="1" colspan="4"/>
-                        <field name="employee_id" select="1"/>
+                        <field name="employee_id" />
                     </group>
                     <group col="2" colspan="2">
                         <separator string="Country &amp; Address" colspan="4"/>
                             <separator string="Description" colspan="2"/>
                             <field name="note" colspan="4" nolabel="1"/>
                         </page>
-                        <page string="Contracts">
-                            <field name="contracts_ids" colspan="4" nolabel="1"/>
-                        </page>
                     </notebook>
                 </form>
             </field>
         </record>
-         <record id="hr_passport_tree" model="ir.ui.view">
+        <record id="hr_passport_tree" model="ir.ui.view">
             <field name="name">hr.passport.tree</field>
             <field name="model">hr.passport</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
                 <tree string="Passport">
-                    <field name="name" select="1"/>
-                    <field name="employee_id" select="1"/>
-                    <field name="country_id" select="1"/>
-                    <field name="date_expire" select="1"/>
-                    <field name="date_expire" select="1"/>
+                    <field name="name" />
+                    <field name="employee_id" />
+                    <field name="address_id"/>
+                    <field name="country_id" />
+                    <field name="date_expire"/>
+                    <field name="date_issue" />
                 </tree>
             </field>
         </record>
+
+        <record id="view_hr_passport_filter" model="ir.ui.view">
+            <field name="name">hr.passport.select</field>
+            <field name="model">hr.passport</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Passport">
+                    <group col="8" colspan="4">
+                        <field name="name"/>
+                        <field name="employee_id"/>
+                        <field name="country_id"/>
+                        <field name="address_id"/>
+                    </group>
+                    <newline/>
+                    <group col="8" colspan="4" expand="0" string="Group By...">
+                        <filter string="Employees" icon="terp-partner" name="employee_id" context="{'group_by':'employee_id'}"/>
+                        <filter string="Country" name="country_id" icon="terp-go-home" context="{'group_by':'country_id'}"/>
+                        <filter string="Expire" name="date_expire" icon="terp-go-month" context="{'group_by':'date_expire'}"/>
+                        <filter string="Issue" name="date_issue" icon="terp-go-month" context="{'group_by':'date_issue'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
         <record id="action_hr_passport_tree" model="ir.actions.act_window">
             <field name="name">All Passports</field>
             <field name="res_model">hr.passport</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="hr_passport_tree"/>
+            <field name="search_view_id" ref="view_hr_passport_filter"/>
         </record>
-        <menuitem id="passport_configure" parent="hr.menu_hr_configuration" name="Passport"/>
-        <menuitem
-            id="menu_action_hr_passport_tree" 
-            action="action_hr_passport_tree" 
-            parent="passport_configure" 
-        />
         <!-- End Passport Views -->
-        
+
         <!-- Employee View -->
         <record id="hr_contract.hr_hr_employee_view_form2" model="ir.ui.view">
             <field name="name">hr.hr.employee.view.form2</field>
             <field name="model">hr.employee</field>
             <field name="inherit_id" ref="hr.view_employee_form"/>
             <field name="arch" type="xml">
-                <notebook position="inside">
-                    <page string="Contracts">
-                        <field colspan="4" mode="form,tree" name="contract_ids" nolabel="1">
-                            <tree string="Contracts">
-                                <field name="name"/>
-                                <field name="job_id"/>
-                                <field name="date_start"/>
-                                <field name="date_end"/>
-                                <field name="working_hours"/>
-                                <field name="wage_type_id"/>
-                                <field name="wage"/>
-                            </tree>
-                            <form string="Contract">
-                                <group colspan="4" col="6">
-                                    <field name="name" select="1"/>
-                                    <field name="job_id"/>
-                                    <newline/>
-                                    <field name="wage"/>
-                                    <field name="wage_type_id" widget="selection"/>
-                                    <field name="type_id" widget="selection"/>
-                                </group>
-                                <notebook colspan="4">
-                                    <page string="Main Data">
-                                        <group col="2" colspan="2">
-                                            <separator colspan="2" string="Duration"/>
-                                            <field name="date_start" select="1"/>
-                                            <field name="date_end" select="1"/>
-                                            <field name="working_hours"/>
-                                        </group>
-                                        <group col="2" colspan="2">
-                                            <separator colspan="2" string="Advantages"/>
-                                            <field name="struct_id" select="1"/>
-                                            <field name="advantages_net"/>
-                                            <field name="advantages_gross"/>
-                                            <field name="advantages" nolabel="1" colspan="2"/>
-                                        </group>
-                                    </page>
-                                    <page string="Work Permit">
-                                        <group col="2" colspan="2">
-                                            <separator colspan="2" string="Passport"/>
-                                            <field name="passport_id"/>
-                                        </group>
-                                        <group col="2" colspan="2">
-                                            <separator colspan="2" string="Valid for"/>
-                                            <field name="visa_no"/>
-                                            <field name="permit_no"/>
-                                            <field name="visa_expire"/>
-                                        </group>
-                                    </page>
-                                </notebook>
-                                <separator colspan="4" string="Notes"/>
-                                <field colspan="4" name="notes" nolabel="1"/>
-                            </form>
-                        </field>
-                    </page>
-                    <page string="Miscelleanous">
+            <data>
+                <xpath expr="/form/notebook/page[@string='Personal Information']" position="after">
+                    <page string="Miscellaneous" groups="base.group_hr_user">
                         <group colspan="2" col="2">
                             <separator string="Personal Info" colspan="2"/>
-                            <field name="pan_no" select="1"/>
-                            <field name="bank_account"/>
+                            <field name="bank_account_id" context="{'display_partner':True, 'partner_id':partner_id}"/>
                             <field name="place_of_birth"/>
                             <field name="children"/>
                         </group>
                             <field name="manager" select="1"/>
                             <field name="vehicle" select="1"/>
                             <field name="vehicle_distance" select="1"/>
-                            <field name="medic_exam" select="1"/>
-                        </group>
-                        <group col="2" colspan="2">
-                            <separator colspan="2" string="ESI Information"/>
-                            <field name="esi_account" string="Account"/>
-                            <field name="hospital_id" string="Hospital"/>
                             <field name="medic_exam" select="1" string="Medical Examination"/>
-                            <field name="esp_account" select="1"/>
-                        </group>
-                        <group col="2" colspan="2">
-                            <separator colspan="2" string="Providend Fund"/>
-                            <field name="pf_account" string="Account"/>
-                            <field name="pg_joining" string="Join Date"/>
                         </group>
                     </page>
-                    <page string="Salary Structure">
-                        <field name="line_ids" nolabel="1" colspan="4" string="Salary Structure">
-                            <tree string="Salary Structure" editable="bottom">
-                                <field name="category_id" on_change="onchange_category(category_id)"/>
-                                <field name="sequence"/>
-                                <field name="name"/>
-                                <field name="code"/>
-                                <field name="type"/>
-                                <field name="amount_type"/>
-                                <field name="amount" on_change="onchange_amount(amount, amount_type)"/>
-                                <field name="account_id"/>
-                                <field name="analytic_account_id"/>
-                            </tree>
-                        </field>
-                    </page>
-                    <page string="Accounting">
-                        <field name="property_bank_account"/>
-                        <field name="salary_account"/>
-                        <field name="employee_account"/>
-                        <field name="analytic_account"/>
-                        <field name="slip_ids" colspan="4" nolabel="1"/>
-                    </page>
-                </notebook>
+                </xpath>
+            </data>
             </field>
         </record>
-        
         <record id="view_employee_passport_form" model="ir.ui.view">
             <field name="name">hr.employee.passport.form</field>
             <field name="model">hr.employee</field>
             <field name="type">form</field>
             <field name="inherit_id" ref="hr.view_employee_form"/>
             <field name="arch" type="xml">
-                <field name="otherid" position="after">
+                <field name="passport_id" position="replace">
                     <field name="passport_id"/>
+                    <field name="otherid"/>
                 </field>
             </field>
         </record>
+
         <!-- End Employee View -->
-        
+
         <!-- Contract View -->
         <record id="hr_contract.hr_contract_view_form" model="ir.ui.view">
             <field name="name">hr.contract.view.form</field>
                                 <field name="date_end" select="1"/>
                                 <field name="working_hours"/>
                                 <field name="working_days_per_week" select="1"/>
+                                <separator colspan="2" string="Trial Period"/>
+                                <field name="trial_date_start" />
+                                <field name="trial_date_end" />
                             </group>
                             <group col="2" colspan="2">
                                 <separator colspan="2" string="Advantages"/>
                                 <field name="struct_id" select="1"/>
-                                <field name="advantages_net"/>
                                 <field name="advantages_gross"/>
+                                <field name="advantages_net"/>
                                 <field name="advantages" nolabel="1" colspan="2"/>
                             </group>
                         </page>
                         <page string="Work Permit">
                             <group col="2" colspan="2">
                                 <separator colspan="2" string="Passport"/>
-                                <field name="passport_id"/>
+                                <field name="passport_id" domain="[('employee_id','=',employee_id)]"/>
                             </group>
                             <group col="2" colspan="2">
                                 <separator colspan="2" string="Valid for"/>
-                                <field name="visa_no"/>
-                                <field name="permit_no"/>
-                                <field name="visa_expire"/>
+                                <field name="visa_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
+                                <field name="permit_no" attrs="{'required': [('passport_id','!=',False), ]}"/>
+                                <field name="visa_expire" attrs="{'required': [('passport_id','!=',False), ]}"/>
                             </group>
                         </page>
                     </notebook>
                 </form>
             </field>
         </record>
-        <menuitem action="hr_contract.action_hr_contract" id="hr_menu_contract" parent="payroll_configure" name="Contracts" sequence="4"/>
+        <!--menuitem action="hr_contract.action_hr_contract" id="hr_menu_contract" parent="payroll_configure" name="Contracts" sequence="4"/-->
         <!-- End Contract View-->
-        
+
         <!-- Salary structure -->
         <record id="view_hr_employee_grade_tree" model="ir.ui.view">
             <field name="name">hr.payroll.structure.tree</field>
                     <field name="name"/>
                     <field name="code"/>
                     <field name="line_ids"/>
-                    <field name="company_id"/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                 </tree>
             </field>
         </record>
                     <group col="6" colspan="4">
                         <field name="name" colspan="4" select="1"/>
                         <field name="code" select="1"/>
-                        <field name="account_id" select="1"/>
-                        <field name="company_id"/>
+                        <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Salary Structure">
-                            <field name="line_ids" nolabel="1" colspan="4"/>
+                            <field name="line_ids" nolabel="1" colspan="4">
+                                <form string="Payslip Line">
+                                    <group col="6" colspan="4">
+                                        <field name="name" colspan="4" select="1"/>
+                                        <field name="code" select="1"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="4" string="Calculations"/>
+                                        <field name="category_id" on_change="onchange_category(category_id)"/>
+                                        <field name="type"/>
+                                        <field name="amount_type"/>
+                                        <field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
+                                        <field name="sequence" groups="base.group_extended"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="4" string="Company contribution"/>
+                                        <field name="company_contrib"/>
+                                    </group>
+                                    <notebook colspan="4">
+                                        <page string="Function">
+                                            <field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
+                                                <tree string="Function Arguments" editable="bottom">
+                                                    <field name="name"/>
+                                                    <field name="sequence" groups="base.group_extended"/>
+                                                    <field name="from_val"/>
+                                                    <field name="to_val"/>
+                                                    <field name="amount_type"/>
+                                                    <field name="value"/>
+                                                </tree>
+                                            </field>
+                                        </page>
+                                        <page string="Description">
+                                            <separator colspan="4" string="Description"/>
+                                            <field name="note" colspan="4" nolabel="1"/>
+                                        </page>
+                                    </notebook>
+                                </form>
+                            </field>
                         </page>
                     </notebook>
                 </form>
             </field>
         </record>
-        
+
         <record id="action_view_hr_employee_grade_form" model="ir.actions.act_window">
             <field name="name">Salary Structure</field>
             <field name="res_model">hr.payroll.structure</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="view_hr_employee_grade_tree"/>
         </record>
-        <menuitem 
-            id="menu_hr_employee_function" 
-            action="action_view_hr_employee_grade_form" 
-            parent="payroll_configure" 
+        <menuitem
+            id="menu_hr_employee_function"
+            action="action_view_hr_employee_grade_form"
+            parent="payroll_configure"
         />
         <!-- End Salary structure -->
-        
+
         <!-- Holiday Status -->
         <record model="ir.ui.view" id="view_holiday_status_form1">
             <field name="name">hr.holidays.status.inherit</field>
             <field name="inherit_id" ref="hr_holidays.edit_holiday_status_form"/>
             <field name="type">form</field>
             <field name="arch" type="xml">
-                <field name="color_name" position="after">
-                    <group col="2" colspan="2">
-                        <separator colspan="4" string="Payroll Accounting"/>
-                        <field name="company_id" widget="selection" select="2"/>
-                        <field name="code"/>
-                        <field name="analytic_account_id"/>
-                        <field name="account_id"/>
-                    </group>
-                    <group col="2" colspan="2">
-                        <separator colspan="4" string="Payroll Configurtion"/>
-                        <field name="type"/>
-                        <field name="head_id"/>
-                    </group>
-                </field>
-            </field>
+            <xpath expr="//group[@name='selection']" position="replace">
+                <group colspan="2">
+                            <separator string="Validation" colspan="2"/>
+                                <newline/>
+                            <field name="double_validation"/>
+                                <newline/>
+                            <field name="limit"/>
+                  </group>
+                <group colspan="2">
+                    <separator colspan="2" string="Payroll Configurtion"/><newline/>
+                    <field name="type"/><newline/>
+                    <field name="head_id"/><newline/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection" select="2"/><newline/>
+                    <field name="code" readonly="True"/>
+                </group>
+            </xpath>
+        </field>
         </record>
         <!-- End Holiday Status -->
-        
+
         <!-- Payslip Line -->
         <record id="view_hr_payslip_line_tree" model="ir.ui.view">
             <field name="name">hr.payslip.line.tree</field>
             <field name="arch" type="xml">
                 <tree string="Salary Structure" editable="bottom">
                     <field name="category_id" on_change="onchange_category(category_id)"/>
-                    <field name="sequence"/>
+                    <field name="sequence" groups="base.group_extended"/>
                     <field name="name"/>
                     <field name="code"/>
                     <field name="type"/>
                     <field name="amount_type"/>
                     <field name="amount" on_change="onchange_amount(amount, amount_type)"/>
-                    <field name="account_id"/>
-                    <field name="analytic_account_id"/>
                 </tree>
             </field>
         </record>
                         <field name="type"/>
                         <field name="amount_type"/>
                         <field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
-                        <field name="sequence"/>
+                        <field name="sequence" groups="base.group_extended"/>
                     </group>
                     <group col="2" colspan="2">
-                        <separator colspan="4" string="Accounting Informations"/>
-                        <field name="account_id"/>
-                        <field name="analytic_account_id"/>
                         <separator colspan="4" string="Company contribution"/>
                         <field name="company_contrib"/>
                     </group>
                             <field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
                                 <tree string="Function Arguments" editable="bottom">
                                     <field name="name"/>
-                                    <field name="sequence"/>
+                                    <field name="sequence" groups="base.group_extended"/>
                                     <field name="from_val"/>
                                     <field name="to_val"/>
                                     <field name="amount_type"/>
             <field name="model">hr.payslip</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree string="Payslip">
+                <tree colors="blue:state in ('confirm','hr_check','accont_check');black:state in ('new');gray:state in('cancel')" string="Payslip">
                     <field name="number"/>
                     <field name="employee_id"/>
+                    <field name="register_id" invisible="1"/>
                     <field name="name"/>
                     <field name="date"/>
                     <field name="grows"/>
                     <field name="net"/>
                     <field name="state"/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                 </tree>
             </field>
         </record>
-        
+
         <record id="view_hr_payslip_form" model="ir.ui.view">
             <field name="name">hr.payslip.form</field>
             <field name="model">hr.payslip</field>
                         <field name="employee_id"/>
                         <field name="name"/>
                         <field name="number" select="1"/>
-                        <field name="journal_id"/>
-                        <field name="bank_journal_id" domain="[('type','=','cash')]"/>
                         <field name="date"/>
                     </group>
                     <notebook colspan="4">
-                        <page string="Salary Detail">
+                        <page string="Salary Computation">
                             <field name="line_ids" colspan="4" nolabel="1">
                                 <tree string="Salary Structure" editable="bottom">
                                     <field name="category_id" on_change="onchange_category(category_id)"/>
-                                    <field name="sequence"/>
+                                    <field name="sequence" groups="base.group_extended"/>
                                     <field name="name"/>
                                     <field name="code"/>
                                     <field name="type"/>
                                     <field name="amount_type"/>
                                     <field name="amount" on_change="onchange_amount(amount, amount_type)"/>
                                     <field name="total"/>
-                                    <field name="account_id"/>
-                                    <field name="analytic_account_id"/>
                                 </tree>
+                                <form string="Payslip Line">
+                                    <group col="6" colspan="4">
+                                        <field name="name" colspan="4" select="1"/>
+                                        <field name="code" select="1"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="4" string="Calculations"/>
+                                        <field name="category_id" on_change="onchange_category(category_id)"/>
+                                        <field name="type"/>
+                                        <field name="amount_type"/>
+                                        <field name="amount" on_change="onchange_amount(amount, amount_type)" attrs="{'readonly':[('amount_type','=','func')]}"/>
+                                        <field name="sequence" groups="base.group_extended"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="4" string="Company contribution"/>
+                                        <field name="company_contrib"/>
+                                    </group>
+                                    <notebook colspan="4">
+                                        <page string="Function">
+                                            <field name="line_ids" colspan="4" nolabel="1" attrs="{'readonly':[('amount_type','!=','func')]}">
+                                                <tree string="Function Arguments" editable="bottom">
+                                                    <field name="name"/>
+                                                    <field name="sequence" groups="base.group_extended"/>
+                                                    <field name="from_val"/>
+                                                    <field name="to_val"/>
+                                                    <field name="amount_type"/>
+                                                    <field name="value"/>
+                                                </tree>
+                                            </field>
+                                        </page>
+                                        <page string="Description">
+                                            <separator colspan="4" string="Description"/>
+                                            <field name="note" colspan="4" nolabel="1"/>
+                                        </page>
+                                    </notebook>
+                                </form>
                             </field>
-                            
                             <group col="6" colspan="4">
                                 <separator string="Computation Overview" colspan="6"/>
                                 <field name="working_days"/>
                                 <field name="holiday_days"/>
                                 <field name="worked_days"/>
-                                
                                 <field name="basic_before_leaves"/>
                                 <field name="leaves"/>
                                 <field name="basic"/>
-                                
                                 <field name="allounce"/>
                                 <field name="deduction"/>
                                 <field name="other_pay"/>
-                                
                                 <field name="grows"/>
                                 <field name="net"/>
                                 <field name="total_pay"/>
                             </group>
                         </page>
-                        <page string="Accounting Details">
-                            <group col="2" colspan="3">
-                                <separator colspan="4" string="Accounting Informations"/>
-                                <field name="move_ids" colspan="2" nolabel="1" readonly="1">
-                                    <tree string="Accounting Vouchers">
-                                        <field name="sequence"/>
-                                        <field name="name"/>
-                                        <field name="move_id"/>
-                                    </tree>
-                                    <form string="Accounting Vouchers">
-                                        <field name="sequence"/>
-                                        <field name="name"/>
-                                        <field name="move_id"/>
-                                    </form>
-                                </field>
-                            </group>
+                        <page string="Other Informations">
                             <group col="2" colspan="1">
-                                <separator colspan="4" string="Other Informations"/>
+                                <separator colspan="2" string="Other Informations"/>
                                 <field name="paid" readonly="1"/>
-                                <field name="company_id"/>
-                                <field name="register_id"/>
-                                <field name="deg_id"/>
-                                <field name="contract_id" domain="[('employee_id','=',employee_id)]"/>
+                                <field name="company_id" groups="base.group_multi_company" widget="selection"/>
+                                <field name="register_id" groups="base.group_extended"/>
+                                <field name="deg_id" groups="base.group_extended"/>
+                                <field name="contract_id" groups="base.group_extended" domain="[('employee_id','=',employee_id)]"/>
                             </group>
+                            <newline/>
                             <separator colspan="4" string="Description"/>
                             <field name="note" colspan="4" nolabel="1"/>
                         </page>
-                        <page string="Account Lines">
-                            <field name="move_line_ids" colspan="4" nolabel="1"/>
-                        </page>
-                        <page string="Payment Lines">
-                            <field name="move_payment_ids" colspan="4" nolabel="1"/>
-                        </page>
                     </notebook>
-                    <group col="9" colspan="4">
+                    <group col="10" colspan="4">
                         <field name="state"/>
-                        <button string="Compute Sheet" name="compute_sheet" states="new"/>
-                        <button string="Recompute Sheet" name="compute_sheet" type="object" states="draft"/>
-                        <button string="Verify Sheet" name="verify_sheet" states="draft"/>
-                        <button string="Complete HR Checking" name="verify_twice_sheet" states="hr_check"/>
-                        <button string="Complete Accountant Checking" name="final_verify_sheet" states="accont_check"/>
-                        <button string="Pay Salary" name="process_sheet" states="confirm"/>
-                        <button string="Cancel" name="cancel_sheet" states="draft,hr_check,accont_check,confirm"/>
-                        <button string="Set to Draft" name="set_to_draft" states="cancel"/>
+                        <button string="Cancel" icon="terp-dialog-close" name="cancel_sheet" states="draft,hr_check,confirm"/>
+                        <button string="Compute Sheet" icon="terp-stock_format-scientific" name="compute_sheet" states="new"/>
+                        <button string="Recompute Sheet" icon="terp-stock_format-scientific" name="compute_sheet" type="object" states="draft"/>
+                        <button string="Verify Sheet" icon="terp-camera_test" name="verify_sheet" states="draft"/>
+                        <button string="Approve Sheet" icon="terp-camera_test" name="final_verify_sheet" states="hr_check"/>
+                        <button string="Pay Salary" icon="terp-dolar_ok!" name="process_sheet" states="confirm"/>
+                        <button string="Set to Draft" icon="terp-stock_effects-object-colorize" name="set_to_draft" states="cancel"/>
                     </group>
                 </form>
             </field>
         </record>
+        <record id="view_hr_payslip_filter" model="ir.ui.view">
+            <field name="name">hr.payslip.select</field>
+            <field name="model">hr.payslip</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Search Payslips">
+                    <group col="8" colspan="4">
+                        <filter icon="terp-document-new" string="Draft" domain="[('state','=','draft')]" help="Draft Slip"/>
+                        <filter icon="terp-camera_test" string="Posted" domain="[('state','=','posted')]" help="Posted Slip"/>
+                        <separator orientation="vertical"/>
+                        <filter icon="terp-dolar_ok!" string="Paid" domain="[('state','=','done'),('paid','=',True)]" help="Paid Slip"/>
+                        <separator orientation="vertical"/>
+                        <field name="name"/>
+                        <field name="employee_id"/>
+                        <field name="number"/>
+                        <field name="date"/>
+                    </group>
+                    <newline/>
+                    <group col="8" colspan="4" expand="0" string="Group By...">
+                        <filter string="Employees" icon="terp-personal" name="employee_id" context="{'group_by':'employee_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Register" icon="terp-folder-yellow" name="register_id" context="{'group_by':'register_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="Companies" name="company_id"  icon="terp-go-home" context="{'group_by':'company_id'}"/>
+                        <separator orientation="vertical"/>
+                        <filter string="States" name="state" icon="terp-stock_effects-object-colorize" context="{'group_by':'state'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
         <record id="action_view_hr_payslip_form" model="ir.actions.act_window">
             <field name="name">Employee Payslip</field>
             <field name="res_model">hr.payslip</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="view_hr_payslip_tree"/>
+            <field name="search_view_id" ref="view_hr_payslip_filter"/>
         </record>
         <menuitem action="action_view_hr_payslip_form" id="menu_department_tree" parent="menu_hr_root_payroll"/>
-        
-        
-        
+
         <!-- Payment Heads -->
         <record id="hr_allounce_deduction_categoty_form" model="ir.ui.view">
             <field name="name">hr.allounce.deduction.categoty.form</field>
                         <field name="name" select="1"/>
                         <field name="code" select="1"/>
                         <field name="type" select="1"/>
-                        
-                        <group col="4" colspan="4">
-                            <separator colspan="2" string="Based on"/>
+                        <group col="2" colspan="4">
+                            <separator colspan="4" string="Based on"/>
                             <field name="base" colspan="4" nolabel="1"/>
                         </group>
                         <group col="2" colspan="2">
-                            <separator colspan="2" string="Dynamic Computation"/>
+                            <separator colspan="4" string="Dynamic Computation"/>
                             <field name="condition"/>
                             <field name="sequence"/>
                         </group>
                     </group>
-                    
                     <notebook colspan="4">
-                        <page string="Contribution">
-                            <field name="contribute_ids" colspan="4" nolabel="1" height="300"/>
-                        </page>
                         <page string="Description">
                             <field name="note" colspan="4" nolabel="1"/>
                         </page>
+                        <page string="Contribution">
+                            <field name="contribute_ids" colspan="4" nolabel="1" height="300">
+                                <form string="Company Contribution">
+                                    <group col="6" colspan="6">
+                                        <field name="name" select="1"/>
+                                        <field name="code" select="1"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="2" string="Contributions"/>
+                                        <field name="amount_type" attrs="{'required': [('contribute','=',True)]}"/>
+                                        <field name="contribute_per" attrs="{'required': [('contribute','=',True)], 'readonly':[(('amount_type','=','func'))]}"/>
+                                        <field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
+                                    </group>
+                                    <group col="2" colspan="2">
+                                        <separator colspan="2" string="Other Information"/>
+                                        <field name="company_id" groups="base.group_multi_company" widget="selection" select="1"/>
+                                        <field name="active" select="1"/>
+                                    </group>
+                                    <notebook colspan="4">
+                                        <page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">
+                                            <field name="line_ids" colspan="4" nolabel="1">
+                                                <tree string="Function Arguments" editable="bottom">
+                                                    <field name="name"/>
+                                                    <field name="sequence"/>
+                                                    <field name="from_val"/>
+                                                    <field name="to_val"/>
+                                                    <field name="amount_type"/>
+                                                    <field name="value"/>
+                                                </tree>
+                                            </field>
+                                        </page>
+                                        <page string="Description">
+                                            <field name="note" colspan="4" nolabel="1"/>
+                                        </page>
+                                    </notebook>
+                                </form>
+                            </field>
+                        </page>
                     </notebook>
                 </form>
             </field>
                 </tree>
             </field>
         </record>
+
+        <record id="view_allounce_deduction_categoty_filter" model="ir.ui.view">
+            <field name="name">hr.allounce.deduction.categoty.select</field>
+            <field name="model">hr.allounce.deduction.categoty</field>
+            <field name="type">search</field>
+            <field name="arch" type="xml">
+                <search string="Salary Heads">
+                    <filter icon="terp-document-new" string="Allowance" domain="[('type','=','allowance')]"/>
+                    <filter icon="terp-check" string="Deduction" domain="[('type','=','deduction')]"/>
+                    <separator orientation="vertical"/>
+                    <field name="name" select="1"/>
+                     <field name="code" select="1"/>
+                    <field name="type"/>
+                    <newline/>
+                    <group expand="0" string="Group By..." colspan="4" col="4" groups="base.group_extended">
+                        <filter string="Based" icon="terp-go-month" domain="[]" context="{'group_by':'base'}"/>
+                        <filter string="Type" icon="terp-stock_symbol-selection" domain="[]" context="{'group_by':'type'}"/>
+                    </group>
+               </search>
+            </field>
+        </record>
+
         <record id="hr_allounce_deduction_tree" model="ir.actions.act_window">
             <field name="name">Salary Heads</field>
             <field name="res_model">hr.allounce.deduction.categoty</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="hr_allounce_deduction_categoty_tree"/>
+           <field name="search_view_id" ref="view_allounce_deduction_categoty_filter"/>
         </record>
-        <menuitem 
-            id="menu_hr_allounce_deduction_tree" 
-            action="hr_allounce_deduction_tree" 
-            parent="payroll_configure" 
+        <menuitem
+            id="menu_hr_allounce_deduction_tree"
+            action="hr_allounce_deduction_tree"
+            parent="payroll_configure"
         />
         <!-- End Payment Heads -->
-        
+
         <!-- Company Contribution -->
         <record id="hr_company_contribution_form" model="ir.ui.view">
             <field name="name">company.contribution.form</field>
                         <field name="name" select="1"/>
                         <field name="code" select="1"/>
                         <field name="category_id"/>
-                        <field name="company_id" select="1"/>
-                        <field name="active" select="1"/>
                     </group>
                     <group col="2" colspan="2">
                         <separator colspan="2" string="Contributions"/>
                         <field name="register_id" attrs="{'required': [('contribute','=',True)]}"/>
                     </group>
                     <group col="2" colspan="2">
-                        <separator colspan="2" string="Accounts"/>
-                        <field name="include_in_salary" />
-                        <field name="account_id" attrs="{'required': [('include_in_salary','=',True)]}"/>
+                        <separator colspan="2" string="Other Information"/>
+                        <field name="company_id" groups="base.group_multi_company" widget="selection" select="1"/>
+                        <field name="active" select="1"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Function" attrs="{'readonly': [('amount_type','!=','func')]}">
                     <field name="contribute_per"/>
                     <field name="amount_type"/>
                     <field name="register_id"/>
+                     <field name="category_id"/>
                 </tree>
             </field>
         </record>
+
+        <record id="view_hr_company_contribution_filter" model="ir.ui.view">
+            <field name="name">company.contribution.select</field>
+             <field name="model">company.contribution</field>
+            <field name="type">search</field>
+             <field name="arch" type="xml">
+                <search string="Search Company Contribution">
+                    <group col="8" colspan="4">
+                        <filter icon="terp-document-new" string="Fixed Amount" domain="[('amount_type','=','fix')]" help="Draft Slip"/>
+                        <filter icon="terp-camera_test" string="Function Calculation" domain="[('amount_type','=','func')]" help="Posted Slip"/>
+                        <separator orientation="vertical"/>
+                        <field name="name"/>
+                        <field name="code"/>
+                        <field name="contribute_per"/>
+                        <field name="register_id"/>
+                    </group>
+                    <newline/>
+                    <group col="8" colspan="4" expand="0" string="Group By...">
+                        <filter string="Type" icon="terp-stock_symbol-selection" name="amount_type" context="{'group_by':'amount_type'}"/>
+                        <filter string="Category" name="category_id" icon="terp-stock_symbol-selection"  context="{'group_by':'category_id'}"/>
+                    </group>
+                </search>
+            </field>
+        </record>
         <record id="action_hr_company_contribution_tree" model="ir.actions.act_window">
             <field name="name">Company Contributions</field>
             <field name="res_model">company.contribution</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="hr_company_contribution_tree"/>
+             <field name="search_view_id" ref="view_hr_company_contribution_filter"/>
         </record>
-        <menuitem 
-            id="menu_hr_company_contribution_tree" 
-            action="action_hr_company_contribution_tree" 
-            parent="payroll_configure" 
+        <menuitem
+            id="menu_hr_company_contribution_tree"
+            action="action_hr_company_contribution_tree"
+            parent="payroll_configure"
         />
         <!-- End Company Contribution -->
-        
-        <!-- Contract Form-->
-<!--        <record id="hr_contract.hr_contract_view_form" model="ir.ui.view">-->
-<!--            <field name="name">hr.contract.view.form</field>-->
-<!--            <field name="model">hr.contract</field>-->
-<!--            <field name="type">form</field>-->
-<!--            <field name="arch" type="xml">-->
-<!--                <form string="Contract">-->
-<!--                    <field name="employee_id"/>-->
-<!--                    <separator colspan="4" string="General Information"/>-->
-<!--                    <field colspan="4" name="name" select="1"/>-->
-<!--                    <newline/>-->
-<!--                    <separator colspan="4" string="Contract Duration"/>-->
-<!--                    <field name="function"/>-->
-<!--                    <field name="working_hours_per_day"/>-->
-<!--                    <field name="working_days_per_week"/>-->
-<!--                    <field name="date_start" select="1"/>-->
-<!--                    <field name="date_end" select="1"/>-->
-<!--                    -->
-<!--                    <separator colspan="4" string="Salary"/>-->
-<!--                    <field name="wage_type_id"/>-->
-<!--                    <field name="wage"/>-->
-<!--                    -->
-<!--                    <separator colspan="4" string="Notes"/>-->
-<!--                    <field colspan="4" name="notes" nolabel="1"/>-->
-<!--                    -->
-<!--                    <separator colspan="4" string="Passport and Visa"/>-->
-<!--                    <field name="permit_no"/>-->
-<!--                    <field name="passport_id"/>-->
-<!--                    <field name="visa_no"/>-->
-<!--                    <field name="visa_expire"/>-->
-<!--                </form>-->
-<!--            </field>-->
-<!--        </record>-->
-<!--        <record id="action_hr_contract" model="ir.actions.act_window">-->
-<!--            <field name="name">Employee Contract</field>-->
-<!--            <field name="res_model">hr.contract</field>-->
-<!--            <field name="view_type">form</field>-->
-<!--            <field name="view_mode">form,tree</field>-->
-<!--        </record>-->
-<!--        <menuitem -->
-<!--            action="action_hr_contract" -->
-<!--            name="Employee Contract" -->
-<!--            id="hr_menu_contract" -->
-<!--            parent="payroll_configure"-->
-<!--        />-->
-        
+
         <record id="view_hr_bank_advice_tree" model="ir.ui.view">
             <field name="name">hr.payroll.advice.tree</field>
             <field name="model">hr.payroll.advice</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
                 <tree string="Bank Advice">
+                    <field name="number" select="1"/>
                     <field name="name" select="1"/>
                     <field name="date" select="1"/>
-                    <field name="number" select="1"/>
-                    <field name="company_id"/>
+                    <field name="company_id" groups="base.group_multi_company" widget="selection"/>
                 </tree>
             </field>
         </record>
-        
+
         <record id="view_hr_bank_advice_form" model="ir.ui.view">
             <field name="name">hr.payroll.advice.form</field>
             <field name="model">hr.payroll.advice</field>
                 <form string="Bank Advice">
                     <group col="6" colspan="4">
                         <field name="name" colspan="4" select="1"/>
-                        <field name="account_id" select="1"/>
-                        <newline/>
-                        <field name="date" select="1"/>
                         <field name="number" select="1"/>
                         <field name="register_id"/>
+                        <field name="bank_id"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Paymeny Lines">
                                     <field name="flag"/>
                                 </tree>
                             </field>
-                            <field name="company_id"/>
-                            <field name="chaque_nos"/>
                         </page>
                         <page string="Letter Content">
+                            <group colspan="4" col="6">
+                              <field name="company_id" on_change="onchange_company_id(company_id)" groups="base.group_multi_company" widget="selection"/>
+                              <field name="chaque_nos"/>
+                              <field name="date" select="1"/>
+                            </group>
                             <separator colspan="4" string="Letter Details"/>
                             <field name="note" colspan="4" nolabel="1"/>
                         </page>
                     </notebook>
                     <group col="6" colspan="6">
                         <field name="state"/>
-                        <button name="confirm_sheet" string="Confirm Sheet" states="draft" type="object"/>
-                        <button name="set_to_draft" string="Set to Draft" states="cancel,confirm" type="object"/>
-                        <button name="cancel_sheet" string="Cancel Sheet" states="draft" type="object"/>
+                        <button name="cancel_sheet" string="Cancel Sheet" states="draft" icon="gtk-cancel"  type="object"/>
+                        <button name="confirm_sheet"  icon="gtk-apply" string="Confirm Sheet" states="draft" type="object"/>
+                        <button name="set_to_draft" string="Set to Draft"  icon="gtk-convert"  states="cancel,confirm" type="object"/>
                     </group>
                 </form>
             </field>
             <field name="view_mode">tree,form</field>
             <field name="view_id" ref="view_hr_bank_advice_tree"/>
         </record>
-        <menuitem 
-            action="action_view_hr_bank_advice_tree" 
-            id="hr_menu_payment_advice" 
+        <menuitem
+            action="action_view_hr_bank_advice_tree"
+            id="hr_menu_payment_advice"
             parent="menu_hr_root_payroll"
         />
-        
+
         <record id="view_hr_payroll_register_tree" model="ir.ui.view">
             <field name="name">hr.payroll.register.tree</field>
             <field name="model">hr.payroll.register</field>
             <field name="type">tree</field>
             <field name="arch" type="xml">
-                <tree string="Payroll Register">
+                <tree  colors="blue:state in ('draft');black:state in ('confirm','new','hr_check','accont_check');gray:state in('done','cancel')" string="Payroll Register">
                     <field name="number"/>
                     <field name="name"/>
                     <field name="date"/>
-                    <field name="journal_id"/>
-                    <field name="bank_journal_id"/>
                     <field name="state"/>
                 </tree>
             </field>
             <field name="arch" type="xml">
                 <form string="Payroll Register">
                     <group col="6" colspan="4">
-                        <field name="name" select="1"/>
-                        <field name="date" select="1"/>
+                        <field name="name" colspan="4" select="1"/>
                         <field name="number" select="1"/>
-                        <field name="journal_id"/>
-                        <field name="bank_journal_id"/>
-                        <field name="active"/>
+                        <field name="bank_id"/>
+                        <field name="date" select="1"/>
                     </group>
                     <notebook colspan="4">
                         <page string="Payslips">
                             <field name="line_ids" colspan="4" nolabel="1">
-                                <tree string="Payslip">
+                                <tree colors="blue:state in ('draft');black:state in ('confirm','new','hr_check','accont_check');gray:state in('done','cancel')" string="Payslip">
                                     <field name="number"/>
                                     <field name="employee_id"/>
                                     <field name="name"/>
                     </notebook>
                     <group col="8" colspan="4">
                         <field name="state"/>
-                        <button string="Compute" name="compute_sheet" states="new" type="object"/>
-                        <button string="Verify Sheet" name="verify_sheet" states="draft" type="object"/>
-                        <button string="Complete HR Checking" name="verify_twice_sheet" type="object" states="hr_check"/>
-                        <button string="Complete Accountant Checking" name="final_verify_sheet" states="accont_check" type="object"/>
-                        <button string="Pay Salary" name="process_sheet" states="confirm" type="object"/>
-                        <button string="Cancel" name="cancel_sheet" states="draft,hr_check,accont_check,confirm" type="object"/>
-                        <button string="Set to Draft" name="set_to_draft" states="cancel" type="object"/>
+                        <button string="Cancel" name="cancel_sheet" icon="gtk-cancel" states="draft,hr_check,accont_check,confirm" type="object"/>
+                        <button string="Compute" name="compute_sheet" states="new" icon="terp-document-new" type="object"/>
+                        <button string="Verify Sheet" icon="gtk-ok" name="verify_sheet" states="draft" type="object"/>
+                        <button string="Complete HR Checking"  icon="gtk-apply" name="final_verify_sheet" type="object" states="hr_check"/>
+                        <button string="Pay Salary" icon="gtk-apply"  name="process_sheet" states="confirm" type="object" />
+                        <button string="Set to Draft" name="set_to_draft" states="cancel" type="object" icon="gtk-convert" />
                     </group>
                 </form>
             </field>
             <field name="view_type">form</field>
             <field name="view_mode">tree,form</field>
         </record>
-        <menuitem 
-            action="action_view_hr_payroll_register_form" 
-            id="hr_menu_payroll_register" 
+        <menuitem
+            action="action_view_hr_payroll_register_form"
+            id="hr_menu_payroll_register"
             parent="menu_hr_root_payroll"
         />
-        
+
         <!--
         Contribution Register
         -->
             <field name="arch" type="xml">
                 <tree string="Contribution Registers">
                     <field name="name" select="1"/>
-                    <field name="company_id" select="1"/>
+                    <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
                     <field name="monthly_total_by_emp"/>
                     <field name="monthly_total_by_comp"/>
-                    <field name="yearly_total_by_emp"/>
-                    <field name="yearly_total_by_comp"/>
                 </tree>
             </field>
         </record>
             <field name="arch" type="xml">
                 <form string="Contribution">
                     <field name="name" select="1"/>
-                    <field name="account_id"/>
-                    <field name="analytic_account_id"/>
-                    <field name="company_id" select="1"/>
+                    <field name="company_id" select="1" groups="base.group_multi_company" widget="selection"/>
                     <notebook colspan="4">
                         <page string="Contribution Lines">
                             <field colspan="4" name="register_line_ids" nolabel="1" select="1">
                                 <tree string="Register Lines" editable="top">
                                     <field name="code"/>
+                                    <field name="name"/>
                                     <field name="employee_id"/>
-                                    <field name="period_id"/>    
                                     <field name="emp_deduction"/>
-                                    <field name="comp_deduction"/>    
-                                    <field name="total"/>                        
+                                    <field name="comp_deduction"/>
+                                    <field name="total"/>
                                 </tree>
                              </field>
                          </page>
                             <field name="note" colspan="4" nolabel="1"/>
                         </page>
                     </notebook>
-                    <group col="2" colspan="2">
-                        <separator colspan="4" string="Year"/>
-                        <field name="yearly_total_by_emp"/>
-                        <field name="yearly_total_by_comp"/>
-                    </group>
-                    <group col="2" colspan="2">
+                    <group col="2" colspan="2" name="Month">
                         <separator colspan="2" string="Month"/>
                         <field name="monthly_total_by_emp"/>
                         <field name="monthly_total_by_comp"/>
             </field>
         </record>
         <record id="action_contibution_register_form" model="ir.actions.act_window">
-            <field name="name">Contibution Register</field>
+            <field name="name">Contribution Register</field>
             <field name="res_model">hr.contibution.register</field>
             <field name="view_type">form</field>
             <field name="view_id" ref="hr_contibution_register_tree"/>
         </record>
         <menuitem
-            id="menu_action_hr_contibution_register_form" 
-            action="action_contibution_register_form" 
-            parent="payroll_configure" 
+            id="menu_action_hr_contibution_register_form"
+            action="action_contibution_register_form"
+            parent="payroll_configure"
         />
         <record id="hr_contibution_register_line_form" model="ir.ui.view">
             <field name="name">hr.contibution.register.line.form</field>
                 <form string="Contribution">
                       <field name="name"/>
                       <field name="code"/>
-                      <field name="employee_id"/>    
-                      <field name="period_id"/>    
+                      <field name="employee_id"/>
                       <field name="emp_deduction"/>
-                      <field name="comp_deduction"/>    
-                      <field name="total"/>                    
-                </form>
-            </field>
-        </record>
-        
-        <record id="hr_payslip_line_condition_tree" model="ir.ui.view">
-            <field name="name">hr.payslip.line.condition.tree</field>
-            <field name="model">hr.payslip.line.condition</field>
-            <field name="type">tree</field>
-            <field name="arch" type="xml">
-                <form string="Condition">
-                    <field name="name"/>
-                    <field name="date_start"/>
-                    <field name="date_end"/>    
-                    <field name="state"/>
+                      <field name="comp_deduction"/>
+                      <field name="total"/>
                 </form>
             </field>
         </record>
+
+
+
+        <!--  Shortcuts -->
+        <act_window name="Payslips"
+            domain="[('employee_id', '=', active_id)]"
+            context="{'search_default_employee_id': [active_id], 'default_employee_id': active_id}"
+            res_model="hr.payslip"
+            src_model="hr.employee"
+            view_id ="view_hr_payslip_tree"
+            id="act_hr_employee_payslip_list"
+            groups="base.group_hr_manager"/>
+
     </data>
 </openerp>