!8704 !8703 Merge branch 'dev' of <a href="https://gitee.com/jinan-pengyusen…

Merge pull request !8704 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-02-05 07:40:59 +00:00
committed by Gitee
7 changed files with 48 additions and 15 deletions
@@ -33,6 +33,7 @@
<page string="关联流程">
<field name="soong_record_ids" style="width:100%; margin-top: 10px;">
<tree create="1" edit="1" delete="1" editable="bottom" type="object">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="workflow_record_id" domain="[('users_ids', 'in', uid)]"
options="{'no_open': True}" context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
<field name="code" column_invisible="1"/>
@@ -42,7 +43,7 @@
<field name="department_id"/>
<field name="approvals_group_id" column_invisible="1"/>
<field name="write_date2"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
<button name="unlink" type="object" string="删除" class="btn-primary"/>
</tree>
</field>
@@ -90,6 +91,7 @@
<page string="关联流程">
<field name="soong_record_ids" style="width:100%%; margin-top: 10px;">
<tree editable="bottom" delete="False">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="workflow_record_id" domain="[('users_ids', 'in', uid)]"
options="{'no_open': True}" context="{'tree_view_ref': 'soong_workflow.soong_workflow_record_no_action_tree'}"/>
<field name="code" column_invisible="1"/>
@@ -99,7 +101,7 @@
<field name="department_id"/>
<field name="approvals_group_id" column_invisible="1"/>
<field name="write_date2"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
<button name="unlink" type="object" string="删除" class="btn-primary"/>
</tree>
</field>
@@ -86,7 +86,7 @@
<field name="arch" type="xml">
<tree string="流程查询" action="open_record" type="object"
delete="false" copy="false"
create="false" default_order="display_end_time desc, write_date2 desc, id desc" expand="1" limit="10">
create="false" default_order="display_end_time" expand="1" limit="10">
<header>
<button name="admin_end" type="object" string="管理员强制结束" class="oe_highlight"
groups="soong_workflow.group_soong_workflow_manager"/>
@@ -139,7 +139,7 @@
<field name="arch" type="xml">
<tree string="流程查询" type="object"
delete="false"
create="false" default_order="display_end_time desc, write_date2 desc, id desc" expand="1" limit="10">
create="false" default_order="display_end_time" expand="1" limit="10">
<header>
<button name="admin_end" type="object" string="管理员强制结束" class="oe_highlight"
groups="soong_workflow.group_soong_workflow_manager"/>
@@ -412,7 +412,7 @@
<field name="arch" type="xml">
<tree string="工作流回收站" action="open_record" type="object"
decoration-muted="approve_state == 'end'" decoration-warning="approve_state != 'end'"
create="false" default_order="write_date2 desc" limit="10">
create="false" default_order="display_end_time" limit="10">
<field name="name"/>
<field name="workflow_id" string="审批类型"/>
<field name="node_id" string="当前节点"/>
@@ -34,9 +34,10 @@
</div>
<group>
<!-- 归档弹窗新增“本公司”勾选,控制抄送人员是否限定当前公司 -->
<field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>
<field name="is_this_company"/>
<field name="circulated_employee_ids" widget="many2many_tags" options="{'no_create': True}" domain="[('company_id', '=', company_id), ('id', 'not in' , filter_personnel_ids)] if is_this_company else [('id', 'not in' , filter_personnel_ids)]"/>
<field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>
<!-- <field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>-->
</group>
</group>
<group invisible="node_btn_name != '结束'">
@@ -82,11 +83,11 @@
</group>
<group col="2" invisible="node_btn_name in ['分发', '结束', '收回', '确认', '归档']">
<group>
<!-- 本公司、附件 -->
<field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>
<!-- 本公司、附件 -->
<label for="is_this_company" string="本公司"/>
<field name="is_this_company" nolabel="1"/>
<field name="illustrate" invisible="not illustrate"/>
<!-- <field name="document_ids" string="附件" widget="preview_many2many" force_save="1"/>-->
<!-- 转交人员 -->
<field name="trans_link_id" string="转交节点" invisible="node_btn_name == '退回'" domain="[('id', 'not in', invalid_link_ids)]" options="{'no_open': True}" widget="radio" force_save="1"/>
<field name="employee_trans_domain_ids" invisible="1"/>
@@ -10,7 +10,7 @@
</header>
<field name="employee_id" options="{'no_create': True}"/>
<field name="year" column_invisible="1"/>
<field name="company_id" required="1" optional="show"/>
<!-- <field name="company_id" required="1" optional="show"/>-->
<field name="current_year_remaining" options='{ "fg_color": "blue"}'/>
<field name="this_year_quota"/>
<field name="last_year_balance"/>
+8 -4
View File
@@ -238,6 +238,7 @@
<button name="add_workflow" string="添加流程" type="object" class="btn-primary"/>
<field name="issue_library_approval_line_ids" readonly="1">
<tree editable="bottom">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="issue_library_id" column_invisible="1"/>
<field name="res_model" column_invisible="1"/>
<field name="res_id" column_invisible="1"/>
@@ -246,7 +247,7 @@
<field name="approval_type"/>
<field name="department_id"/>
<field name="approval_date"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
</tree>
</field>
</page>
@@ -457,6 +458,7 @@
<button name="add_workflow" string="添加流程" type="object" class="btn-primary"/>
<field name="issue_library_approval_line_ids" readonly="1">
<tree editable="bottom">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="issue_library_id" column_invisible="1"/>
<field name="res_model" column_invisible="1"/>
<field name="res_id" column_invisible="1"/>
@@ -465,7 +467,7 @@
<field name="approval_type"/>
<field name="department_id"/>
<field name="approval_date"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
</tree>
</field>
</page>
@@ -627,6 +629,7 @@
<button name="add_workflow" string="添加流程" type="object" class="btn-primary"/>
<field name="issue_library_approval_line_ids" readonly="1">
<tree editable="bottom">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="issue_library_id" column_invisible="1"/>
<field name="res_model" column_invisible="1"/>
<field name="res_id" column_invisible="1"/>
@@ -635,7 +638,7 @@
<field name="approval_type"/>
<field name="department_id"/>
<field name="approval_date"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
</tree>
</field>
</page>
@@ -786,6 +789,7 @@
<button name="add_workflow" string="添加流程" type="object" class="btn-primary"/>
<field name="issue_library_approval_line_ids" readonly="1">
<tree editable="bottom">
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<field name="issue_library_id" column_invisible="1"/>
<field name="res_model" column_invisible="1"/>
<field name="res_id" column_invisible="1"/>
@@ -794,7 +798,7 @@
<field name="approval_type"/>
<field name="department_id"/>
<field name="approval_date"/>
<button name="open_record" type="object" string="详情" class="btn-primary"/>
<!-- <button name="open_record" type="object" string="详情" class="btn-primary"/>-->
</tree>
</field>
</page>
@@ -44,6 +44,31 @@ class YuthonOfficialIncomingNormal(models.Model):
room_booking_ids = fields.One2many('room.booking', 'incoming_normal_id', string="会议关联")
issue_library_ids = fields.One2many('issue.library', 'incoming_normal_id', string="议题关联")
related_issues_id = fields.Many2one('issue.library', string="关联议题")
# 显示用的办结时间(如果有审批日志,取最后一条日志的时间;否则使用write_date)
display_end_time = fields.Datetime(
string="办结时间",
compute='_compute_display_end_time',
store=True
)
@api.depends('log_ids', 'write_date')
def _compute_display_end_time(self):
"""
计算显示用的办结时间
逻辑:如果有审批日志,取最后一条日志的时间;否则使用write_date
"""
for record in self:
if record.log_ids:
# 按ID排序,取最后一条日志的时间
sorted_logs = record.log_ids.sorted(lambda l: l.id)
if sorted_logs and hasattr(sorted_logs[-1], 'lase_click_date') and sorted_logs[-1].lase_click_date:
record.display_end_time = sorted_logs[-1].lase_click_date
else:
record.display_end_time = record.write_date
else:
record.display_end_time = record.write_date
def _get_default_name_title(self):
return self._description if self._description else self._name
@@ -4,10 +4,11 @@
<field name="name">yuthon.official.incoming.normal.tree</field>
<field name="model">yuthon.official.incoming.normal</field>
<field name="arch" type="xml">
<tree>
<tree default_order="display_end_time">
<field name="name"/>
<field name="department_id"/>
<field name="time_date"/>
<field name="display_end_time" string="办结时间" optional="show"/>
</tree>
</field>
</record>
@@ -57,13 +58,13 @@
<group col="2">
<field name="is_company" invisible="1"/>
<field name="users_id"/>
<field name="name" required="1"/>
</group>
<group>
<field name="issues_result" invisible="is_issues == False"/>
</group>
</group>
<group>
<field name="name" required="1"/>
<field name="main_text"/>
<field name="official_documents_ids" widget="preview_many2many"/>
</group>