mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
prepare #I6SC9C app_chatgpt优化,指定用户时增加使用情况
This commit is contained in:
18
app_chatgpt/models/mail_thread.py
Normal file
18
app_chatgpt/models/mail_thread.py
Normal file
@@ -0,0 +1,18 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
from odoo import fields, models, api, _
|
||||
from .lib.WordsSearch import WordsSearch
|
||||
|
||||
|
||||
class MailThread(models.AbstractModel):
|
||||
_inherit = "mail.thread"
|
||||
|
||||
@api.returns('mail.message', lambda value: value.id)
|
||||
def message_post(self, **kwargs):
|
||||
self.ensure_one()
|
||||
search = WordsSearch()
|
||||
search.SetKeywords([])
|
||||
body = kwargs.get('body', False)
|
||||
body = search.Replace(text=body)
|
||||
kwargs.update({'body': body})
|
||||
return super(MailThread, self).message_post(**kwargs)
|
||||
Reference in New Issue
Block a user