Merge pull request !8059 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2026-01-16 11:06:23 +00:00
committed by Gitee
3 changed files with 54 additions and 10 deletions
+17 -5
View File
@@ -125,12 +125,24 @@ class SoongWorkflowMixin(models.AbstractModel):
for record in self:
record.is_confirm = False
record.is_end = False
domain = [('done_by', '=', self.env.user.id), ('workflow_id', '=', record.workflow_id.id),
('res_id', '=', record.id), ('approval_state', 'in', ['0', '1']), ('name', '!=', '归档')]
lg2 = record.log_ids2.search(domain)
lg1 = record.log_ids.search(domain)
if lg2 or lg1:
log_ids_domain = [
('done_by', '=', self.env.user.id),
('workflow_id', '=', record.workflow_id.id),
('res_id', '=', record.id),
('approval_state', 'in', ['0', '1']),
('name', '=', '承办')
]
log_ids2_domain = [
('done_by', '=', self.env.user.id),
('workflow_id', '=', record.workflow_id.id),
('res_id', '=', record.id),
('approval_state', 'in', ['0', '1'])
]
lg1 = record.log_ids.search(log_ids_domain)
lg2 = record.log_ids2.search(log_ids2_domain)
if lg1 or lg2:
record.is_confirm = True
if (not lg1 and not lg2) or not record.is_confirm:
record.is_end = True
+31 -2
View File
@@ -3,6 +3,7 @@ import json
from odoo import http, fields
from odoo.http import request
from urllib.parse import quote
class YuthonNotice(http.Controller):
@@ -43,15 +44,43 @@ class YuthonNotice(http.Controller):
@http.route('/yuthon/notice/list', methods=['POST'], type='http', auth='none', csrf=False)
def yuthon_notice_list(self, **kwargs):
notice_ids = request.env['yuthon.notice'].sudo().search([('employee_id.id', "=", kwargs.get('employee_id'))])
notice_ids = request.env['yuthon.notice'].sudo().search([('employee_ids.id', "=", kwargs.get('employee_id'))])
data_list = []
for notice in notice_ids:
result = {
'id': notice.id,
'create_data1': notice.create_data1,
'create_date1': fields.Date.to_string(notice.create_date1) if notice.create_date1 else None,
'users_id': notice.users_id.name,
'name': notice.name,
}
data_list.append(result)
return json.dumps({'data': data_list, 'code': 200, 'message': 'success'})
@http.route('/yuthon/notice/detail', methods=['POST'], type='http', auth='none', csrf=False)
def yuthon_notice_detail(self, **kwargs):
notice = request.env['yuthon.notice'].sudo().search([('id', '=', kwargs.get('id'))])
result = {
'id': notice.id,
'create_date1': fields.Date.to_string(notice.create_date1),
'users_id': notice.users_id.name,
'name': notice.name,
'notice_type_id': notice.notice_type_id.name,
'notice_text': notice.notice_text,
}
return json.dumps({
'code': 200,
'message': 'success',
'data': result
})
@http.route('/yuthon/notice/confirm', methods=['POST'], type='http', auth='none', csrf=False)
def yuthon_notice_confirm(self, **kwargs):
notice_id = kwargs.get('id')
employee_id = kwargs.get('employee_id')
confirm_id = request.env['yuthon.confirm.users'].sudo().search([('notice_id', '=', notice_id),('employee_id', '=', employee_id)])
confirm_id.write({'state': 'yes'})
return json.dumps({'code': 200, 'message': 'OK'})
@@ -25,7 +25,10 @@
.attachment-list { text-align: left !important; }
</style>
<div class="title" style="text-align:center; font-weight:bold; font-size:22px; padding:12px 0; margin-bottom:10px;">业务审批单</div>
<div class="dept-container"><strong>部门:</strong><span t-esc="doc.department_id.name"/></div>
<div class="dept-container">
<span style="display:inline-block; margin-right:50px;"><strong>部门:</strong><span t-esc="doc.department_id.name"/></span>
<span style="display:inline-block;"><strong>流水号:</strong><span t-esc="doc.code"/></span>
</div>
<table>
<colgroup>
<col style="width:6em"/>
@@ -35,8 +38,8 @@
<tr><td class="hdr"><strong>事项标题</strong></td><td colspan="2" class="cell-content"><span t-esc="doc.name"/></td></tr>
<tr><td class="hdr"><strong>业务类型</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.information_categories_ids" t-as="category"><span t-esc="category.name"/><t t-if="not category_last">、</t></t></td></tr>
<tr><td class="hdr"><strong>事项说明</strong></td><td colspan="2" class="cell-content"><span t-esc="doc.reason"/></td></tr>
<tr><td class="hdr"><strong>用章类型</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.type_stamp_ids" t-as="stamp"><span t-esc="stamp.name"/><t t-if="not stamp_last">、</t></t></td></tr>
<tr><td class="hdr"><strong>用章范围</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.scope_chapter_ids" t-as="scope"><span t-esc="scope.name"/><t t-if="not scope_last">、</t></t></td></tr>
<tr t-if="doc.is_chapter == 'yes'"><td class="hdr"><strong>用章类型</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.type_stamp_ids" t-as="stamp"><span t-esc="stamp.name"/><t t-if="not stamp_last">、</t></t></td></tr>
<tr t-if="doc.is_chapter == 'yes'"><td class="hdr"><strong>用章范围</strong></td><td colspan="2" class="cell-content"><t t-foreach="doc.scope_chapter_ids" t-as="scope"><span t-esc="scope.name"/><t t-if="not scope_last">、</t></t></td></tr>
<tr><td class="hdr"><strong>附件清单</strong></td><td colspan="2" class="cell-content attachment-list"><t t-foreach="doc.document_ids" t-as="att"><div><t t-esc="att.name"/></div></t></td></tr>
<tr><td class="section" colspan="3"><strong>审批详情</strong></td></tr>
<t t-foreach="doc.log_ids.sorted('sequence')" t-as="log">