diff options
| -rw-r--r-- | indoteknik_custom/models/tukar_guling.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index e5f98467..cd9a1bd1 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -578,6 +578,8 @@ class TukarGuling(models.Model): }) created_returns.append(srt_picking) _logger.info(f"✅ SRT created: {srt_picking.name}") + record.message_post( + body=f"📦 <b>{srt_picking.name}</b> created by <b>{self.env.user.name}</b> (state: <b>{srt_picking.state}</b>)") ### ======== ORT dari BU/PICK ========= ort_pickings = [] @@ -637,6 +639,8 @@ class TukarGuling(models.Model): created_returns.append(ort_picking) ort_pickings.append(ort_picking) _logger.info(f"✅ ORT created: {ort_picking.name}") + record.message_post( + body=f"📦 <b>{ort_picking.name}</b> created by <b>{self.env.user.name}</b> (state: <b>{ort_picking.state}</b>)") ### ======== Tukar Guling: BU/OUT dan BU/PICK baru ======== if record.return_type == 'tukar_guling': @@ -682,6 +686,8 @@ class TukarGuling(models.Model): new_pick.action_confirm() created_returns.append(new_pick) _logger.info(f"✅ BU/PICK Baru dari ORT created: {new_pick.name}") + record.message_post( + body=f"📦 <b>{new_pick.name}</b> created by <b>{self.env.user.name}</b> (state: <b>{new_pick.state}</b>)") # BU/OUT Baru dari SRT if srt_picking: @@ -718,6 +724,8 @@ class TukarGuling(models.Model): }) created_returns.append(new_out) _logger.info(f"✅ BU/OUT Baru dari SRT created: {new_out.name}") + record.message_post( + body=f"📦 <b>{new_out.name}</b> created by <b>{self.env.user.name}</b> (state: <b>{new_out.state}</b>)") if not created_returns: raise UserError("Tidak ada dokumen retur berhasil dibuat.") |
