コンテンツへスキップ
メニュー
この質問にフラグが付けられました

Hi,

I tried overriding activity_update in hr.expense.sheet to prevent notifications:

class HrExpenseSheet(models.Model):

    _inherit = "hr.expense.sheet"

    def activity_update(self):
        records = self.filtered(lambda r: r.state not in ['draft', 'submit', 'approve', 'post', 'done'])
        if records:
            super(HrExpenseSheet, records).activity_update()

But Odoo still sends an email to the manager when the expense sheet state changes. Which method is actually responsible for these notifications, and how can i disable this feature?


Thanks! 

アバター
破棄
最善の回答

Hi,

Please update your code like this,

class HrExpenseSheet(models.Model):

    _inherit = "hr.expense.sheet"

    def activity_update(self):

        records = self.filtered(lambda r: r.state not in ['draft', 'submit', 'approve', 'post', 'done'])

        if not records:

            return

        super(HrExpenseSheet, records).activity_update()


Hope it helps.

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 23
3063
2
9月 20
5168
1
2月 19
2801
0
3月 15
4239
2
3月 15
7326