Files
gzth/yuthon_holiday/views/hr_leave_batch.xml
T
2026-05-15 16:13:20 +08:00

439 lines
27 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<odoo>
<data>
<record id="view_hr_leave_batch_tree" model="ir.ui.view">
<field name="name">hr.leave.batch.tree</field>
<field name="model">hr.leave.batch</field>
<field name="arch" type="xml">
<tree string="请假审批">
<field name="employee_id" column_invisible="1"/>
<field name="name"/>
<field name="users_id" options="{'no_create': True}"/>
</tree>
</field>
</record>
<record id="view_hr_leave_batch_form" model="ir.ui.view">
<field name="name">hr.leave.batch.form</field>
<field name="model">hr.leave.batch</field>
<field name="arch" type="xml">
<form create="0">
<header>
<button name="action_print_leave_batch"
string="打印"
type="object"
class="btn-primary"
invisible="not work_end"
/>
</header>
<sheet>
<group col="3">
<group>
<field name="code" string="流水号" readonly="1"/>
</group>
<group>
<field name="urgency_level" readonly="1"/>
</group>
<group/>
</group>
<div class="col-12 text-center">
<h1>
<field name="name_title" readonly="1"/>
</h1>
</div>
<group col="2">
<group>
<field name="is_back" invisible="1"/>
<field name="name"/>
<field name="users_id" options="{'no_create': True}"/>
<field name="company_id" invisible="1"/>
<field name="department_id" invisible="1"/>
<field name="entrusted_agent_id" groups="yuthon_salary.group_jtbb_user,yuthon_salary.group_wg_user"
domain="[('employee_id.department_id', '=', department_id)]" options="{'no_create': True}"/>
<field name="days" invisible="1"/>
<field name="employee_id" invisible="1" force_save="1"/>
<field name="main_stay_place" string="主要停留地"/>
<field name="text"/>
<field name="create_date" invisible="1"/>
<field name="work_end" invisible="1"/>
<field name="document_ids" widget="preview_many2many"
options="{'show_select_btn': false}"/>
<field name="holiday_allowance" readonly="1" invisible="holiday_allowance2"/>
<field name="holiday_allowance2" readonly="1" invisible="not holiday_allowance2"/>
</group>
</group>
<group groups="yuthon_salary.group_jtbb_user,yuthon_salary.group_wg_user" invisible="not entrusted_agent_id">
<label for="is_entrusted"/>
<div><field name="is_entrusted"/></div>
</group>
<group>
<label for="is_day"/>
<div><field name="is_day"/></div>
</group>
<!-- <field name="leave_ids" invisible="not is_day"-->
<!-- context="{-->
<!-- 'default_holiday_type': 'employee',-->
<!-- 'default_employee_id': employee_id,-->
<!-- 'holiday_status_id_default_request_unit': 'day'-->
<!-- }">-->
<field name="leave_ids" invisible="not is_day"
mode="form,tree,kanban"
context="{
'kanban_view_ref':'yuthon_holiday.yuthon_holiday_day_kanban',
'default_holiday_type': 'employee',
'default_employee_id': employee_id,
}" string=" ">
<tree editable="bottom">
<field name="number_of_days_display" string="天" width="100px"/>
<field name="employee_id" readonly="1" force_save="1" column_invisible="1"/>
<field name="state" column_invisible="True"/>
<field name="employee_company_id" column_invisible="True"/>
<field name="name" column_invisible="True"/>
<field name="holiday_type" column_invisible="True"/>
<field name="user_id" column_invisible="True"/>
<field name="batch_id" class="list_width2" column_invisible="True"/>
<field name="request_hour_from" column_invisible="True"/>
<field name="request_unit_hours" column_invisible="True"/>
<field name="holiday_status_id"
domain="[
'|',
('requires_allocation', '=', 'no'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
]"
context="{'employee_id': employee_id}"
options="{'no_create': True, 'no_open': True, 'request_type': 'leave'}"
readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"
width="100px"
/>
<!-- <field name="holiday_status_id"-->
<!-- domain="[-->
<!-- ('request_unit', '=', 'day'),-->
<!-- '|',-->
<!-- ('requires_allocation', '=', 'no'),-->
<!-- '&amp;',-->
<!-- ('has_valid_allocation', '=', True),-->
<!-- '|',-->
<!-- ('allows_negative', '=', True),-->
<!-- '&amp;',-->
<!-- ('virtual_remaining_leaves', '&gt;', 0),-->
<!-- ('allows_negative', '=', False),-->
<!-- ]"-->
<!-- context="{'employee_id': employee_id}"-->
<!-- options="{'no_create': True, 'no_open': True, 'request_type': 'leave'}"-->
<!-- readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"-->
<!-- width="200px"-->
<!-- />-->
<field name="request_date_from" width="100px" string="开始日期"/>
<field name="request_date_to" width="100px" string="结束日期"/>
<field name="leave_documents_ids" widget="preview_many2many"
options="{'preview_type': 'button', 'preview_string': ' '}" string=" "
width="100px" readonly='true'/>
<field name="request_hour_to" column_invisible="True"/>
</tree>
<form>
<group>
<field name="employee_id" readonly="1" force_save="1" invisible="1"/>
<field name="state" invisible="True"/>
<field name="employee_company_id" invisible="True"/>
<field name="name" invisible="True"/>
<field name="holiday_type" invisible="True"/>
<field name="user_id" invisible="True"/>
<field name="batch_id" class="list_width2" invisible="True"/>
<field name="request_hour_from" invisible="True"/>
<field name="request_unit_hours" invisible="True"/>
<field name="holiday_status_id"
domain="[
'|',
('requires_allocation', '=', 'no'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
]"
context="{'employee_id': employee_id}"
options="{'no_create': True, 'no_open': True, 'request_type': 'leave'}"
readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"
width="100px"
/>
<field name="request_date_from" width="100px" string="开始日期"/>
<field name="request_date_to" width="100px" string="结束日期"/>
<field name="number_of_days_display" string="天" width="100px"/>
<field name="leave_documents_ids" widget="preview_many2many"
options="{'preview_type': 'button', 'preview_string': ' '}" string=" "
width="100px" readonly='true'/>
<field name="request_hour_to" invisible="1"/>
</group>
</form>
</field>
<group>
<label for="is_hour"/>
<div><field name="is_hour"/></div>
</group>
<field name="hour_leave_ids" invisible="not is_hour" string=" "
mode="form,tree,kanban"
context="{
'kanban_view_ref':'yuthon_holiday.yuthon_holiday_hour_kanban',
'default_holiday_type': 'employee',
'default_employee_id': employee_id,
'default_request_unit_hours': True,
'no_change_request_unit_hours': True,
'holiday_status_id_default_request_unit': 'hour'
}">
<tree editable="bottom">
<field name="leave_hours"/>
<field name="employee_id" readonly="1" force_save="1" column_invisible="1"/>
<field name="state" column_invisible="True"/>
<field name="employee_company_id" column_invisible="True"/>
<field name="name" column_invisible="True"/>
<field name="holiday_type" column_invisible="True"/>
<field name="user_id" column_invisible="True"/>
<field name="batch_id" column_invisible="True"/>
<field name="holiday_status_id" domain="[
('request_unit', '=', 'hour'),
'|',
('requires_allocation', '=', 'no'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
]"
context="{'employee_id': employee_id}"
options="{'no_create': True, 'no_open': True, 'request_type': 'leave'}"
readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"
width="100px"
/>
<field name="request_date_from" width="100px" string="请假日期"/>
<field name="request_hour_from" width="100px"/>
<field name="request_hour_to" width="100px"/>
<field name="leave_documents_ids" widget="preview_many2many"
options="{'preview_type': 'button', 'preview_string': ' '}" string=" "
width="100px" readonly="1"/>
</tree>
<form>
<group>
<field name="leave_hours"/>
<field name="employee_id" readonly="1" force_save="1" invisible="1"/>
<field name="state" invisible="True"/>
<field name="employee_company_id" invisible="True"/>
<field name="name" invisible="True"/>
<field name="holiday_type" invisible="True"/>
<field name="user_id" invisible="True"/>
<field name="batch_id" invisible="True"/>
<field name="holiday_status_id" domain="[
('request_unit', '=', 'hour'),
'|',
('requires_allocation', '=', 'no'),
'&amp;',
('has_valid_allocation', '=', True),
'|',
('allows_negative', '=', True),
'&amp;',
('virtual_remaining_leaves', '&gt;', 0),
('allows_negative', '=', False),
]"
context="{'employee_id': employee_id}"
options="{'no_create': True, 'no_open': True, 'request_type': 'leave'}"
readonly="state in ['cancel', 'refuse', 'validate', 'validate1']"
width="100px"
/>
<field name="request_unit_hours" invisible="True" force_save="1"/>
<field name="request_date_from" width="100px" string="请假日期"/>
<field name="request_hour_from" width="100px"/>
<field name="request_hour_to" width="100px"/>
<field name="request_date_to" invisible="True"/>
<field name="number_of_hours_text" string="小时" width="100px" invisible="True"/>
<field name="leave_documents_ids" widget="preview_many2many"
options="{'preview_type': 'button', 'preview_string': ' '}" string=" "
width="100px" readonly="1"/>
<field name="number_of_days_display" invisible="True"/>
</group>
</form>
</field>
<group>
<field name="user_role_id" invisible="1"/>
<field name="is_issues" invisible="1"/>
<field name="start_date" invisible="1"/>
<field name="end_date" invisible="1"/>
<field name="details" readonly="1"/>
</group>
</sheet>
</form>
</field>
</record>
<record id="hr_leave_batch_search_view" model="ir.ui.view">
<field name="model">hr.leave.batch</field>
<field name="arch" type="xml">
<search string="Time Off Batches Search">
<field name="name" string="Batch"
filter_domain="['|',('name', 'ilike', self), ('employee_id', 'ilike', self)"/>
<group expand="0" string="Group By">
<filter string="Employee" name="group_by_employee_id" domain="[]"
context="{'group_by': 'employee_id'}"/>
</group>
</search>
</field>
</record>
<record id="yuthon_holiday_day_kanban" model="ir.ui.view">
<field name="name">yuthon.holiday.day.kanban</field>
<field name="model">hr.leave</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="holiday_status_id"/>
<field name="request_date_from"/>
<field name="request_date_to"/>
<field name="number_of_days_display"/>
<field name="leave_documents_ids" widget="preview_many2many"/>
<templates>
<t t-name="kanban-box">
<div class="o_kanban_record d-md-none card h-100">
<div class="card-body">
<div class="mb-2">
<small>
类型:
<field name="holiday_status_id"/>
</small>
</div>
<div class="mb-2">
<small>
开始时间:
<field name="request_date_from"/>
</small>
</div>
<div class="mb-2">
<small>
结束时间:
<field name="request_date_to"/>
</small>
</div>
<div class="mb-2">
<small>
天数:
<field name="number_of_days_display"/>
</small>
</div>
<div class="mb-2">
<small>
附件:
<field name="leave_documents_ids" widget="preview_many2many"/>
</small>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="yuthon_holiday_hour_kanban" model="ir.ui.view">
<field name="name">yuthon.holiday.hour.kanban</field>
<field name="model">hr.leave</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="leave_hours"/>
<field name="holiday_status_id"/>
<field name="request_date_from"/>
<field name="request_hour_from"/>
<field name="request_hour_to"/>
<templates>
<t t-name="kanban-box">
<div class="o_kanban_record d-md-none card h-100">
<div class="card-body">
<div class="mb-2">
<small>
类型:
<field name="holiday_status_id"/>
</small>
</div>
<div class="mb-2">
<small>
日期:
<field name="request_date_from"/>
</small>
</div>
<div class="mb-2">
<small>
开始时间:
<field name="request_hour_from"/>
</small>
</div>
<div class="mb-2">
<small>
结束时间:
<field name="request_hour_to"/>
</small>
</div>
<div class="mb-2">
<small>
小时:
<field name="leave_hours"/>
</small>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="hr_leave_batch_action_my" model="ir.actions.act_window">
<field name="name">我的休假</field>
<field name="res_model">hr.leave.batch</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
<field name="search_view_id" ref="hr_leave_batch_search_view"/>
<field name="domain">[('employee_id.user_id', '=', uid)]</field>
</record>
<record id="all_update_state" model="ir.actions.server">
<field name="name">初始化状态</field>
<field name="model_id" ref="hr_holidays.model_hr_leave"/>
<field name="binding_model_id" ref="hr_holidays.model_hr_leave"/>
<field name="state">code</field>
<field name="code">action = model.update_state()</field>
</record>
<record id="all_update_is_vacation" model="ir.actions.server">
<field name="name">标识改成True</field>
<field name="model_id" ref="hr_holidays.model_hr_leave"/>
<field name="binding_model_id" ref="hr_holidays.model_hr_leave"/>
<field name="state">code</field>
<field name="code">action = model.update_is_vacation()</field>
</record>
<menuitem
id="hr_holidays.hr_leave_menu_my"
parent="hr_holidays.menu_hr_holidays_my_leaves"
action="hr_leave_batch_action_my"
sequence="2"
/>
<record id="hr_leave_batch_action_all" model="ir.actions.act_window">
<field name="name">休假申请</field>
<field name="res_model">hr.leave.batch</field>
<field name="view_mode">tree,form</field>
<field name="context">{}</field>
<field name="domain">[('users_id', '=', uid)]</field>
<field name="search_view_id" ref="hr_leave_batch_search_view"/>
</record>
<menuitem
id="hr_holidays.menu_open_department_leave_approve"
parent="hr_holidays.menu_hr_holidays_management"
action="hr_leave_batch_action_all"
sequence="1"
/>
</data>
</odoo>