禁用自动添加伙伴作为跟随者在奥多10

2024-04-25 17:53:16 发布

您现在位置:Python中文网/ 问答频道 /正文

我怎么能停止自动添加伙伴作为追随者在奥多10。每当我创建一个新的报价单或机会,合作伙伴会自动添加到关注者列表中,并且会向我不想要的合作伙伴发送电子邮件通知。在

我怎样才能防止这种情况发生?在


Tags: 列表电子邮件情况合作伙伴机会伙伴追随者报价单
2条回答

你可以用简单的方法来做。在

例如:

class sale_order(models.Model):
    _inherit="sale.order"

    @api.model
    def create(self,vals):
        res=super(sale_order,self.with_context('mail_create_nosubscribe':True)).create(vals)
        return res

如果您在上下文中传递mail_create_nosubscribe True,系统将不会在消息中添加默认关注者。在

Odoo is supporting mainly three type of keyword in the mail message context,using that you can enable/disable processes model wise.

1.跟踪禁用:在创建和写入时,执行无邮件线程功能(自动订阅、跟踪、投递…)

2.mail_create_nosubscribe:在创建或消息发布时,不要订阅 记录线程的uid

3.mail_create\u nolog:在创建时,不要记录自动' “已创建”消息

You need to just pass value in the context, system will disable above features.

这可能对你有帮助。在

没有足够的声誉发表这篇评论,所以它必须是一个答案,抱歉。在

你的回答让我在路上走得很好,我稍微修改了一下代码,让它对我有用。在

class sale_order(models.Model):
    _inherit="sale.order"
    @api.model
        def create(self, vals):    
            res = super(sale_order, self.with_context(mail_create_nosubscribe=True)).create(vals)

此外,我注意到在订单确认时,合作伙伴仍在添加中。 我用以下代码解决了这个问题:

^{pr2}$

相关问题 更多 >