From baec9fde359cce46e216015e5d50a9a41de911fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Sat, 23 Nov 2024 18:16:14 +0800 Subject: [PATCH] pengyuthon wechat --- soong_workflow/models/soong_workflow.py | 2 +- .../wizard/soong_workflow_comment_wizard.py | 6 +-- .../models/yuthon_lessee_notice.py | 11 ----- .../views/yuthon_lessee_notice.xml | 40 +++++++++---------- yuthon_notice/data/notice_code_data.xml | 26 ++++++------ yuthon_notice/models/yuthon_notice.py | 16 +++++--- yuthon_will_task/models/yuthon_will_task.py | 14 ++++--- 7 files changed, 55 insertions(+), 60 deletions(-) diff --git a/soong_workflow/models/soong_workflow.py b/soong_workflow/models/soong_workflow.py index 0833a28dd..36b7bbc6f 100644 --- a/soong_workflow/models/soong_workflow.py +++ b/soong_workflow/models/soong_workflow.py @@ -104,7 +104,7 @@ class SoongWorkflow(models.Model): @api.depends('start_date', 'end_date') def compute_is_enable(self): for rec in self: - if rec.start_date and rec.end_date: + if rec.start_date and rec.end_date and self.name: if rec.start_date <= fields.Date.today() < rec.end_date: is_enable_ids = self.search([('model_id', '=', self.model_id.id), ('is_enable', '=', True)]) if len(is_enable_ids) <= 1: diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 85804efe5..e451d6445 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -85,7 +85,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): url = "https://oa.thtzjt.com/mail/view?model={}&res_id={}".format(self.res_model, record_id.id) self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=employee.wecom_userid, - title="审批抄送提醒", + title=record_id.name + "审批抄送提醒", description="您有新的抄送提醒请及时查看", url=url, btntxt="详细信息") # 转交逻辑--单线 @@ -98,7 +98,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): url = 'https://oa.thtzjt.com/mail/view?model={}&res_id={}'.format(self.res_model, self.res_id) for employee in self.employee_ids: self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=employee.wecom_userid, - title=self.name, + title=record_id.name, description="您有新的审批单请及时处理", url=url, btntxt="详情") return self.node_btn_id.with_context(cx).run() @@ -107,7 +107,7 @@ class SoongWorkflowCommentWizard(models.TransientModel): url = 'https://oa.thtzjt.com/mail/view?model={}&res_id={}'.format(self.res_model, self.res_id) for employee in self.employee_ids: self.sudo().env["wecom.apps"].sync_send_message_textcard(category='oa', user_id=employee.wecom_userid, - title=self.name, + title=record_id.name, description="您的审批单已被退回,请查看详情", url=url, btntxt="详情") return self.node_btn_id.with_context(cx).run() diff --git a/yuthon_lessee_service/models/yuthon_lessee_notice.py b/yuthon_lessee_service/models/yuthon_lessee_notice.py index 7d8b5d338..b7c255c72 100644 --- a/yuthon_lessee_service/models/yuthon_lessee_notice.py +++ b/yuthon_lessee_service/models/yuthon_lessee_notice.py @@ -108,17 +108,6 @@ class YuthonLesseeNotice(models.Model): data = "您有新的通知公告请及时确认\n" + "{}".format(str, self.name) we_id = self.env['hr.employee'].search([('id', '=', user)]).wecom_userid self.sudo().env["wecom.apps"].sync_send_message(we_id, data) - # # 待办关联 - # self.env['project.task'].create({ - # 'name': '新的通知公告' + self.name + "请及时确认", - # 'user_ids': [(4, user)], - # 'notice_origin_id': self.id, - # }) - - # 普通用户权限是否打开,可能需要配置权限 - # 关联待办和不关联待办 - # partner_ids = self.sudo().env['res.users'].search([('id', 'in', publish_user_list)]).mapped('partner_id').ids - # self.sudo().with_context(lang=self.env.lang)._message_auto_subscribe_notify(partner_ids, 'yuthon_notice.message_yuthon_confirm_users_data') self.write({"notice_state": 'yes'}) def look_up_notice_users(self): diff --git a/yuthon_lessee_service/views/yuthon_lessee_notice.xml b/yuthon_lessee_service/views/yuthon_lessee_notice.xml index ec1cf8d70..7c96dbded 100644 --- a/yuthon_lessee_service/views/yuthon_lessee_notice.xml +++ b/yuthon_lessee_service/views/yuthon_lessee_notice.xml @@ -11,8 +11,8 @@ - - + +