This commit is contained in:
李鹏宇
2026-01-19 11:23:22 +08:00
3 changed files with 318 additions and 211 deletions
@@ -3,7 +3,7 @@
<template id="soong_workflow_log_manager">
<notebook>
<page string="审批详情">
<field name="log_ids" style="width:100%; margin-top: 10px;" mode="kanban,tree" context="{'kanban_view_ref':'soong_workflow.soong_workflow_log_kanban'}">
<field name="log_ids" style="width:100%; margin-top: 10px;" mode="kanban,tree" context="{'kanban_view_ref':'soong_workflow.soong_workflow_log_manager_kanban'}">
<tree editable="bottom" create="1" edit="1" delete="1">
<field name="sequence" string="" widget="handle" groups="soong_workflow.group_soong_workflow_manager"/>
<field name="name" string="" readonly="0"/>
@@ -18,7 +18,7 @@
</tree>
</field>
</page>
<page string="抄送/传阅记录" invisible="not log_ids2" mode="kanban,tree" context="{'kanban_view_ref':'soong_workflow.soong_workflow_log2_kanban'}">
<page string="抄送/传阅记录" invisible="not log_ids2" mode="kanban,tree" context="{'kanban_view_ref':'soong_workflow.soong_workflow_log2_manager_kanban'}">
<field name="log_ids2" style="width:100%; margin-top: 10px;">
<tree editable="bottom" create="1" edit="1" delete="1">
<field name="done_by" string=""/>
@@ -118,6 +118,53 @@
<record id="soong_workflow_log_kanban" model="ir.ui.view">
<field name="name">soong.workflow.log.kanban</field>
<field name="model">soong.workflow.log</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" create="0" delete="0" edit="0">
<field name="name"/>
<field name="comment"/>
<field name="done_by"/>
<field name="lase_click_date"/>
<field name="approval_state"/>
<field name="node_btn_name"/>
<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="name" />
</small>
</div>
<div class="mb-2">
<small>
状态:<field name="approval_state"/>
</small>
</div>
<div class="mb-2">
<small>
经办人:<field name="done_by"/>
</small>
</div>
<div class="mb-2">
<small>
意见:<field name="comment"/>
</small>
</div>
<div class="mb-2">
<small>
附件:<field name="document_ids" widget="preview_many2many"/>
</small>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
<record id="soong_workflow_log_manager_kanban" model="ir.ui.view">
<field name="name">soong.workflow.log.manager.kanban</field>
<field name="model">soong.workflow.log</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
<field name="name"/>
@@ -162,8 +209,8 @@
</kanban>
</field>
</record>
<record id="soong_workflow_log2_kanban" model="ir.ui.view">
<field name="name">soong.workflow.log2.kanban</field>
<record id="soong_workflow_log2_manager_kanban" model="ir.ui.view">
<field name="name">soong.workflow.log2.manager.kanban</field>
<field name="model">soong.workflow.log2</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile">
@@ -202,4 +249,44 @@
</kanban>
</field>
</record>
<record id="soong_workflow_log2_kanban" model="ir.ui.view">
<field name="name">soong.workflow.log2.kanban</field>
<field name="model">soong.workflow.log2</field>
<field name="arch" type="xml">
<kanban class="o_kanban_mobile" create="0" delete="0" edit="0">
<field name="done_by"/>
<field name="commit"/>
<field name="approval_state"/>
<field name="lase_click_date"/>
<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="done_by" />
</small>
</div>
<div class="mb-2">
<small>
意见:<field name="commit"/>
</small>
</div>
<div class="mb-2">
<small>
状态:<field name="approval_state"/>
</small>
</div>
<div class="mb-2">
<small>
时间:<field name="lase_click_date"/>
</small>
</div>
</div>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</odoo>
@@ -89,9 +89,9 @@ class SoongWorkflowRecordDeleteWizard(models.TransientModel):
"state": "confirm",
"active": False
})
# 确保在写入前记录仍然存在
if target_record.exists():
target_record.write({'active': False})
# # # 确保在写入前记录仍然存在
# if target_record.exists():
# target_record.write({'is_active': False})
else:
workflow_record = self.env["soong.workflow.record"].sudo().search(
[("id", "=", record.id), ('reclaim_state', "=", True)], limit=1)
+224 -204
View File
@@ -24,10 +24,10 @@
type="object"
class="btn-primary"
invisible="not work_end"
/>
/>
</header>
<sheet>
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
<widget name="web_ribbon" title="普件" bg_color="text-bg-success"
invisible="urgency_level != 'normal'"/>
<widget name="web_ribbon" title="急件" bg_color="text-bg-warning"
invisible="urgency_level != 'urgent'"/>
@@ -54,46 +54,48 @@
<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" domain="[('employee_id.department_id', '=', department_id)]" />
<field name="entrusted_agent_id"
domain="[('employee_id.department_id', '=', department_id)]"/>
<field name="is_entrusted" invisible="not entrusted_agent_id"/>
<field name="days" invisible="1"/>
<field name="employee_id" invisible="1" force_save="1"/>
<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="document_ids" widget="preview_many2many"
options="{'show_select_btn': false}"/>
<field name="holiday_allowance" readonly="1"/>
</group>
</group>
<group>
<field name="is_day"/>
</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="{
<!-- <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=" " style="width: 150%;">
<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="[
}" 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;',
@@ -104,47 +106,49 @@
('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="[
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;',
@@ -155,25 +159,27 @@
('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>
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>
<field name="is_hour"/>
</group>
<field name="hour_leave_ids" invisible="not is_hour" style="width: 150%;" string=" "
mode="form,tree,kanban"
context="{
<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,
@@ -202,27 +208,29 @@
('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"
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="[
<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'),
@@ -234,22 +242,24 @@
('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>
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"/>
@@ -277,97 +287,107 @@
</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>
<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>
</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>
</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>
</div>
</t>
</templates>
</kanban>
</field>
</record>
</t>
</templates>
</kanban>
</field>
</record>
<record id="hr_leave_batch_action_my" model="ir.actions.act_window">