From b9b6d10b518bd9bd80c85216de7ef33cf194f9ba Mon Sep 17 00:00:00 2001 From: Mqdd Date: Mon, 19 Jan 2026 10:37:24 +0700 Subject: add send with user --- indoteknik_custom/models/gudang_service.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/indoteknik_custom/models/gudang_service.py b/indoteknik_custom/models/gudang_service.py index 5aeabb39..8edf57d0 100644 --- a/indoteknik_custom/models/gudang_service.py +++ b/indoteknik_custom/models/gudang_service.py @@ -62,11 +62,13 @@ class GudangService(models.Model): ) % (rec.name, rec.date), 'date_deadline': fields.Date.today(), }) + + # kirim ke private message odoo channel = self.env['mail.channel'].channel_get([self.env.user.partner_id.id, user.partner_id.id]).get('id') if not channel: continue res = self.env['mail.channel'].browse(channel) - res.message_post(body=_('Gudang Service %s masih On Progress sejak %s') % (rec.name, rec.date), message_type='comment', subtype_xmlid='mail.mt_comment') + res.with_user(self.env.user.browse(25)).message_post(body=_('Gudang Service %s masih On Progress sejak %s') % (rec.name, rec.date), message_type='comment', subtype_xmlid='mail.mt_comment') @api.model def cron_notify_onprogress_gudang_service(self): -- cgit v1.2.3