diff options
| author | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 17:14:58 +0700 |
|---|---|---|
| committer | stephanchrst <stephanchrst@gmail.com> | 2022-05-10 17:14:58 +0700 |
| commit | 1ca3b3df3421961caec3b747a364071c80f5c7da (patch) | |
| tree | 6778a1f0f3f9b4c6e26d6d87ccde16e24da6c9d6 /om_hr_payroll/views | |
| parent | b57188be371d36d96caac4b8d65a40745c0e972c (diff) | |
initial commit
Diffstat (limited to 'om_hr_payroll/views')
| -rw-r--r-- | om_hr_payroll/views/hr_contract_views.xml | 130 | ||||
| -rw-r--r-- | om_hr_payroll/views/hr_employee_views.xml | 37 | ||||
| -rw-r--r-- | om_hr_payroll/views/hr_payroll_report.xml | 36 | ||||
| -rw-r--r-- | om_hr_payroll/views/hr_payslip_views.xml | 452 | ||||
| -rw-r--r-- | om_hr_payroll/views/hr_salary_rule_views.xml | 437 | ||||
| -rw-r--r-- | om_hr_payroll/views/report_contribution_register_templates.xml | 83 | ||||
| -rw-r--r-- | om_hr_payroll/views/report_payslip_details_templates.xml | 148 | ||||
| -rw-r--r-- | om_hr_payroll/views/report_payslip_templates.xml | 123 | ||||
| -rw-r--r-- | om_hr_payroll/views/res_config_settings_views.xml | 53 |
9 files changed, 1499 insertions, 0 deletions
diff --git a/om_hr_payroll/views/hr_contract_views.xml b/om_hr_payroll/views/hr_contract_views.xml new file mode 100644 index 0000000..3ea6ca9 --- /dev/null +++ b/om_hr_payroll/views/hr_contract_views.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <!-- Root Menus --> + + <menuitem id="menu_hr_payroll_root" + name="Payroll" + sequence="76" + web_icon="om_hr_payroll,static/description/icon.png"/> + + <menuitem id="menu_hr_payroll_configuration" + name="Configuration" parent="menu_hr_payroll_root" + sequence="100" + groups="om_hr_payroll.group_hr_payroll_manager"/> + + <!-- Contract View --> + <record id="hr_contract_form_inherit" model="ir.ui.view"> + <field name="name">hr.contract.view.form.inherit</field> + <field name="model">hr.contract</field> + <field name="inherit_id" ref="hr_contract.hr_contract_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//field[@name='job_id']" position="after"> + <field name="struct_id" required="1"/> + </xpath> + <xpath expr="//field[@name='job_id']" position="before"> + <field name="company_id" groups="base.group_multi_company"/> + <field name="currency_id" invisible="1"/> + </xpath> + <xpath expr="//field[@name='resource_calendar_id']" position="after"> + <field name="schedule_pay"/> + </xpath> + + <xpath expr="//page[@name='information']" position="after"> + <page name="other" position="move"/> + </xpath> + + <xpath expr="//group[@name='salary_and_advantages']" position="after"> + <group string="Monthly Advantages in Cash" name='allowances'> + <label for="hra"/> + <div class="o_row"> + <field name="hra" nolabel="1"/> + <span>/ month</span> + </div> + <label for="da"/> + <div class="o_row"> + <field name="da" nolabel="1"/> + <span>/ month</span> + </div> + <label for="travel_allowance"/> + <div class="o_row"> + + <field name="travel_allowance" nolabel="1"/> + <span>/ month</span> + </div> + <label for="meal_allowance"/> + <div class="o_row"> + + <field name="meal_allowance" nolabel="1"/> + <span>/ month</span> + </div> + <label for="medical_allowance"/> + <div class="o_row"> + + <field name="medical_allowance" nolabel="1"/> + <span>/ month</span> + </div> + <label for="other_allowance"/> + <div class="o_row"> + + <field name="other_allowance" nolabel="1"/> + <span>/ month</span> + </div> + </group> + </xpath> + </field> + </record> + + <record id="hr_contract_advantage_template_view_form" model="ir.ui.view"> + <field name="name">hr.contract.advantage.template.form</field> + <field name="model">hr.contract.advantage.template</field> + <field name="arch" type="xml"> + <form> + <sheet> + <div class="oe_title"> + <h1> + <field name="name" placeholder="Advantage Name"/> + </h1> + </div> + <group> + <group> + <field name="code"/> + </group> + </group> + <group> + <group> + <field name="default_value"/> + <field name="lower_bound"/> + <field name="upper_bound"/> + </group> + </group> + </sheet> + </form> + </field> + </record> + + <record id="hr_contract_advantage_template_view_tree" model="ir.ui.view"> + <field name="name">hr.contract.advantage.template.tree</field> + <field name="model">hr.contract.advantage.template</field> + <field name="arch" type="xml"> + <tree> + <field name="name"/> + <field name="code"/> + <field name="lower_bound"/> + <field name="upper_bound"/> + <field name="default_value"/> + </tree> + </field> + </record> + + <record id="hr_contract_advantage_template_action" model="ir.actions.act_window"> + <field name="name">Contract Advantage Templates</field> + <field name="res_model">hr.contract.advantage.template</field> + </record> + + <menuitem + id="hr_contract_advantage_template_menu_action" + action="hr_contract_advantage_template_action" + parent="menu_hr_payroll_configuration" + sequence="50"/> + +</odoo> diff --git a/om_hr_payroll/views/hr_employee_views.xml b/om_hr_payroll/views/hr_employee_views.xml new file mode 100644 index 0000000..23dc65c --- /dev/null +++ b/om_hr_payroll/views/hr_employee_views.xml @@ -0,0 +1,37 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="payroll_hr_employee_view_form" model="ir.ui.view"> + <field name="name">payroll.hr.employee.view.form</field> + <field name="model">hr.employee</field> + <field name="inherit_id" ref="hr.view_employee_form"/> + <field name="arch" type="xml"> + <xpath expr="//div[hasclass('oe_button_box')]" position="inside"> + <button name="%(om_hr_payroll.act_hr_employee_payslip_list)d" class="oe_stat_button" + icon="fa-money" type="action" string="Payslip"> + <field name="payslip_count" widget="statinfo"/> + </button> + </xpath> + </field> + </record> + + <menuitem id="menu_payroll_employee" + name="Employees" + parent="om_hr_payroll.menu_hr_payroll_root" + sequence="15"/> + + <menuitem id="menu_hr_employee" + name="Employees" + action="hr.open_view_employee_list_my" + parent="menu_payroll_employee" + sequence="10"/> + + <menuitem id="hr_menu_contract" + name="Contracts" + action="hr_contract.action_hr_contract" + parent="menu_payroll_employee" + sequence="20" + groups="hr_contract.group_hr_contract_manager"/> + + +</odoo> diff --git a/om_hr_payroll/views/hr_payroll_report.xml b/om_hr_payroll/views/hr_payroll_report.xml new file mode 100644 index 0000000..c93ccbe --- /dev/null +++ b/om_hr_payroll/views/hr_payroll_report.xml @@ -0,0 +1,36 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="action_contribution_register" model="ir.actions.report"> + <field name="name">PaySlip Lines By Contribution Register</field> + <field name="model">hr.contribution.register</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">om_hr_payroll.report_contribution_register</field> + <field name="report_file">om_hr_payroll.report_contribution_register</field> + <field name="binding_model_id" ref="model_hr_contribution_register"/> + <field name="binding_type">report</field> + </record> + + <record id="action_report_payslip" model="ir.actions.report"> + <field name="name">PaySlip</field> + <field name="model">hr.payslip</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">om_hr_payroll.report_payslip</field> + <field name="report_file">om_hr_payroll.report_payslip</field> + <field name="print_report_name">('Payslip - %s' % (object.employee_id.name))</field> + <field name="binding_model_id" ref="model_hr_payslip"/> + <field name="binding_type">report</field> + </record> + + <record id="payslip_details_report" model="ir.actions.report"> + <field name="name">PaySlip Details</field> + <field name="model">hr.payslip</field> + <field name="report_type">qweb-pdf</field> + <field name="report_name">om_hr_payroll.report_payslip_details</field> + <field name="report_file">om_hr_payroll.report_payslip_details</field> + <field name="print_report_name">('Payslip Details - %s' % (object.employee_id.name))</field> + <field name="binding_model_id" ref="model_hr_payslip"/> + <field name="binding_type">report</field> + </record> + +</odoo> diff --git a/om_hr_payroll/views/hr_payslip_views.xml b/om_hr_payroll/views/hr_payslip_views.xml new file mode 100644 index 0000000..a471cd2 --- /dev/null +++ b/om_hr_payroll/views/hr_payslip_views.xml @@ -0,0 +1,452 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + <data> + <!--Payslip Line --> + <record id="view_hr_payslip_line_tree" model="ir.ui.view"> + <field name="name">hr.payslip.line.tree</field> + <field name="model">hr.payslip.line</field> + <field name="arch" type="xml"> + <tree string="Salary Structure" editable="bottom" decoration-info="total == 0"> + <field name="category_id"/> + <field name="employee_id" invisible="1"/> + <field name="sequence"/> + <field name="name"/> + <field name="code"/> + <field name="quantity"/> + <field name="rate"/> + <field name="amount"/> + <field name="total"/> + <field name="amount_select" invisible="1"/> + <field name="register_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="view_hr_payslip_line_form" model="ir.ui.view"> + <field name="name">hr.payslip.line.form</field> + <field name="model">hr.payslip.line</field> + <field name="arch" type="xml"> + <form string="Payslip Line"> + <group> + <group> + <field name="name"/> + <field name="code"/> + <field name="slip_id"/> + <field name="employee_id"/> + </group> + <group string="Calculations"> + <field name="category_id"/> + <field name="amount_select"/> + <field name="amount_fix" attrs="{'readonly':[('amount_select','!=','fix')]}"/> + <field name="amount_percentage" attrs="{'readonly':[('amount_select','!=','percentage')]}"/> + <field name="sequence"/> + </group> + <field name="note"/> + </group> + </form> + </field> + </record> + + <record id="view_hr_payslip_line_filter" model="ir.ui.view"> + <field name="name">hr.payslip.line.select</field> + <field name="model">hr.payslip.line</field> + <field name="arch" type="xml"> + <search string="Search Payslip Lines"> + <field name="name" string="Payslip Lines" + filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/> + <field name="amount_select"/> + <field name="slip_id"/> + <group col="8" colspan="4" expand="0" string="Group By"> + <filter string="Salary Rule Category" name="category_id" context="{'group_by':'category_id'}"/> + <filter string="Contribution Register" name="register_id" context="{'group_by':'register_id'}"/> + <filter string="Amount Type" name="amount_select" context="{'group_by':'amount_select'}"/> + <filter string="Employees" name="employee_id" context="{'group_by':'employee_id'}"/> + </group> + </search> + </field> + </record> + + <!-- payslip --> + + <record id="view_hr_payslip_tree" model="ir.ui.view"> + <field name="name">hr.payslip.tree</field> + <field name="model">hr.payslip</field> + <field name="arch" type="xml"> + <tree decoration-info="state in ('done')" + decoration-muted="state == 'cancel'" string="Payslips"> + <field name="number"/> + <field name="employee_id"/> + <field name="name"/> + <field name="date_from"/> + <field name="date_to"/> + <field name="state"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + <field name="payslip_run_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="hr_payslip_view_kanban" model="ir.ui.view"> + <field name="name">hr.payslip.kanban</field> + <field name="model">hr.payslip</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_content oe_kanban_global_click"> + <div class="row"> + <div class="col-6"> + <strong> + <field name="employee_id"/> + </strong> + </div> + <div class="col-6"> + <span class="float-right badge badge-secondary"> + <field name="state"/> + </span> + </div> + <div class="col-12"> + <span> + <field name="date_from"/> + - + <field name="date_to"/> + </span> + </div> + <div class="col-12"> + <span> + <field name="name"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="act_payslip_lines" model="ir.actions.act_window"> + <field name="name">Payslip Computation Details</field> + <field name="res_model">hr.payslip.line</field> + <field name="context">{'default_slip_id': active_id,'search_default_slip_id': active_id}</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="arch" type="xml"> + <form string="Payslip"> + <header> + <button string="Confirm" name="action_payslip_done" type="object" states="draft" + class="oe_highlight"/> + <button string="Refund" name="refund_sheet" states="confirm,done" type='object'/> + <button string="Set to Draft" name="action_payslip_draft" type="object" states="cancel"/> + <button string="Compute Sheet" name="compute_sheet" type="object" states="draft" + class="oe_highlight"/> + <button string="Cancel Payslip" name="action_payslip_cancel" type="object" + states="draft,done,verify"/> + <button string="Send E-Mail" name="action_send_email" type="object" + class="oe_highlight" states="done,verify"/> + <field name="state" widget="statusbar" statusbar_visible="draft,confirm"/> + </header> + <sheet> + <div class="oe_button_box" name="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" placeholder="Employee"/> + </h1> + </div> + <group col="4"> + <label for="date_from" string="Period"/> + <div> + <field name="date_from" class="oe_inline"/> + - + <field name="date_to" class="oe_inline"/> + </div> + <field name="contract_id" + domain="[('employee_id','=',employee_id),('date_start','<=',date_to),'|',('date_end','>=',date_from),('date_end','=',False)]" + context="{'default_employee_id': employee_id}"/> + <field name="number"/> + <field name="struct_id" attrs="{'required':[('contract_id','!=',False)]}"/> + <field name="name"/> + <field name="credit_note"/> + </group> + <notebook> + <page string="Worked Days & Inputs"> + <separator string="Worked Days"/> + <field name="worked_days_line_ids"> + <tree string="Worked Days" editable="bottom"> + <field name="name"/> + <field name="code"/> + <field name="number_of_days" sum="Total Working Days"/> + <field name="number_of_hours"/> + <field name="contract_id"/> + <field name="sequence" invisible="True"/> + </tree> + <form string="Worked Day"> + <group col="4"> + <field name="name"/> + <field name="code"/> + <field name="sequence"/> + <field name="number_of_days"/> + <field name="number_of_hours"/> + <field name="contract_id"/> + </group> + </form> + </field> + <separator string="Other Inputs"/> + <field name="input_line_ids" colspan="4" nolabel="1"> + <tree string="Input Data" editable="bottom"> + <field name="name"/> + <field name="code"/> + <field name="amount"/> + <field name="contract_id"/> + <field name="sequence" invisible="True"/> + </tree> + <form string="Payslip Line"> + <group col="4"> + <field name="name"/> + <field name="code"/> + <field name="sequence"/> + <field name="amount"/> + <field name="contract_id"/> + </group> + </form> + </field> + </page> + <page string="Salary Computation"> + <field name="line_ids" colspan="4" nolabel="1"> + <tree string="Salary Structure" editable="bottom" decoration-info="total == 0"> + <field name="name"/> + <field name="code"/> + <field name="category_id"/> + <field name="sequence" invisible="1"/> + <field name="quantity"/> + <field name="rate"/> + <field name="salary_rule_id"/> + <field name="amount"/> + <field name="total"/> + </tree> + <form string="Payslip Line"> + <group col="4"> + <field name="name"/> + <field name="code"/> + <field name="category_id"/> + <field name="sequence"/> + <field name="quantity"/> + <field name="rate"/> + <field name="amount"/> + <field name="total"/> + <field name="salary_rule_id"/> + </group> + </form> + </field> + </page> + <page string="Details By Salary Rule Category"> + <field name="details_by_salary_rule_category" context="{'group_by':'category_id'}" + domain="[('appears_on_payslip', '=', True)]"> + <tree string="Payslip Lines" decoration-info="total == 0"> + <field name="category_id"/> + <field name="name"/> + <field name="code"/> + <field name="total"/> + </tree> + </field> + </page> + <page string="Accounting Information"> + <group> + <group string="Miscellaneous"> + <field name="company_id" groups="base.group_multi_company"/> + <field name="payslip_run_id" domain="[('state','=','draft')]"/> + </group> + <group name="accounting" string="Accounting"> + <field name="paid" readonly="1"/> + </group> + </group> + <div colspan="4"> + <field name="note" placeholder="Add an internal note..."/> + </div> + </page> + </notebook> + </sheet> + </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="arch" type="xml"> + <search string="Search Payslips"> + <field name="name" string="Payslips" + filter_domain="['|',('name','ilike',self),('number','ilike',self)]"/> + <field name="date_from"/> + <filter string="Draft" name="draft" domain="[('state','=','draft')]" help="Draft Slip"/> + <filter string="Done" name="done" domain="[('state','=','done')]" help="Done Slip"/> + <field name="employee_id"/> + <field name="payslip_run_id"/> + <group expand="0" string="Group By"> + <filter string="Employees" name="employee_id" context="{'group_by':'employee_id'}"/> + <filter string="PaySlip Batch" name="payslip_run_id" context="{'group_by':'payslip_run_id'}"/> + <filter string="Companies" name="company_id" groups="base.group_multi_company" + context="{'group_by':'company_id'}"/> + <filter string="States" name="state" context="{'group_by':'state'}"/> + </group> + </search> + </field> + </record> + + <record id="action_view_hr_payslip_form" model="ir.actions.act_window"> + <field name="name">Employee Payslips</field> + <field name="res_model">hr.payslip</field> + <field name="view_mode">tree,kanban,form</field> + <field name="search_view_id" ref="view_hr_payslip_filter"/> + </record> + + <menuitem id="menu_department_tree" + action="action_view_hr_payslip_form" + parent="menu_hr_payroll_root" + groups="om_hr_payroll.group_hr_payroll_user"/> + + <record id="act_hr_employee_payslip_list" model="ir.actions.act_window"> + <field name="res_model">hr.payslip</field> + <field name="name">Payslips</field> + <field name="view_mode">tree,form</field> + <field name="context">{'search_default_employee_id': [active_id], 'default_employee_id': active_id}</field> + </record> + + <!-- payslip runs --> + + <record id="hr_payslip_run_filter" model="ir.ui.view"> + <field name="name">hr.payslip.run.search</field> + <field name="model">hr.payslip.run</field> + <field name="arch" type="xml"> + <search string="Search Payslip Batches"> + <field name="name" string="Payslip Batches"/> + <field name="date_start"/> + <field name="date_end"/> + <filter string="Draft" name="draft" domain="[('state','=','draft')]" help="Draft Payslip Batches"/> + <filter name="done_filter" string="Done" domain="[('state','=','close')]" + help="Done Payslip Batches"/> + </search> + </field> + </record> + + <record id="hr_payslip_run_tree" model="ir.ui.view"> + <field name="name">hr.payslip.run.tree</field> + <field name="model">hr.payslip.run</field> + <field name="arch" type="xml"> + <tree string="Payslips Batches"> + <field name="name"/> + <field name="date_start"/> + <field name="date_end"/> + <field name="credit_note"/> + <field name="state"/> + </tree> + </field> + </record> + + <record id="hr_payslip_run_view_kanban" model="ir.ui.view"> + <field name="name">hr.payslip.run.kanban</field> + <field name="model">hr.payslip.run</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_content oe_kanban_global_click"> + <div class="row"> + <div class="col-6"> + <strong> + <field name="name"/> + </strong> + </div> + <div class="col-6"> + <span class="float-right badge badge-secondary"> + <field name="state"/> + </span> + </div> + <div class="col-12"> + <span> + <field name="date_start"/> + - + <field name="date_end"/> + </span> + <span class="float-right" title="Is a Blocking Reason?"> + <field name="credit_note" widget="boolean"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_payslip_run_form" model="ir.ui.view"> + <field name="name">hr.payslip.run.form</field> + <field name="model">hr.payslip.run</field> + <field name="arch" type="xml"> + <form string="Payslips Batches"> + <header> + <button name="%(action_hr_payslip_by_employees)d" type="action" states="draft" + string="Generate Payslips" class="oe_highlight"/> + <button string="Set to Draft" name="draft_payslip_run" type="object" states="close"/> + <button string="Mark As Done" name="done_payslip_run" type="object" states="draft" + class="oe_highlight"/> + <button name="close_payslip_run" type="object" string="Close" states="draft"/> + <field name="state" widget="statusbar"/> + </header> + <sheet> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name"/> + </h1> + <group col="4"> + <label for="date_start" string="Period"/> + <div> + <field name="date_start" class="oe_inline"/> + - + <field name="date_end" class="oe_inline"/> + </div> + <field name="credit_note"/> + </group> + <separator string="Payslips"/> + <field name="slip_ids"/> + </sheet> + </form> + </field> + </record> + + <record id="action_hr_payslip_run_tree" model="ir.actions.act_window"> + <field name="name">Payslips Batches</field> + <field name="res_model">hr.payslip.run</field> + <field name="view_mode">tree,kanban,form</field> + <field name="search_view_id" ref="hr_payslip_run_filter"/> + </record> + + <menuitem id="menu_hr_payslip_run" + action="action_hr_payslip_run_tree" + parent="menu_hr_payroll_root"/> + + <!-- Shortcuts --> + + <record id="act_contribution_reg_payslip_lines" model="ir.actions.act_window"> + <field name="name">Payslip Lines</field> + <field name="res_model">hr.payslip.line</field> + <field name="domain">[('register_id', '=', active_id)]</field> + <field name="context">{'default_register_id': active_id, 'search_default_register_id': 1}</field> + </record> + + </data> + +</odoo>
\ No newline at end of file diff --git a/om_hr_payroll/views/hr_salary_rule_views.xml b/om_hr_payroll/views/hr_salary_rule_views.xml new file mode 100644 index 0000000..282c990 --- /dev/null +++ b/om_hr_payroll/views/hr_salary_rule_views.xml @@ -0,0 +1,437 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <!-- Salary structure --> + <record id="view_hr_payroll_structure_list_view" model="ir.ui.view"> + <field name="name">hr.payroll.structure.tree</field> + <field name="model">hr.payroll.structure</field> + <field name="arch" type="xml"> + <tree string="Employee Function"> + <field name="name"/> + <field name="code"/> + <field name="rule_ids"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </tree> + </field> + </record> + + <record id="hr_payroll_structure_view_kanban" model="ir.ui.view"> + <field name="name">hr.payroll.structure.kanban</field> + <field name="model">hr.payroll.structure</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_content oe_kanban_global_click"> + <div class="row"> + <div class="col-12"> + <strong> + <field name="name"/> + </strong> + </div> + </div> + <div class="row"> + <div class="col-12"> + <span>Code: + <field name="code"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="view_hr_payroll_structure_tree" model="ir.ui.view"> + <field name="name">hr.payroll.structure.tree</field> + <field name="model">hr.payroll.structure</field> + <field name="field_parent">children_ids</field> + <field name="arch" type="xml"> + <tree string="Salary Structure"> + <field name="name"/> + <field name="code"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </tree> + </field> + </record> + + <record id="view_hr_payroll_structure_filter" model="ir.ui.view"> + <field name="name">hr.payroll.structure.select</field> + <field name="model">hr.payroll.structure</field> + <field name="arch" type="xml"> + <search string="Payroll Structures"> + <field name="name" string="Payroll Structures" + filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/> + </search> + </field> + </record> + + <record id="view_hr_employee_grade_form" model="ir.ui.view"> + <field name="name">hr.payroll.structure.form</field> + <field name="model">hr.payroll.structure</field> + <field name="arch" type="xml"> + <form string="Employee Function"> + <group col="4"> + <field name="name"/> + <field name="code"/> + <field name="parent_id"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </group> + <notebook colspan="4"> + <page string="Salary Rules"> + <field name="rule_ids" domain="[('parent_rule_id','=',False)]"> + <tree> + <field name="name"/> + <field name="code"/> + <field name="category_id"/> + <field name="sequence" invisible="1"/> + <field name="register_id"/> + </tree> + </field> + </page> + </notebook> + </form> + </field> + </record> + + <record id="action_view_hr_payroll_structure_list_form" model="ir.actions.act_window"> + <field name="name">Salary Structures</field> + <field name="res_model">hr.payroll.structure</field> + <field name="view_mode">tree,kanban,form</field> + </record> + + <menuitem + id="menu_hr_payroll_structure_view" + action="action_view_hr_payroll_structure_list_form" + parent="menu_hr_payroll_configuration" + sequence="2" + /> + + <record id="hr_salary_rule_category_form" model="ir.ui.view"> + <field name="name">hr.salary.rule.category.form</field> + <field name="model">hr.salary.rule.category</field> + <field name="arch" type="xml"> + <form string="Salary Categories"> + <group col="4"> + <field name="name"/> + <field name="code"/> + <field name="parent_id"/> + </group> + <group string="Notes"> + <field name="note" nolabel="1"/> + </group> + </form> + </field> + </record> + + <record id="hr_salary_rule_category_tree" model="ir.ui.view"> + <field name="name">hr.salary.rule.category.tree</field> + <field name="model">hr.salary.rule.category</field> + <field name="arch" type="xml"> + <tree string="Salary Rule Categories"> + <field name="name"/> + <field name="code"/> + <field name="parent_id" invisible="1"/> + </tree> + </field> + </record> + + <record id="view_hr_salary_rule_category_filter" model="ir.ui.view"> + <field name="name">hr.salary.rule.category.select</field> + <field name="model">hr.salary.rule.category</field> + <field name="arch" type="xml"> + <search string="Salary Rule Categories"> + <field name="name" string="Salary Rule Categories" + filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/> + </search> + </field> + </record> + + <record id="action_hr_salary_rule_category" model="ir.actions.act_window"> + <field name="name">Salary Rule Categories</field> + <field name="res_model">hr.salary.rule.category</field> + <field name="view_id" ref="hr_salary_rule_category_tree"/> + <field name="search_view_id" ref="view_hr_salary_rule_category_filter"/> + </record> + + <menuitem + id="menu_hr_salary_rule_category" + action="action_hr_salary_rule_category" + parent="menu_hr_payroll_configuration" + sequence="11" + groups="base.group_no_one" + /> + + <!-- + Contribution Register + --> + <record id="hr_contribution_register_tree" model="ir.ui.view"> + <field name="name">hr.contribution.register.tree</field> + <field name="model">hr.contribution.register</field> + <field name="arch" type="xml"> + <tree string="Contribution Registers"> + <field name="name"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </tree> + </field> + </record> + + <record id="hr_contribution_register_view_kanban" model="ir.ui.view"> + <field name="name">hr.contribution.register.kanban</field> + <field name="model">hr.contribution.register</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_content oe_kanban_global_click"> + <div class="row"> + <div class="col-12"> + <strong> + <field name="name"/> + </strong> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_contribution_register_filter" model="ir.ui.view"> + <field name="name">hr.contribution.register.search</field> + <field name="model">hr.contribution.register</field> + <field name="arch" type="xml"> + <search string="Contribution Registers"> + <field name="name" string="Contribution Registers"/> + <field name="company_id" groups="base.group_multi_company"/> + </search> + </field> + </record> + + <record id="hr_contribution_register_form" model="ir.ui.view"> + <field name="name">hr.contribution.register.form</field> + <field name="model">hr.contribution.register</field> + <field name="arch" type="xml"> + <form string="Contribution"> + <group> + <field name="name"/> + <field name="partner_id"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}" + class="oe_inline"/> + </group> + <newline/> + <group> + <separator string="Description"/> + <newline/> + <field name="note" nolabel="1"/> + </group> + </form> + </field> + </record> + + <record id="action_contribution_register_form" model="ir.actions.act_window"> + <field name="name">Contribution Registers</field> + <field name="res_model">hr.contribution.register</field> + <field name="view_mode">tree,kanban,form</field> + <field name="help" type="html"> + <p class="o_view_nocontent_smiling_face"> + Add a new contribution register + </p> + <p> + A contribution register is a third party involved in the salary + payment of the employees. It can be the social security, the + state or anyone that collect or inject money on payslips. + </p> + </field> + </record> + + <menuitem + id="menu_action_hr_contribution_register_form" + action="action_contribution_register_form" + parent="menu_hr_payroll_configuration" + sequence="14" + /> + + <!-- Salary Rules --> + + <record id="hr_salary_rule_list" model="ir.ui.view"> + <field name="name">hr.salary.rule.list</field> + <field name="model">hr.salary.rule</field> + <field name="arch" type="xml"> + <tree string="Salary Rules"> + <field name="name"/> + <field name="code"/> + <field name="category_id"/> + <field name="sequence" invisible="1"/> + <field name="register_id"/> + </tree> + </field> + </record> + + <record id="hr_salary_rule_view_kanban" model="ir.ui.view"> + <field name="name">hr.salary.rule.kanban</field> + <field name="model">hr.salary.rule</field> + <field name="arch" type="xml"> + <kanban class="o_kanban_mobile"> + <templates> + <t t-name="kanban-box"> + <div t-attf-class="oe_kanban_content oe_kanban_global_click"> + <div class="row"> + <div class="col-8"> + <strong> + <field name="name"/> + </strong> + </div> + <div class="col-4"> + <span class="float-right"> + <field name="category_id"/> + </span> + </div> + </div> + <div class="row"> + <div class="col-12"> + <span>Code: + <field name="code"/> + </span> + </div> + </div> + </div> + </t> + </templates> + </kanban> + </field> + </record> + + <record id="hr_salary_rule_tree" model="ir.ui.view"> + <field name="name">hr.salary.rule.tree</field> + <field name="model">hr.salary.rule</field> + <field name="field_parent">child_ids</field> + <field eval="20" name="priority"/> + <field name="arch" type="xml"> + <tree string="Salary Rules"> + <field name="name"/> + <field name="code"/> + <field name="category_id" invisible="True"/> + <field name="company_id" groups="base.group_multi_company" options="{'no_create': True}"/> + </tree> + </field> + </record> + + <record id="hr_salary_rule_form" model="ir.ui.view"> + <field name="name">hr.salary.rule.form</field> + <field name="model">hr.salary.rule</field> + <field name="arch" type="xml"> + <form string="Salary Rules"> + <label for="name" class="oe_edit_only"/> + <h1> + <field name="name"/> + </h1> + <label for="category_id" class="oe_edit_only"/> + <h2> + <field name="category_id"/> + </h2> + + <group col="4"> + <field name="code"/> + <field name="sequence"/> + <field name="active"/> + <field name="appears_on_payslip"/> + <field name="company_id" options="{'no_create': True}" groups="base.group_multi_company"/> + </group> + <notebook colspan="6"> + <page string="General"> + <group col="4"> + <separator colspan="4" string="Conditions"/> + <field name="condition_select"/> + <newline/> + <field name="condition_python" + attrs="{'invisible':[('condition_select','!=','python')], 'required': [('condition_select','=','python')]}" + colspan="4"/> + <newline/> + <field name="condition_range" + attrs="{'invisible':[('condition_select','!=','range')], 'required':[('condition_select','=','range')]}"/> + <newline/> + <field name="condition_range_min" colspan="2" + attrs="{'invisible':[('condition_select','!=','range')], 'required':[('condition_select','=','range')]}"/> + <newline/> + <field name="condition_range_max" colspan="2" + attrs="{'invisible':[('condition_select','!=','range')], 'required':[('condition_select','=','range')]}"/> + <newline/> + <separator colspan="4" string="Computation"/> + <field name="amount_select"/> + <newline/> + <field name="amount_percentage_base" + attrs="{'invisible':[('amount_select','!=','percentage')], 'required': [('amount_select','=','percentage')]}"/> + <newline/> + <field name="quantity" + attrs="{'invisible':[('amount_select','=','code')], 'required':[('amount_select','!=','code')]}"/> + <newline/> + <field name="amount_fix" + attrs="{'invisible':[('amount_select','!=','fix')], 'required':[('amount_select','=','fix')]}"/> + <newline/> + <field colspan="4" name="amount_python_compute" + attrs="{'invisible':[('amount_select','!=','code')], 'required':[('amount_select','=','code')]}"/> + <field name="amount_percentage" + attrs="{'invisible':[('amount_select','!=','percentage')], 'required':[('amount_select','=','percentage')]}"/> + <separator colspan="4" string="Company Contribution"/> + <field name="register_id"/> + </group> + </page> + <page name="rules" string="Child Rules"> + <field name="parent_rule_id"/> + <separator string="Children Definition"/> + <field name="child_ids"/> + </page> + <page string="Inputs"> + <field name="input_ids" mode="tree"> + <tree string="Input Data" editable="bottom"> + <field name="name"/> + <field name="code"/> + </tree> + </field> + </page> + <page string="Description"> + <field name="note"/> + </page> + </notebook> + </form> + </field> + </record> + + <record id="view_hr_rule_filter" model="ir.ui.view"> + <field name="name">hr.salary.rule.select</field> + <field name="model">hr.salary.rule</field> + <field name="arch" type="xml"> + <search string="Search Salary Rule"> + <field name="name" string="Salary Rules" + filter_domain="['|',('name','ilike',self),('code','ilike',self)]"/> + <field name="category_id"/> + <field name="condition_range_min"/> + <group col="8" colspan="4" expand="0" string="Group By"> + <filter string="Category" name="head" context="{'group_by':'category_id'}"/> + </group> + </search> + </field> + </record> + + <record id="action_salary_rule_form" model="ir.actions.act_window"> + <field name="name">Salary Rules</field> + <field name="res_model">hr.salary.rule</field> + <field name="view_mode">tree,kanban,form</field> + <field name="domain">[('parent_rule_id','=',False)]</field> + <field name="search_view_id" ref="view_hr_rule_filter"/> + </record> + + <menuitem id="menu_action_hr_salary_rule_form" action="action_salary_rule_form" + parent="menu_hr_payroll_configuration" sequence="12"/> + + <record id="act_children_salary_rules" model="ir.actions.act_window"> + <field name="name">All Children Rules</field> + <field name="res_model">hr.salary.rule</field> + <field name="domain">[('parent_rule_id', '=', active_id)]</field> + </record> + +</odoo> diff --git a/om_hr_payroll/views/report_contribution_register_templates.xml b/om_hr_payroll/views/report_contribution_register_templates.xml new file mode 100644 index 0000000..30472cb --- /dev/null +++ b/om_hr_payroll/views/report_contribution_register_templates.xml @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <template id="report_contribution_register"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="o"> + <t t-call="web.external_layout"> + <div class="page"> + <h2>PaySlip Lines by Contribution Register</h2> + <div class="row mt32 mb32"> + <div class="col-3"> + <strong>Register Name:</strong> + <p t-field="o.name"/> + </div> + <div class="col-3"> + <strong>Date From:</strong> + <p t-esc="data['form']['date_from']"/> + </div> + <div class="col-3"> + <strong>Date To:</strong> + <p t-esc="data['form']['date_to']"/> + </div> + </div> + + <table class="table table-sm"> + <thead> + <tr> + <th>PaySlip Name</th> + <th>Code</th> + <th>Name</th> + <th>Quantity/Rate</th> + <th>Amount</th> + <th>Total</th> + </tr> + </thead> + <tbody> + <tr t-foreach="lines_data.get(o.id, [])" t-as="line"> + <td> + <span t-esc="line.slip_id.name"/> + </td> + <td> + <span t-esc="line.code"/> + </td> + <td> + <span t-esc="line.name"/> + </td> + <td> + <span t-esc="line.quantity"/> + </td> + <td class="text-right"> + <span t-esc="line.amount" + t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + <td class="text-right"> + <span t-esc="line.total" + t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + </tr> + </tbody> + </table> + + <div class="row justify-content-end"> + <div class="col-4"> + <table class="table table-sm"> + <tr class="border-black"> + <td> + <strong>Total</strong> + </td> + <td class="text-right"> + <span t-esc="lines_total.get(o.id)" + t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + </tr> + </table> + </div> + </div> + </div> + </t> + </t> + </t> + </template> + +</odoo> diff --git a/om_hr_payroll/views/report_payslip_details_templates.xml b/om_hr_payroll/views/report_payslip_details_templates.xml new file mode 100644 index 0000000..6bafa2d --- /dev/null +++ b/om_hr_payroll/views/report_payslip_details_templates.xml @@ -0,0 +1,148 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <template id="report_payslip_details"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="o"> + <t t-call="web.external_layout"> + <div class="page"> + <h2>Pay Slip</h2> + <p t-field="o.name"/> + + <table class="table table-sm table-bordered"> + <tr> + <td> + <strong>Name</strong> + </td> + <td> + <span t-field="o.employee_id"/> + </td> + <td> + <strong>Designation</strong> + </td> + <td> + <span t-field="o.employee_id.job_id"/> + </td> + </tr> + <tr> + <td> + <strong>Address</strong> + </td> + <td colspan="3"> + <div t-field="o.employee_id.address_home_id" + t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> + </td> + </tr> + <tr> + <td> + <strong>Email</strong> + </td> + <td> + <span t-field="o.employee_id.work_email"/> + </td> + <td> + <strong>Identification No</strong> + </td> + <td> + <span t-field="o.employee_id.identification_id"/> + </td> + </tr> + <tr> + <td> + <strong>Reference</strong> + </td> + <td> + <span t-field="o.number"/> + </td> + <td> + <strong>Bank Account</strong> + </td> + <td> + <span t-field="o.employee_id.bank_account_id"/> + </td> + </tr> + <tr> + <td> + <strong>Date From</strong> + </td> + <td> + <span t-field="o.date_from"/> + </td> + <td> + <strong>Date To</strong> + </td> + <td> + <span t-field="o.date_to"/> + </td> + </tr> + </table> + + <h3>Details by Salary Rule Category</h3> + <table class="table table-sm mb32"> + <thead> + <tr> + <th>Code</th> + <th>Salary Rule Category</th> + <th>Total</th> + </tr> + </thead> + <tbody> + <tr t-foreach="get_details_by_rule_category.get(o.id, [])" t-as="h"> + <td> + <span t-esc="h['code']"/> + </td> + <td> + <span t-esc="'..'*h['level']"/> + <span t-esc="h['rule_category']"/> + </td> + <td class="text-right"> + <span t-esc="h['total']" + t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + </tr> + </tbody> + </table> + + <h3>Payslip Lines by Contribution Register</h3> + <table class="table table-sm mt32"> + <thead> + <tr> + <th>Code</th> + <th>Name</th> + <th>Quantity/rate</th> + <th>Amount</th> + <th>Total</th> + </tr> + </thead> + <tbody> + <tr t-foreach="get_lines_by_contribution_register.get(o.id, [])" t-as="p"> + <td> + <span t-esc="p.get('code', '')"/> + </td> + <td> + <span t-esc="p.get('name', '')"/> + </td> + <td> + <span t-esc="p.get('quantity', '')"/> + </td> + <td> + <span t-esc="p.get('amount', 0)"/> + </td> + <td class="text-right"> + <span t-esc="p.get('total', 0)" + t-esc-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + </tr> + </tbody> + </table> + + <p class="text-right"> + <strong>Authorized signature</strong> + </p> + </div> + </t> + </t> + </t> + </template> + +</odoo> diff --git a/om_hr_payroll/views/report_payslip_templates.xml b/om_hr_payroll/views/report_payslip_templates.xml new file mode 100644 index 0000000..35fc060 --- /dev/null +++ b/om_hr_payroll/views/report_payslip_templates.xml @@ -0,0 +1,123 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <template id="report_payslip"> + <t t-call="web.html_container"> + <t t-foreach="docs" t-as="o"> + <t t-call="web.external_layout"> + <div class="page"> + <h2>Pay Slip</h2> + <p t-field="o.name"/> + + <table class="table table-sm table-bordered"> + <tr> + <td> + <strong>Name</strong> + </td> + <td> + <span t-field="o.employee_id"/> + </td> + <td> + <strong>Designation</strong> + </td> + <td> + <span t-field="o.employee_id.job_id"/> + </td> + </tr> + <tr> + <td> + <strong>Address</strong> + </td> + <td colspan="3"> + <div t-field="o.employee_id.address_home_id" + t-options='{"widget": "contact", "fields": ["address", "name", "phone"], "no_marker": True, "phone_icons": True}'/> + </td> + </tr> + <tr> + <td> + <strong>Email</strong> + </td> + <td> + <span t-field="o.employee_id.work_email"/> + </td> + <td> + <strong>Identification No</strong> + </td> + <td> + <span t-field="o.employee_id.identification_id"/> + </td> + </tr> + <tr> + <td> + <strong>Reference</strong> + </td> + <td> + <span t-field="o.number"/> + </td> + <td> + <strong>Bank Account</strong> + </td> + <td> + <span t-field="o.employee_id.bank_account_id"/> + </td> + </tr> + <tr> + <td> + <strong>Date From</strong> + </td> + <td> + <span t-field="o.date_from"/> + </td> + <td> + <strong>Date To</strong> + </td> + <td> + <span t-field="o.date_to"/> + </td> + </tr> + </table> + + <table class="table table-sm"> + <thead> + <tr> + <th>Code</th> + <th>Name</th> + <th>Quantity/rate</th> + <th>Amount</th> + <th>Total</th> + </tr> + </thead> + <tbody> + <tr t-foreach="o.line_ids.filtered(lambda line: line.appears_on_payslip)" t-as="line"> + <td> + <span t-field="line.code"/> + </td> + <td> + <span t-field="line.name"/> + </td> + <td> + <span t-field="line.quantity"/> + </td> + <td> + <span t-esc="line.amount" + t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + <td> + <span t-esc="line.total" + t-options='{"widget": "monetary", "display_currency": o.company_id.currency_id}'/> + </td> + + </tr> + </tbody> + </table> + + <p class="text-right"> + <strong>Authorized signature</strong> + </p> + </div> + </t> + </t> + </t> + </template> + +</odoo> diff --git a/om_hr_payroll/views/res_config_settings_views.xml b/om_hr_payroll/views/res_config_settings_views.xml new file mode 100644 index 0000000..c50d05b --- /dev/null +++ b/om_hr_payroll/views/res_config_settings_views.xml @@ -0,0 +1,53 @@ +<?xml version="1.0" encoding="utf-8"?> +<odoo> + + <record id="res_config_settings_view_form" model="ir.ui.view"> + <field name="name">res.config.settings.view.form.inherit.hr.payroll</field> + <field name="model">res.config.settings</field> + <field name="priority" eval="45"/> + <field name="inherit_id" ref="base.res_config_settings_view_form"/> + <field name="arch" type="xml"> + <xpath expr="//div[hasclass('settings')]" position="inside"> + <div class="app_settings_block" data-string="Payroll" string="Payroll" data-key="om_hr_payroll" + groups="om_hr_payroll.group_hr_payroll_manager"> + <h2>Accounting</h2> + <div class="row mt16 o_settings_container" id="om_hr_payroll_account"> + <div class="col-lg-6 col-12 o_setting_box"> + <div class="o_setting_left_pane"> + <field name="module_om_hr_payroll_account"/> + </div> + <div class="o_setting_right_pane"> + <label for="module_om_hr_payroll_account" string="Payroll Entries"/> + <div class="text-muted"> + Post payroll slips in accounting + </div> + </div> + <div class="o_setting_right_pane"> + <a target="_blank" href="https://apps.odoo.com/apps/modules/14.0/om_hr_payroll_account/" + style="text-decoration: underline;">HR Payroll Accounting + </a> + </div> + </div> + </div> + </div> + </xpath> + </field> + </record> + + <record id="action_hr_payroll_configuration" model="ir.actions.act_window"> + <field name="name">Settings</field> + <field name="type">ir.actions.act_window</field> + <field name="res_model">res.config.settings</field> + <field name="view_mode">form</field> + <field name="target">inline</field> + <field name="context">{'module' : 'om_hr_payroll'}</field> + </record> + + <menuitem id="menu_hr_payroll_global_settings" + name="Settings" + parent="menu_hr_payroll_configuration" + sequence="0" + action="action_hr_payroll_configuration" + groups="base.group_system"/> + +</odoo> |
