143 lines
6.0 KiB
XML
143 lines
6.0 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<odoo>
|
|
|
|
<!-- ============ 列表视图 ============ -->
|
|
<record id="view_yuthon_payslip_list" model="ir.ui.view">
|
|
<field name="name">yuthon.payslip.list</field>
|
|
<field name="model">yuthon.payslip</field>
|
|
<field name="arch" type="xml">
|
|
<list string="工资条" decoration-info="state == 'draft'">
|
|
<field name="employee_id"/>
|
|
<field name="period_start"/>
|
|
<field name="period_end"/>
|
|
<field name="basic_wage"/>
|
|
<field name="allowance"/>
|
|
<field name="late_count"/>
|
|
<field name="absent_days"/>
|
|
<field name="attendance_deduction"/>
|
|
<field name="net_salary" decoration-bf="1"/>
|
|
<field name="state"/>
|
|
</list>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============ 表单视图 ============ -->
|
|
<record id="view_yuthon_payslip_form" model="ir.ui.view">
|
|
<field name="name">yuthon.payslip.form</field>
|
|
<field name="model">yuthon.payslip</field>
|
|
<field name="arch" type="xml">
|
|
<form string="工资条">
|
|
<header>
|
|
<button name="action_confirm" type="object"
|
|
string="确认" class="btn-primary" invisible="state != 'draft'"/>
|
|
<button name="action_draft" type="object"
|
|
string="转草稿" invisible="state != 'done'"/>
|
|
<field name="state" widget="statusbar"/>
|
|
</header>
|
|
<sheet>
|
|
<group>
|
|
<group>
|
|
<field name="employee_id"/>
|
|
<field name="period_start"/>
|
|
<field name="period_end"/>
|
|
<field name="state" invisible="1"/>
|
|
</group>
|
|
<group>
|
|
<field name="basic_wage"/>
|
|
<field name="allowance"/>
|
|
</group>
|
|
</group>
|
|
<group>
|
|
<group string="出勤聚合">
|
|
<field name="late_count"/>
|
|
<field name="absent_days"/>
|
|
</group>
|
|
<group string="扣款与实发">
|
|
<field name="late_deduction"/>
|
|
<field name="absent_deduction"/>
|
|
<field name="attendance_deduction"/>
|
|
<field name="net_salary" decoration-bf="1"/>
|
|
</group>
|
|
</group>
|
|
</sheet>
|
|
</form>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============ 搜索视图 ============ -->
|
|
<record id="view_yuthon_payslip_search" model="ir.ui.view">
|
|
<field name="name">yuthon.payslip搜索</field>
|
|
<field name="model">yuthon.payslip</field>
|
|
<field name="arch" type="xml">
|
|
<search string="搜索工资条">
|
|
<field name="employee_id"/>
|
|
<field name="period_start"/>
|
|
<field name="period_end"/>
|
|
<separator/>
|
|
<filter name="filter_draft" string="草稿"
|
|
domain="[('state', '=', 'draft')]"/>
|
|
<filter name="filter_done" string="已确认"
|
|
domain="[('state', '=', 'done')]"/>
|
|
<separator/>
|
|
<group expand="0" string="分组">
|
|
<filter name="groupby_employee" string="按教职工"
|
|
context="{'group_by': 'employee_id'}"/>
|
|
</group>
|
|
</search>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============ 动作 ============ -->
|
|
<record id="action_yuthon_payslip" model="ir.actions.act_window">
|
|
<field name="name">工资条</field>
|
|
<field name="res_model">yuthon.payslip</field>
|
|
<field name="view_mode">list,form</field>
|
|
<field name="search_view_id" ref="view_yuthon_payslip_search"/>
|
|
<field name="help" type="html">
|
|
<p class="o_view_nocontent_smiling_face">
|
|
先用「生成月度工资条」创建第一张工资条
|
|
</p>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- ============ 子菜单(挂载到员工模块的根菜单) ============ -->
|
|
<menuitem id="menu_yuthon_payslip" name="薪资"
|
|
parent="yuthon_employee.menu_yuthon_hr_root"
|
|
action="action_yuthon_payslip" sequence="30"/>
|
|
|
|
<!-- ============ 注入「教职工」视图(模块组合演示) ============ -->
|
|
<!-- 列表:追加工资条数列 -->
|
|
<record id="view_yuthon_employee_list_salary" model="ir.ui.view">
|
|
<field name="name">yuthon.employee.list.inherit.salary</field>
|
|
<field name="model">yuthon.employee</field>
|
|
<field name="inherit_id" ref="yuthon_employee.view_yuthon_employee_list"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//field[@name='attendance_count']" position="after">
|
|
<field name="payslip_count"/>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
<!-- 表单:注入工资条页 -->
|
|
<record id="view_yuthon_employee_form_salary" model="ir.ui.view">
|
|
<field name="name">yuthon.employee.form.inherit.salary</field>
|
|
<field name="model">yuthon.employee</field>
|
|
<field name="inherit_id" ref="yuthon_employee.view_yuthon_employee_form"/>
|
|
<field name="arch" type="xml">
|
|
<xpath expr="//notebook" position="inside">
|
|
<page string="工资条">
|
|
<field name="payslip_ids">
|
|
<list>
|
|
<field name="period_start"/>
|
|
<field name="period_end"/>
|
|
<field name="net_salary"/>
|
|
<field name="state"/>
|
|
</list>
|
|
</field>
|
|
</page>
|
|
</xpath>
|
|
</field>
|
|
</record>
|
|
|
|
</odoo>
|