Files
gzth/yuthon_wechat/views/hr_employee_views.xml
T
2024-09-30 16:30:02 +08:00

86 lines
4.0 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<record id="view_employee_tree_yuthon_wechat_inherit" model="ir.ui.view">
<field name="name">hr.employee.tree.yuthon.wechat.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_tree"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="pub_reassignment_employee" string="调岗" type="object" />
<button name="pub_leaving_employee" string="离职" type="object" />
<button name="pub_regularization_employee" string="转正" type="object" />
</xpath>
</field>
</record>
<record id="view_employee_form_yuthon_wechat_inherit" model="ir.ui.view">
<field name="name">hr.employee.form.yuthon.wechat.inherit</field>
<field name="model">hr.employee</field>
<field name="inherit_id" ref="hr.view_employee_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button class="oe_stat_button" name="send_wecom_employee" string="同步企业微信员工" groups="hr.group_hr_manager" type="object" icon="fa-bars"/>
</xpath>
<xpath expr="//sheet//group//field[@name='user_id']" position="after">
<field name="wecom_userid" />
</xpath>
</field>
</record>
<record id="yuthon_wechat_view_users_simple_form" model="ir.ui.view">
<field name="name">res.users.simple.form.inherit</field>
<field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_simple_form"/>
<field name="arch" type="xml">
<xpath expr="//form" position="inside">
<field name="oauth_uid" invisible="1"/>
</xpath>
</field>
</record>
<record id="view_department_form_yuthon_wechat" model="ir.ui.view">
<field name="name">hr.department.form.yuthon.wechat</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet" position="before">
<header>
<button class="oe_stat_button" name="send_wecom_employee" string="同步企业微信部门" groups="hr.group_hr_manager" type="object" icon="fa-bars"/>
</header>
</xpath>
<xpath expr="//field[@name='color']" position="after">
<field name="wecom_id" />
<field name="wecom_parent_id" />
</xpath>
</field>
</record>
<record id="view_department_tree_yuthon_wechat" model="ir.ui.view">
<field name="name">hr.department.tree.yuthon.wechat</field>
<field name="model">hr.department</field>
<field name="inherit_id" ref="hr.view_department_tree"/>
<field name="arch" type="xml">
<xpath expr="//tree" position="inside">
<header>
<button class="oe_stat_button" name="send_wecom_employee" string="同步企业微信部门" groups="hr.group_hr_manager" type="object" icon="fa-bars"/>
</header>
</xpath>
</field>
</record>
<record id="all_wecom_employee_user" model="ir.actions.server">
<field name="name">同步企业微信</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="binding_model_id" ref="hr.model_hr_employee"/>
<field name="state">code</field>
<field name="code">action = model.send_wecom_employee()</field>
</record>
<record id="all_create_user" model="ir.actions.server">
<field name="name">批量创建用户</field>
<field name="model_id" ref="hr.model_hr_employee"/>
<field name="binding_model_id" ref="hr.model_hr_employee"/>
<field name="state">code</field>
<field name="code">action = model.batch_action_create_user()</field>
</record>
</odoo>