diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-24 09:19:43 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-07-24 09:19:43 +0700 |
| commit | 3614078d30a5dd148d11720963eb49cb2d2cc886 (patch) | |
| tree | 43ff8d0a32547528970d59f0b3c1ef4d3a1c80d3 | |
| parent | 03671ebe8fa1c7173d772a31543c4bb5125bd741 (diff) | |
<miqdad> tracking when create a new return
| -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.") |
