- <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="arch" type="xml">
- <form string="Payslip">
- <header>
- <button string="Confirm" name="hr_verify_sheet" states="draft" class="oe_highlight"/>
- <button string="Refund" name="refund_sheet" states="confirm,done" type='object' />
- <button string="Set to Draft" name="draft" states="cancel"/>
- <button string="Compute Sheet" name="compute_sheet" type="object" states="draft" class="oe_highlight"/>
- <button string="Cancel Payslip" name="cancel_sheet" states="draft,hr_check,confirm,verify"/>
- <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/>
- </header>
- <sheet>
- <div class="oe_right oe_button_box">
- <button name="%(act_payslip_lines)d"
- class="oe_stat_button"
- icon="fa-money"
- type="action">
- <field name="payslip_count" widget="statinfo" string="Payslip" help="Payslip Computation Details"/>
- </button>
- </div>
- <div class="oe_title">
- <label for="employee_id" class="oe_edit_only"/>
- <h1><field name="employee_id" on_change="onchange_employee_id(date_from, date_to, employee_id, contract_id)"/></h1>
- </div>
The code above is a part of hr.payroll, which is responsible in the on_change function in payslip, whenever the employee_id is changed, other fields will be filled up.
Now, I created a function that i wanted to be insert/add here in this part, <h1><field name="employee_id" on_change="onchange_employee_id(date_from, date_to, employee_id, contract_id)"/></h1>.
so that everytime the employee_id is changed, it will not only fill up the fields