prepare #I6SC9C app_chatgpt优化,指定用户时增加使用情况

This commit is contained in:
Chill
2023-04-12 17:50:36 +08:00
parent fbc2453f8f
commit 3304a1f5a6
8 changed files with 185 additions and 105 deletions

View 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)