微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

如何解决 TypeError: _message_auto_subscribe() 在我的 mail_thread.py 中得到了一个意外的关键字参数“followers_existing_policy”

如何解决如何解决 TypeError: _message_auto_subscribe() 在我的 mail_thread.py 中得到了一个意外的关键字参数“followers_existing_policy”

如果我点击通过邮件发送,则会自动添加一个关注者。我不需要那个。这里的代码是停止自动订阅

错误

TypeError: _message_auto_subscribe() 得到一个意外的关键字参数 'followers_existing_policy'

代码

mail_thread.py

from odoo import api,fields,models,_
from distutils.util import strtobool 


class MailThread(models.AbstractModel):
    _inherit = "mail.thread"

    def message_subscribe(self,partner_ids=None,channel_ids=None,subtype_ids=None):
        ir_config = self.env['ir.config_parameter']
        app_stop_subscribe = bool(strtobool(ir_config.sudo().get_param('app_stop_subscribe')))
        if app_stop_subscribe:
            return
        else:
            return super(MailThread,self).message_subscribe(partner_ids,channel_ids,subtype_ids)

    def _message_auto_subscribe(self,updated_fields):
        ir_config = self.env['ir.config_parameter']
        app_stop_subscribe = bool(strtobool(ir_config.sudo().get_param('app_stop_subscribe')))
        if app_stop_subscribe:
            return
        else:
            return super(MailThread,self)._message_auto_subscribe(updated_fields)

    def _message_auto_subscribe_notify(self,partner_ids,template):
        ir_config = self.env['ir.config_parameter']
        app_stop_subscribe = bool(strtobool(ir_config.sudo().get_param('app_stop_subscribe')))
        if app_stop_subscribe:
            return
        else:
            return super(MailThread,self)._message_auto_subscribe_notify(partner_ids,template)

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。