Skip to Content
เมนู
คุณต้องลงทะเบียนเพื่อโต้ตอบกับคอมมูนิตี้
คำถามนี้ถูกตั้งค่าสถานะ
1 ตอบกลับ
86 มุมมอง

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.

อวตาร
ละทิ้ง
Related Posts ตอบกลับ มุมมอง กิจกรรม
0
ก.พ. 23
3045
2
ก.ย. 20
5157
1
ก.พ. 19
2791
0
มี.ค. 15
4231
2
มี.ค. 15
7311