Files
gzth/yuthon_contract/views/inherit_hr_contract_views.xml
T
2026-06-30 11:48:23 +08:00

189 lines
11 KiB
XML

<?xml version="1.0" encoding="UTF-8" ?>
<odoo>
<record id="inherit_hr_contract_yuthon_tree" model="ir.ui.view">
<field name="name">inherit.hr.contract.yuthon.tree</field>
<field name="model">hr.contract</field>
<field name="inherit_id" ref="hr_contract.hr_contract_view_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<header>
<button name="renew" string="续签" type="object" class="btn btn-primary"/>
<button name="pub_leaving_employee" string="离职" type="object" class="btn btn-primary"/>
<button name="yuthon_employee_add" string="合同补充" type="object" class="btn btn-primary"/>
<button name="init_change_lines" string="初始化数据" type="object" class="btn btn-primary"/>
</header>
</xpath>
<xpath expr="//field[@name='employee_id']" position="attributes">
<attribute name="widget">false</attribute>
</xpath>
<xpath expr="//field[@name='company_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='resource_calendar_id']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='date_end']" position="after">
<field name="date_of_entry"/>
</xpath>
<xpath expr="//field[@name='job_id']" position="after">
<field name="start_date"/>
</xpath>
<xpath expr="//field[@name='date_start']" position="before">
<field name="end_date"/>
</xpath>
<!-- <xpath expr="//field[@name='date_end']" position="before">-->
<!-- <field name="termination_date"/>-->
<!-- </xpath>-->
<xpath expr="//field[@name='employee_id']" position="after">
<field name="contract_type_id" string="用工形式"/>
<!-- <field name="version"/>-->
<field name="is_company" string="是否本公司" column_invisible="1"/>
</xpath>
<xpath expr="//field[@name='date_end']" position="attributes">
<attribute name="string">合同结束日期</attribute>
<attribute name="readonly">0</attribute>
</xpath>
<xpath expr="//field[@name='name']" position="attributes">
<attribute name="column_invisible">1</attribute>
</xpath>
</field>
</record>
<record id="inherit_hr_contract_yuthon_form" model="ir.ui.view">
<field name="name">inherit.hr.contract.yuthon.form</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='employee_id']" position="after">
<field name="code"/>
</xpath>
<xpath expr="//field[@name='structure_type_id'][@groups='!hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="domain">['|', ('country_id', '=', False), ('country_id', '=', company_country_id), ('company_id', '=', company_id), ('default_struct_id.is_enable', '=', True)]</attribute>
<attribute name="string">职级</attribute>
<attribute name="options">"{'no_open': True}"</attribute>
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='structure_type_id'][@groups='hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="domain">['|', ('country_id', '=', False), ('country_id', '=', company_country_id), ('company_id', '=', company_id), ('default_struct_id.is_enable', '=', True)]</attribute>
<attribute name="string">职级</attribute>
<attribute name="options">"{'no_open': True}"</attribute>
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//page[@name='other']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//field[@name='employee_id']" position="attributes">
<attribute name="widget">false</attribute>
</xpath>
<xpath expr="//field[@name='code']" position="after">
<field name="is_annual_salary"/>
</xpath>
<xpath expr="//field[@name='date_end']" position="after">
<field name="is_probation"/>
<field name="start_date" invisible="not is_probation"/>
<field name="end_date" invisible="not is_probation"/>
</xpath>
<xpath expr="//field[@name='contract_type_id']" position="after">
<field name="state"/>
<field name="termination_date"/>
<field name="reason_suspension" required="termination_date" invisible="not termination_date"/>
<field name="salary_day" invisible="not is_internship"/>
<field name="salary_group_id" options="{'no_create': True}" readonly="1"/>
<field name="is_internship" invisible="1"/>
<field name="version"/>
</xpath>
<xpath expr="//field[@name='resource_calendar_id']" position="attributes">
<attribute name="string">工作日历</attribute>
</xpath>
<xpath expr="//notebook" position="attributes">
<attribute name="invisible">0</attribute>
</xpath>
<xpath expr="//group[@name='top_info']" position="before">
<group string="甲方信息">
<field name="party_id"/>
<field name="representatives"/>
<field name="economy_type"/>
<field name="address"/>
</group>
<group col="2">
<group>
<field name="contact"/>
</group>
<group>
<field name="phone"/>
</group>
</group>
</xpath>
<xpath expr="//field[@name='department_id'][@groups='!hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='department_id'][@groups='hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='job_id'][@groups='!hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//field[@name='job_id'][@groups='hr_contract.group_hr_contract_manager']" position="attributes">
<attribute name="readonly">1</attribute>
</xpath>
<xpath expr="//group[@name='top_info']" position="attributes">
<attribute name="string">乙方信息</attribute>
</xpath>
<xpath expr="//page[@name='information']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//page[@name='other']" position="attributes">
<attribute name="invisible">1</attribute>
</xpath>
<xpath expr="//notebook" position="inside">
<page name="change_info" string="异动信息">
<field name="change_ids">
<tree editable="bottom">
<!-- 这个明细行one2many字段这里必须要加关联字段隐藏,一般是隐藏的, -->
<field name="contract_id" column_invisible="1"/>
<field name="department_id" options="{'no_create': True}" domain="[('company_id', '=', parent.company_id)]"/>
<field name="job_id" string="岗位" domain="[('company_id', '=', parent.company_id)]"/>
<field name="structure_type_id" string="职级" domain="[('company_id', '=', parent.company_id)]"/>
<field name="salary_group_id" domain="[('company_id', '=', parent.company_id)]"/>
<field name="change_start_date"/>
<field name="change_end_date"/>
</tree>
</field>
</page>
</xpath>
</field>
</record>
<!-- <record id="view_hr_contract_search_inherit" model="ir.ui.view">-->
<!-- <field name="name">hr.contract.search.inherit</field>-->
<!-- <field name="model">hr.contract</field>-->
<!-- <field name="inherit_id" ref="hr_contract.hr_contract_view_search"/>-->
<!-- <field name="arch" type="xml">-->
<!-- <xpath expr="//filter[@name='running']" position="after">-->
<!-- <filter name="current_contract" string="当前合同" domain="[('current_contract', '=', True)]"/>-->
<!-- </xpath>-->
<!-- <xpath expr="//filter[@name='group_by_employee']" position="after">-->
<!-- <filter name="group_salary_group_id" string="工资单分组" context="{'group_by':'salary_group_id'}"/>-->
<!-- </xpath>-->
<!-- </field>-->
<!-- </record>-->
<record id="all_data_write_user_contract" model="ir.actions.server">
<field name="name">批量导入合同</field>
<field name="model_id" ref="hr_contract.model_hr_contract"/>
<field name="binding_model_id" ref="hr_contract.model_hr_contract"/>
<field name="state">code</field>
<field name="code">action = model.action_hr_contract()</field>
</record>
<!-- 在会员列表视图中追加甲方(用人单位)列,party_id 字段由本模块定义 -->
<record id="inherit_employee_member_tree_party" model="ir.ui.view">
<field name="name">hr.employee.member.inherit.party</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="yuthon_hr_employee.view_employee_member_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='job_id']" position="after">
<field name="party_id" readonly="1" options='{"no_open": True}'/>
</xpath>
</field>
</record>
</odoo>