From a24279f6e69fe5a625baf5a667f5e207880498d2 Mon Sep 17 00:00:00 2001 From: mgw <1392924357@qq.com> Date: Mon, 30 Dec 2024 21:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8F=90=E4=BA=A4=E5=AE=A1?= =?UTF-8?q?=E6=89=B9=E7=9A=84=E9=80=9A=E7=9F=A5=E6=B6=88=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- jikimo_purchase_tier_validation/models/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/jikimo_purchase_tier_validation/models/models.py b/jikimo_purchase_tier_validation/models/models.py index 4602eb50..bcc18bb6 100644 --- a/jikimo_purchase_tier_validation/models/models.py +++ b/jikimo_purchase_tier_validation/models/models.py @@ -64,6 +64,15 @@ class jikimo_purchase_tier_validation(models.Model): if error_messages: raise ValidationError('\n'.join(error_messages)) + # 添加通知消息 + if hasattr(record, 'message_post'): + current_user = self.env.user.name + record.message_post( + body=f"{current_user} 提交审批", + message_type='notification', + subtype_xmlid='mail.mt_note' + ) + return super(jikimo_purchase_tier_validation, self).request_validation() # 上传合同文件