From 22019bcf0cee3168715de515eda45990c5a4d663 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 10:57:27 +0800
Subject: [PATCH 01/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_official/__manifest__.py | 1 +
yuthon_official/data/official_type_data.xml | 7 +++
yuthon_official/models/__init__.py | 1 +
.../models/yuthon_sub_enterprises.py | 29 +++++++++
yuthon_official/security/ir.model.access.csv | 3 +-
yuthon_official/views/official_menus.xml | 6 ++
.../views/yuthon_sub_enterprises_view.xml | 59 +++++++++++++++++++
7 files changed, 105 insertions(+), 1 deletion(-)
create mode 100644 yuthon_official/models/yuthon_sub_enterprises.py
create mode 100644 yuthon_official/views/yuthon_sub_enterprises_view.xml
diff --git a/yuthon_official/__manifest__.py b/yuthon_official/__manifest__.py
index 9710074b8..c95d09112 100644
--- a/yuthon_official/__manifest__.py
+++ b/yuthon_official/__manifest__.py
@@ -23,6 +23,7 @@
'views/yuthon_official_incoming_labor_views.xml',
'views/yuthon_official_party_views.xml',
'views/yuthon_file_processing_views.xml',
+ 'views/yuthon_sub_enterprises_view.xml',
'views/yuthon_official_incoming_party_views.xml',
'views/yuthon_cross_departmental_views.xml',
# 'views/inherit_soong_workflow_insector_views.xml',
diff --git a/yuthon_official/data/official_type_data.xml b/yuthon_official/data/official_type_data.xml
index 0a84f4469..f43029a53 100644
--- a/yuthon_official/data/official_type_data.xml
+++ b/yuthon_official/data/official_type_data.xml
@@ -1,6 +1,13 @@
+
+ 文件处理(子企业)
+ sub_enterprises_code
+ WZQ%(y)s%(month)s%(day)s
+ 3
+
+
文件处理
file_code
diff --git a/yuthon_official/models/__init__.py b/yuthon_official/models/__init__.py
index bb777bc64..319fb8c08 100644
--- a/yuthon_official/models/__init__.py
+++ b/yuthon_official/models/__init__.py
@@ -13,3 +13,4 @@ from . import inherit_room_booking
from . import inherit_issue_library
from . import yuthon_cross_departmental
from . import yuthon_file_processing
+from . import yuthon_sub_enterprises
diff --git a/yuthon_official/models/yuthon_sub_enterprises.py b/yuthon_official/models/yuthon_sub_enterprises.py
new file mode 100644
index 000000000..d0d7aa369
--- /dev/null
+++ b/yuthon_official/models/yuthon_sub_enterprises.py
@@ -0,0 +1,29 @@
+# -*- coding: utf-8 -*-
+from odoo import api, fields, models, tools
+from odoo.exceptions import ValidationError, UserError
+
+
+class YuthonSubEnterprises(models.Model):
+ _name = 'yuthon.sub.enterprises'
+ _description = '文件处理(子企业)'
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _rec_name = 'name'
+
+
+ name = fields.Char(string="名称")
+ code = fields.Char(string="流水号", default=lambda self: self.env['ir.sequence'].next_by_code('sub_enterprises_code'))
+ users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
+ company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
+ department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
+ come_file_id = fields.Char(string="来文编号")
+ reason_application = fields.Text(string="事由")
+ official_partner_id = fields.Many2one('official.partner', string="来文单位")
+ document_ids = fields.Many2many('ir.attachment', string="附件")
+ urgency_level = fields.Selection([('normal', '普件'), ('urgent', '急件'), ('emergency', '特急件')], string='紧急度',
+ default='normal')
+ work_end = fields.Boolean(string="结束")
+ def _get_default_name_title(self):
+ return self._description if self._description else self._name
+
+ name_title = fields.Char(default=_get_default_name_title)
+ self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
diff --git a/yuthon_official/security/ir.model.access.csv b/yuthon_official/security/ir.model.access.csv
index 138428166..e8c4922f3 100644
--- a/yuthon_official/security/ir.model.access.csv
+++ b/yuthon_official/security/ir.model.access.csv
@@ -10,4 +10,5 @@ access_yuthon_official_incoming_normal,yuthon_official_incoming_normal,model_yut
access_yuthon_cross_departmental, yuthon_cross_departmental,model_yuthon_cross_departmental,base.group_user,1,1,1,1
access_yuthon_file_processing,yuthon_file_processing,model_yuthon_file_processing,base.group_user,1,1,1,1
access_main_flats,main_flats,model_main_flats,base.group_user,1,1,1,1
-access_copy_flats,copy_flats,model_copy_flats,base.group_user,1,1,1,1
\ No newline at end of file
+access_copy_flats,copy_flats,model_copy_flats,base.group_user,1,1,1,1
+access_yuthon_sub_enterprises,yuthon_sub_enterprises,model_yuthon_sub_enterprises,base.group_user,1,1,1,1
\ No newline at end of file
diff --git a/yuthon_official/views/official_menus.xml b/yuthon_official/views/official_menus.xml
index fcd007522..660936629 100644
--- a/yuthon_official/views/official_menus.xml
+++ b/yuthon_official/views/official_menus.xml
@@ -66,6 +66,12 @@
name="工会发文"
action="yuthon_official_labor_action"
sequence="10"/>
+
+
+
+
+
From 180460eb17db3bd590bf7c5958114c439168cfd7 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 15:03:13 +0800
Subject: [PATCH 10/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../models/yuthon_vacation_reports.py | 5 +----
yuthon_issue/models/issue_library.py | 2 +-
yuthon_issue/views/issue_library_views.xml | 6 +++---
yuthon_official/models/yuthon_official.py | 15 +++++++++++++++
yuthon_official/models/yuthon_sub_enterprises.py | 1 +
yuthon_official/views/yuthon_official_views.xml | 1 +
.../views/yuthon_sub_enterprises_view.xml | 1 +
7 files changed, 23 insertions(+), 8 deletions(-)
diff --git a/yuthon_hr_attendance/models/yuthon_vacation_reports.py b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
index b6ab5f215..8f489316f 100644
--- a/yuthon_hr_attendance/models/yuthon_vacation_reports.py
+++ b/yuthon_hr_attendance/models/yuthon_vacation_reports.py
@@ -878,10 +878,7 @@ class VacationLeaveLine(models.Model):
if vals.get('update_type') == 'reduce' and vals.get('vacation_id'):
vacation_main = self.env['yuthon.vacation.reports'].browse(vals['vacation_id'])
- deduct_amount = vals.get('update_lines', 0.0)
-
- if not vacation_main or deduct_amount <= 0:
- return super(VacationLeaveLine, self).create(vals)
+ deduct_amount = vals.get('update_lines', 0.0) / 8
if vacation_main:
used_this_year_new = vacation_main.used_this_year + deduct_amount
diff --git a/yuthon_issue/models/issue_library.py b/yuthon_issue/models/issue_library.py
index f7f8e8a1f..1707e215c 100644
--- a/yuthon_issue/models/issue_library.py
+++ b/yuthon_issue/models/issue_library.py
@@ -244,7 +244,7 @@ class IssueLibrary(models.Model):
self.issue_approval_id = issue_approval_id
return {
"type": "ir.actions.act_window",
- "name": "批量提交",
+ "name": "提交议题审批",
"res_model": "issue.approval",
"views": [[form_id, "form"]],
"res_id": issue_approval_id.id,
diff --git a/yuthon_issue/views/issue_library_views.xml b/yuthon_issue/views/issue_library_views.xml
index 05ed4664b..e01ffc0b8 100644
--- a/yuthon_issue/views/issue_library_views.xml
+++ b/yuthon_issue/views/issue_library_views.xml
@@ -45,9 +45,9 @@
decoration-info="issue_state == 'will'"
decoration-success="issue_state == 'done'"
decoration-muted="issue_state == 'cancel'">
-
-
-
+
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index a3ce672a7..1d1f6632c 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -57,6 +57,7 @@ class YuthonOfficial(models.Model):
issue_library_ids = fields.One2many('issue.library', 'yuthon_official_id', string="议题关联")
work_end = fields.Boolean(string="结束")
official_state = fields.Selection([('to_do', '待转'), ('done', '已转')], string="状态")
+ sub_id = fields.Many2one('yuthon.sub.enterprises', string="文件处理流程")
def _get_default_name_title(self):
return self._description if self._description else self._name
@@ -64,6 +65,20 @@ class YuthonOfficial(models.Model):
name_title = fields.Char(default=_get_default_name_title)
self_users_ids = fields.Many2many('res.users', string="当前经办人", default=lambda self: [(6, 0, [self.env.user.id])])
+
+ def end_approval(self):
+ self.write({'work_end': True})
+ if self.main_flats_id.name == '广州市天河投资集团有限公司':
+ process_id = self.env['yuthon.sub.enterprises'].search([('issuance_process_id', '=', self.id)])
+ if not process_id:
+ official_partner_id = self.env['official.partner'].search([('name', '=', '广州市天河投资集团有限公司')])
+ sub_id = self.env['yuthon.sub.enterprises'].create({
+ 'users_id': self.users_id.id,
+ 'official_partner_id': official_partner_id.id,
+ 'issuance_process_id': self.id,
+ })
+ self.write({'sub_id': sub_id.id})
+
@api.onchange('is_cold')
def onchange_is_cold(self):
if self.is_cold:
diff --git a/yuthon_official/models/yuthon_sub_enterprises.py b/yuthon_official/models/yuthon_sub_enterprises.py
index d0d7aa369..ed365ee8f 100644
--- a/yuthon_official/models/yuthon_sub_enterprises.py
+++ b/yuthon_official/models/yuthon_sub_enterprises.py
@@ -15,6 +15,7 @@ class YuthonSubEnterprises(models.Model):
users_id = fields.Many2one('res.users', string="申请人", default=lambda self: self.env.user.id)
company_id = fields.Many2one(related='users_id.employee_id.company_id', string="公司")
department_id = fields.Many2one(related='users_id.employee_id.department_id', string="部门")
+ issuance_process_id = fields.Many2one('yuthon.official', string="发文流程")
come_file_id = fields.Char(string="来文编号")
reason_application = fields.Text(string="事由")
official_partner_id = fields.Many2one('official.partner', string="来文单位")
diff --git a/yuthon_official/views/yuthon_official_views.xml b/yuthon_official/views/yuthon_official_views.xml
index 021248b0f..6aa902ba9 100644
--- a/yuthon_official/views/yuthon_official_views.xml
+++ b/yuthon_official/views/yuthon_official_views.xml
@@ -81,6 +81,7 @@
+
diff --git a/yuthon_official/views/yuthon_sub_enterprises_view.xml b/yuthon_official/views/yuthon_sub_enterprises_view.xml
index 59a4059b3..012b1ebd4 100644
--- a/yuthon_official/views/yuthon_sub_enterprises_view.xml
+++ b/yuthon_official/views/yuthon_sub_enterprises_view.xml
@@ -45,6 +45,7 @@
+
From 38fcc43e5fb81c3bb340f53ed2a6b0e1e53f04da Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 15:04:27 +0800
Subject: [PATCH 11/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_official/models/yuthon_official.py | 1 +
1 file changed, 1 insertion(+)
diff --git a/yuthon_official/models/yuthon_official.py b/yuthon_official/models/yuthon_official.py
index 1d1f6632c..bd984debb 100644
--- a/yuthon_official/models/yuthon_official.py
+++ b/yuthon_official/models/yuthon_official.py
@@ -73,6 +73,7 @@ class YuthonOfficial(models.Model):
if not process_id:
official_partner_id = self.env['official.partner'].search([('name', '=', '广州市天河投资集团有限公司')])
sub_id = self.env['yuthon.sub.enterprises'].create({
+ 'name': '广州市天河投资集团有限公司文件处理',
'users_id': self.users_id.id,
'official_partner_id': official_partner_id.id,
'issuance_process_id': self.id,
From 637e8f616a9dd0823a168431521b38634e542c4b Mon Sep 17 00:00:00 2001
From: pengyuthon
Date: Tue, 6 Jan 2026 15:05:42 +0800
Subject: [PATCH 12/24] 1
---
.../wizard/soong_workflow_comment_wizard.py | 59 +++++++++----------
.../yuthon_official_incoming_normal_views.xml | 2 +-
2 files changed, 28 insertions(+), 33 deletions(-)
diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index 64705a51c..63ab59bc4 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -577,7 +577,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
log_records = record_id.log_ids2
elif record_id.log_ids:
log_records = record_id.log_ids
-
if log_records:
# 查找当前用户的日志记录并更新
user_log = log_records.filtered(lambda log: log.done_by == current_user)
@@ -588,37 +587,33 @@ class SoongWorkflowCommentWizard(models.TransientModel):
'lase_click_date': current_datetime,
'document_ids': [(6, 0, self.document_ids.ids)]
})
- last_log = log_records[-1] if log_records else None
- if last_log:
- same_name_logs = log_records.filtered(
- lambda log: log.name == last_log.name
- and log.node_btn_name == '4'
- and log.id != last_log.id
- )
-
- # 判断是否需要更新工作流状态
- if same_name_logs:
- all_approved = all(log.approval_state == '3' for log in same_name_logs)
- all_approved = all_approved and (last_log.approval_state == '3')
- if all_approved:
- # 所有符合条件的记录都已批准,更新工作流状态
- self.env['soong.workflow.record'].search([
- ('code', '=', record_id.code)
- ]).write({
- 'approve_state': 'end',
- 'employee_ids': False,
- 'node_id': False,
- })
- record_id.work_end = True
- else:
- self.env['soong.workflow.record'].search([
- ('code', '=', record_id.code)
- ]).write({
- 'approve_state': 'end',
- 'employee_ids': False,
- 'node_id': False,
- })
- record_id.work_end = True
+ if not self.log_ids.search([('approval_state', 'in', ['0', '1'])]):
+ record_id.work_end = True
+ # last_log = log_records[-1] if log_records else None
+ # if last_log:
+ # same_name_logs = log_records.filtered(lambda log: log.name == last_log.name and log.node_btn_name == '4' and log.id != last_log.id)
+ #
+ # # 判断是否需要更新工作流状态
+ # if same_name_logs:
+ # all_approved = all(log.approval_state == '3' for log in same_name_logs)
+ # all_approved = all_approved and (last_log.approval_state == '3')
+ # if all_approved:
+ # # 所有符合条件的记录都已批准,更新工作流状态
+ # self.env['soong.workflow.record'].search([('code', '=', record_id.code)]).write({
+ # 'approve_state': 'end',
+ # 'employee_ids': False,
+ # 'node_id': False,
+ # })
+ # record_id.work_end = True
+ # else:
+ # self.env['soong.workflow.record'].search([
+ # ('code', '=', record_id.code)
+ # ]).write({
+ # 'approve_state': 'end',
+ # 'employee_ids': False,
+ # 'node_id': False,
+ # })
+ # record_id.work_end = True
# 给申请人发消息
biz_record = self.env[self.res_model].browse(self.res_id)
diff --git a/yuthon_official/views/yuthon_official_incoming_normal_views.xml b/yuthon_official/views/yuthon_official_incoming_normal_views.xml
index 98eee1d59..3479da46b 100644
--- a/yuthon_official/views/yuthon_official_incoming_normal_views.xml
+++ b/yuthon_official/views/yuthon_official_incoming_normal_views.xml
@@ -43,7 +43,7 @@
-
+
From 7e94c68faa46bb7a1c1c9dc60eb49b5acc650eb3 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 15:10:12 +0800
Subject: [PATCH 13/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
yuthon_official/models/yuthon_sub_enterprises.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/yuthon_official/models/yuthon_sub_enterprises.py b/yuthon_official/models/yuthon_sub_enterprises.py
index ed365ee8f..98c52dbbd 100644
--- a/yuthon_official/models/yuthon_sub_enterprises.py
+++ b/yuthon_official/models/yuthon_sub_enterprises.py
@@ -6,7 +6,7 @@ from odoo.exceptions import ValidationError, UserError
class YuthonSubEnterprises(models.Model):
_name = 'yuthon.sub.enterprises'
_description = '文件处理(子企业)'
- _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin']
+ _inherit = ['mail.thread.main.attachment', 'mail.activity.mixin', 'soong.workflow.mixin']
_rec_name = 'name'
From 3d384ef0b7a368540ec409070e662cb00b186596 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?=
<9664676+pengyuthon@user.noreply.gitee.com>
Date: Tue, 6 Jan 2026 15:53:34 +0800
Subject: [PATCH 14/24] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E5=8A=9F=E8=83=BD?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
soong_workflow/wizard/soong_bounced_wizard.py | 8 ++++++--
yuthon_issue/models/inherit_room_booking.py | 6 ++++++
2 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/soong_workflow/wizard/soong_bounced_wizard.py b/soong_workflow/wizard/soong_bounced_wizard.py
index 7c1bec996..79972b2c2 100644
--- a/soong_workflow/wizard/soong_bounced_wizard.py
+++ b/soong_workflow/wizard/soong_bounced_wizard.py
@@ -24,19 +24,23 @@ class SoongBouncedWizard(models.Model):
if invalid_logs:
raise UserError('当前状态不可以收回')
- prev_log = None
total_log_count = len(log_ids)
deleted_log_count = len(log_to_delete)
prev_log_index = (total_log_count - deleted_log_count) - 1
+ other_log_index = total_log_count - deleted_log_count
if prev_log_index < 0 or prev_log_index >= len(log_ids):
raise UserError('无有效的上一级审批明细行,无法执行收回操作')
prev_log = log_ids[prev_log_index]
related_record = self.env[self.res_model].browse(self.res_id)
+ done_by_list = []
+ for index in range(other_log_index):
+ done_by_list.append(log_ids[index].done_by.id)
+
if hasattr(related_record, 'self_users_ids'):
related_record.self_users_ids = [(6, 0, [prev_log.done_by.id])]
self.env['soong.workflow.record'].search([('code', '=', record.code)]).write({"employee_ids": [(6, 0, [prev_log.done_by.employee_ids.id])],
- "users_ids": [(6, 0, [prev_log.done_by.id])],
+ "users_ids": [(6, 0, done_by_list)],
'soong_state': 'to_do'
})
log_to_delete.unlink()
diff --git a/yuthon_issue/models/inherit_room_booking.py b/yuthon_issue/models/inherit_room_booking.py
index e8ff7dbb1..b21df9660 100644
--- a/yuthon_issue/models/inherit_room_booking.py
+++ b/yuthon_issue/models/inherit_room_booking.py
@@ -58,8 +58,14 @@ class RoomBooking(models.Model):
return res
for idx, (main_record, vals) in enumerate(zip(res, vals_list)):
issue_meeting_lines = vals.get('issue_meeting_line_ids', [])
+ if not isinstance(issue_meeting_lines, list):
+ continue
for line_triple in issue_meeting_lines:
+ if not (isinstance(line_triple, (list, tuple)) and len(line_triple) == 3):
+ continue
line_state, line_id, line_vals = line_triple
+ if line_state != 0 or not isinstance(line_vals, dict):
+ continue
issue_library_id = line_vals.get('issue_library_id')
room_id = vals.get('room_id')
meeting_type_id = vals.get('meeting_type_id')
From ddb88e604e9ac1083c5a54716413fe9943535cc6 Mon Sep 17 00:00:00 2001
From: pengyuthon
Date: Tue, 6 Jan 2026 15:56:32 +0800
Subject: [PATCH 15/24] 1
---
soong_workflow/models/soong_workflow_log.py | 1 +
soong_workflow/models/soong_workflow_mixin.py | 8 ++------
soong_workflow/templates/soong_workflow_templates.xml | 6 ++++--
3 files changed, 7 insertions(+), 8 deletions(-)
diff --git a/soong_workflow/models/soong_workflow_log.py b/soong_workflow/models/soong_workflow_log.py
index f0bd582aa..b77537595 100644
--- a/soong_workflow/models/soong_workflow_log.py
+++ b/soong_workflow/models/soong_workflow_log.py
@@ -85,6 +85,7 @@ class SoongWorkflowLog2(models.Model):
approval_state = fields.Selection([('0', '未读'), ('1', '已读')], string='状态', default='0')
document_ids = fields.Many2many('ir.attachment', string="附件")
lase_click_date = fields.Datetime(string="操作时间")
+ commit = fields.Char(string="意见")
@api.depends("workflow_id", "node_id", "node_btn_id")
diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py
index 91bb211a3..912998801 100644
--- a/soong_workflow/models/soong_workflow_mixin.py
+++ b/soong_workflow/models/soong_workflow_mixin.py
@@ -22,9 +22,7 @@ class SoongWorkflowMixin(models.AbstractModel):
for rec in self:
if rec.log_ids:
current_user = self.env.user
- target_logs = rec.log_ids.filtered(
- lambda l: l.done_by.id == current_user.id and l.approval_state == '0'
- )
+ target_logs = rec.log_ids.filtered(lambda l: l.done_by.id == current_user.id and l.approval_state == '0')
if target_logs:
target_logs.write({'approval_state': '1'})
return super(SoongWorkflowMixin, self).read(fields=fields, load=load)
@@ -1090,9 +1088,7 @@ class SoongWorkflowMixin(models.AbstractModel):
has_group = user_rec.has_group(ext_id)
if not has_group:
flag_show = False
- if not flag_show and (
- field_attrs.group_ids or field_attrs.user_ids
- ):
+ if not flag_show and (field_attrs.group_ids or field_attrs.user_ids):
invisible_arr.append(node.node_name)
if readonly_arr:
id_el = etree.Element("field")
diff --git a/soong_workflow/templates/soong_workflow_templates.xml b/soong_workflow/templates/soong_workflow_templates.xml
index c96b87cac..d8a3c8500 100644
--- a/soong_workflow/templates/soong_workflow_templates.xml
+++ b/soong_workflow/templates/soong_workflow_templates.xml
@@ -36,7 +36,8 @@
-
+
+
@@ -99,7 +100,8 @@
-
+
+
From 3163c534465ea18b1bf6a9a9b41699e80f3d67f4 Mon Sep 17 00:00:00 2001
From: pengyuthon
Date: Tue, 6 Jan 2026 16:38:34 +0800
Subject: [PATCH 16/24] 1
---
.../wizard/soong_workflow_comment_wizard.py | 54 +++++++++++++------
1 file changed, 38 insertions(+), 16 deletions(-)
diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index 63ab59bc4..c07688be4 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -560,26 +560,18 @@ class SoongWorkflowCommentWizard(models.TransientModel):
current_datetime = fields.Datetime.now()
is_admin = current_user.has_group('soong_workflow.group_soong_workflow_manager')
if is_admin:
- write_vals = {
+ record_id.log_ids[-1].sudo().write({
'comment': self.comment,
'approval_state': "3",
'lase_click_date': fields.Datetime.now() - timedelta(hours=8),
- 'document_ids': [(6, 0, self.document_ids.ids)] # Many2many 替换语法
- }
- record_id.log_ids[-1].sudo().write(write_vals)
- record_id.work_end = True
+ 'document_ids': [(6, 0, self.document_ids.ids)]
+ })
self.env['soong.workflow.record'].search([('code', '=', record_id.code)]).write({'approve_state': 'end',
"employee_ids": False,
"node_id": False, })
else:
- log_records = record_id.log_ids
- if record_id.log_ids2:
- log_records = record_id.log_ids2
- elif record_id.log_ids:
- log_records = record_id.log_ids
- if log_records:
- # 查找当前用户的日志记录并更新
- user_log = log_records.filtered(lambda log: log.done_by == current_user)
+ if record_id.log_ids:
+ user_log = record_id.log_ids.filtered(lambda log: log.done_by == current_user)
if user_log:
user_log.write({
'comment': self.comment,
@@ -587,8 +579,8 @@ class SoongWorkflowCommentWizard(models.TransientModel):
'lase_click_date': current_datetime,
'document_ids': [(6, 0, self.document_ids.ids)]
})
- if not self.log_ids.search([('approval_state', 'in', ['0', '1'])]):
- record_id.work_end = True
+ if not record_id.log_ids.search([('approval_state', 'in', ['0', '1'])]) and not record_id.log_ids2.search([('approval_state', '=', '0')]):
+ record_id.work_end = True
# last_log = log_records[-1] if log_records else None
# if last_log:
# same_name_logs = log_records.filtered(lambda log: log.name == last_log.name and log.node_btn_name == '4' and log.id != last_log.id)
@@ -655,6 +647,37 @@ class SoongWorkflowCommentWizard(models.TransientModel):
title=record_id._description,
description=f"编号为{record_id.code}的{record_id._description}已结束,请归档",
url=url, btntxt="查看详情")
+ if self.node_btn_name == '确认':
+ log_rec_id = record_id.log_ids2.filtered(lambda log: log.done_by == self.env.user)
+ log_rec_id.write({
+ 'comment': self.comment,
+ 'approval_state': "1",
+ 'lase_click_date': fields.datetime.now(),
+ 'document_ids': [(6, 0, self.document_ids.ids)]
+ })
+ for employee in self.circulated_employee_ids:
+ workflow_record_id = self.env['soong.workflow.record'].search([('code', '=', record_id.code)])
+ workflow_record_id.users_ids = [(4, employee.user_id.id) for employee in self.circulated_employee_ids if employee.user_id]
+ workflow_record_id.employee_ids = [(4, self.circulated_employee_ids.ids)]
+ record_id = self.env[self.res_model].search([('id', '=', self.res_id)])
+ self.sudo().env["soong.workflow.record.copy"].create({
+ "code": record_id.code,
+ "name": record_id.name,
+ "res_model": self.res_model,
+ "workflow_id": self.node_btn_id.workflow_id.id,
+ "res_id": self.res_id,
+ "done_by": employee.user_id.id,
+ "approval_state_copy": "0",
+ })
+ self.sudo().env["soong.workflow.log2"].create({
+ "model": self.res_model,
+ "res_id": self.res_id,
+ "node_id": self.node_btn_id.node_id.id,
+ "workflow_id": self.node_btn_id.workflow_id.id,
+ "done_by": employee.user_id.id,
+ "node_btn_id": self.node_btn_id.id,
+ "approval_state": "0",
+ })
if self.node_btn_name == "分发":
self.is_send = True
workflow_record_id = self.env['soong.workflow.record'].search([('code', '=', record_id.code)])
@@ -734,7 +757,6 @@ class SoongWorkflowCommentWizard(models.TransientModel):
record.write({'state': log_ids[-2].name, 'work_end': False})
return self.node_btn_id.with_context(cx).run()
-
def update_self_users_ids(self):
related_record = self.env[self.res_model].browse(self.res_id)
if hasattr(related_record, 'self_users_ids'):
From 7b00867e01345703bc8c7922b32ee395a7a3a52f Mon Sep 17 00:00:00 2001
From: pengyuthon
Date: Tue, 6 Jan 2026 16:58:04 +0800
Subject: [PATCH 17/24] 1
---
.../wizard/soong_workflow_comment_wizard.py | 9 +++++----
yuthon_work_brand/views/hr_menus.xml | 20 +++++++++----------
2 files changed, 15 insertions(+), 14 deletions(-)
diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py
index c07688be4..570507d21 100644
--- a/soong_workflow/wizard/soong_workflow_comment_wizard.py
+++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py
@@ -562,7 +562,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
if is_admin:
record_id.log_ids[-1].sudo().write({
'comment': self.comment,
- 'approval_state': "3",
+ 'approval_state': "2",
'lase_click_date': fields.Datetime.now() - timedelta(hours=8),
'document_ids': [(6, 0, self.document_ids.ids)]
})
@@ -575,7 +575,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
if user_log:
user_log.write({
'comment': self.comment,
- 'approval_state': "3",
+ 'approval_state': "2",
'lase_click_date': current_datetime,
'document_ids': [(6, 0, self.document_ids.ids)]
})
@@ -700,7 +700,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=self.employee_ids.wecom_userid, title=record_id._description, description=description, url=url, btntxt="查看详情")
for emp in self.dep_manager_employee_ids:
workflow_record_id.users_ids = [(4, employee.user_id.id) for employee in self.dep_manager_employee_ids if employee.user_id]
- next_node_id = record_id.workflow_id.node_ids.search([('name', '=', '承办'),('workflow_id', '=', record_id.workflow_id.id)])
+ next_node_id = record_id.workflow_id.node_ids.search([('name', '=', '承办'), ('workflow_id', '=', record_id.workflow_id.id)])
record_id.log_ids[-1].write({"comment": self.comment, "approval_state": "2", "lase_click_date": fields.Datetime.now()})
self.sudo().env["soong.workflow.log"].create({
"code": self.code,
@@ -712,8 +712,8 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"node_btn_name": "0",
})
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=emp.wecom_userid, title=record_id._description + "承办", description=description, url=url, btntxt="查看详情")
- workflow_record_id.employee_ids = self.dep_manager_employee_ids + self.employee_ids
for employee in self.circulated_employee_ids:
+ workflow_record_id.users_ids = [(4, employee.user_id.id) for employee in self.circulated_employee_ids if employee.user_id]
record_id = self.env[self.res_model].search([('id', '=', self.res_id)])
self.sudo().env["soong.workflow.record.copy"].create({
"code": record_id.code,
@@ -734,6 +734,7 @@ class SoongWorkflowCommentWizard(models.TransientModel):
"approval_state": "0",
})
self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=employee.wecom_userid, title=record_id._description + "传阅/抄送",description=description, url=url, btntxt="查看详情")
+ workflow_record_id.employee_ids = self.dep_manager_employee_ids + self.employee_ids + self.circulated_employee_ids
if self.node_btn_name == "收回":
# recall_url = f'https://qyapi.weixin.qq.com/cgi-bin/message/recall?access_token={access_token}'
record = self.env[self.res_model].search([('id', '=', self.res_id)])
diff --git a/yuthon_work_brand/views/hr_menus.xml b/yuthon_work_brand/views/hr_menus.xml
index 0fc726a1c..77a40aa07 100644
--- a/yuthon_work_brand/views/hr_menus.xml
+++ b/yuthon_work_brand/views/hr_menus.xml
@@ -719,16 +719,16 @@
parent="holiday_manage_menu_root_board"
action="soong_workflow.soong_workflow_department_record_action"
sequence="4"/>
-
-
+
+
+
+
+
+
+
+
+
+
-
+
soong.workflow.record.tree
soong.workflow.record
@@ -78,13 +85,16 @@
decoration-danger="approve_state == 'end'" delete="false"
create="false" default_order="write_date2 desc, id desc" expand="1" limit="15">
-
+
-
+
@@ -102,10 +112,13 @@
-
+
+
+ groups="soong_workflow.group_soong_workflow_manager"
+ invisible="approve_state in ['start', 'end']"/>
+
+
+ soong.workflow.record.form
+ soong.workflow.record
+
+
+
+
soong.workflow.my.record.tree
@@ -122,20 +178,25 @@
decoration-danger="approve_state == 'end'" delete="false"
create="false" default_order="write_date2 desc, id desc" expand="1" limit="15">
-
+
-
-
+
+
@@ -187,7 +248,7 @@
+ create="false" default_order="write_date2 desc" limit="15">
@@ -204,24 +265,28 @@
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
待办
ir.actions.act_window
soong.workflow.record
tree,kanban,search
- {'header_search_default_approve_state': 1, 'header_search_default_to_do':1, 'check_employee': 1}
- [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=', 'to_do')]
+ {'header_search_default_approve_state': 1, 'header_search_default_to_do':1,
+ 'check_employee': 1}
+
+ [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=',
+ 'to_do')]
+
@@ -230,8 +295,12 @@
ir.actions.act_window
soong.workflow.record
tree,kanban,search
- {'header_search_default_approve_state': 1, 'header_search_default_to_do':1, 'check_employee': 1}
- [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=', 'done')]
+ {'header_search_default_approve_state': 1, 'header_search_default_to_do':1,
+ 'check_employee': 1}
+
+ [('users_ids', 'in', uid), ('reclaim_state', '=', False), ('soong_state', '=',
+ 'done')]
+
@@ -249,7 +318,9 @@
ir.actions.act_window
soong.workflow.record
tree,kanban,search
- [('reclaim_state', '=', False), '|', ('approvals_group_id.name', '=', '人力资源'), ('approvals_group_id.name', '=', '考勤'), ('approve_state', '!=', 'start')]
+ [('reclaim_state', '=', False), '|', ('approvals_group_id.name', '=', '人力资源'),
+ ('approvals_group_id.name', '=', '考勤'), ('approve_state', '!=', 'start')]
+
@@ -257,7 +328,9 @@
ir.actions.act_window
soong.workflow.record
tree,kanban,search
- [('reclaim_state', '=', False), ('approvals_group_id.name', '!=', '人力资源'), ('approvals_group_id.name', '!=', '考勤')]
+ [('reclaim_state', '=', False), ('approvals_group_id.name', '!=', '人力资源'),
+ ('approvals_group_id.name', '!=', '考勤')]
+
{'search_default_my_department_shifts': True,}
@@ -266,7 +339,7 @@
ir.actions.act_window
soong.workflow.record
tree,form,search
-
+
[('reclaim_state', '=', False)]
@@ -313,11 +386,11 @@
code
action = model.append_date()
-
-
-
-
-
-
-
+
+
+
+
+
+
+
From 73724a8b9854a662a4da052c926fa35f8d946b70 Mon Sep 17 00:00:00 2001
From: pengyuthon
Date: Tue, 6 Jan 2026 17:30:15 +0800
Subject: [PATCH 22/24] 1
---
soong_workflow/views/soong_workflow_record.xml | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/soong_workflow/views/soong_workflow_record.xml b/soong_workflow/views/soong_workflow_record.xml
index e237d5174..2947c7985 100644
--- a/soong_workflow/views/soong_workflow_record.xml
+++ b/soong_workflow/views/soong_workflow_record.xml
@@ -101,9 +101,8 @@
-
-
+
+