summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-09-04 15:46:05 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-09-04 15:46:05 +0700
commitdd2bc67bbdaa771adf6bbedc01ba23a98ea03574 (patch)
tree0dac5c3c6fe8e7f719eaa25390a7d78a03e72181
parent4da5af474edea6a61453dcc8485cefaa7fe6dd42 (diff)
<Miqdad> Gk jadi
-rw-r--r--indoteknik_custom/models/report_logbook_sj.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/indoteknik_custom/models/report_logbook_sj.py b/indoteknik_custom/models/report_logbook_sj.py
index 6915ad9b..e67ea724 100644
--- a/indoteknik_custom/models/report_logbook_sj.py
+++ b/indoteknik_custom/models/report_logbook_sj.py
@@ -39,10 +39,6 @@ class ReportLogbookSJ(models.Model):
count_line = fields.Char(string='Count Line', compute='_compute_count_line')
- def write(self, vals):
- self.action_send_to_telegram()
- res = super(ReportLogbookSJ, self).write(vals)
-
@api.depends('report_logbook_sj_line')
def _compute_count_line(self):
for rec in self:
@@ -51,6 +47,8 @@ class ReportLogbookSJ(models.Model):
@api.model
def create(self, vals):
vals['name'] = self.env['ir.sequence'].next_by_code('report.logbook.sj') or '0'
+ # if self.env.user.has_group('indoteknik_custom.group_role_logistic'):
+ # self.action_send_to_telegram()
result = super(ReportLogbookSJ, self).create(vals)
return result
@@ -72,9 +70,7 @@ class ReportLogbookSJ(models.Model):
def action_send_to_telegram(self):
- user_logistic = self.env.ref('indoteknik_custom.group_role_logistic')
- if self.user != user_logistic:
- return
+
entries = []
pickings = self.report_logbook_sj_line.mapped('picking_id')
for p in pickings:
@@ -95,7 +91,7 @@ class ReportLogbookSJ(models.Model):
seen.add(key)
unique_entries.append((name, pid))
- header = f"Saya {self.env.user.name} sudah mengisi di Logbook SJ Report:\n"
+ header = f"{self.env.user.name} sudah mengisi di Logbook SJ Report:\n"
body = "\n".join(f"{name} ({pid or '-'})" for name, pid in unique_entries) if unique_entries else "- (tidak ada)"
text = header + body