diff --git a/soong_workflow/models/soong_workflow_mixin.py b/soong_workflow/models/soong_workflow_mixin.py index 29b427174..df236d802 100644 --- a/soong_workflow/models/soong_workflow_mixin.py +++ b/soong_workflow/models/soong_workflow_mixin.py @@ -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 diff --git a/yuthon_notice/controllers/main.py b/yuthon_notice/controllers/main.py index 15731c1e2..516d1361d 100644 --- a/yuthon_notice/controllers/main.py +++ b/yuthon_notice/controllers/main.py @@ -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'}) + + diff --git a/yuthon_trade/report/business_approval_print_templates.xml b/yuthon_trade/report/business_approval_print_templates.xml index 98603d261..1dc9eec57 100644 --- a/yuthon_trade/report/business_approval_print_templates.xml +++ b/yuthon_trade/report/business_approval_print_templates.xml @@ -25,7 +25,10 @@ .attachment-list { text-align: left !important; }
| 事项标题 | ||
| 业务类型 | ||
| 事项说明 | ||
| 用章类型 | ||
| 用章范围 | ||
| 用章类型 | ||
| 用章范围 | ||
| 附件清单 | ||
| 审批详情 | ||