diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-11 16:16:45 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-11-11 16:16:45 +0700 |
| commit | d8dd0813ff6760e4a06968967594d27c6fd3b9d5 (patch) | |
| tree | 264a18adb5e15c3ecd80b4790451698bbc6947d0 /indoteknik_custom/models/approval_retur_picking.py | |
| parent | 17d46cf9f4eede8177b2373c03d5b36123f712c1 (diff) | |
| parent | 4be403f544f63a5161275f0d600c6f6950f3a30c (diff) | |
Merge branch 'approval_retur_picking' into production
# Conflicts:
# indoteknik_custom/models/requisition.py
# indoteknik_custom/views/requisition.xml
Diffstat (limited to 'indoteknik_custom/models/approval_retur_picking.py')
| -rw-r--r-- | indoteknik_custom/models/approval_retur_picking.py | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/indoteknik_custom/models/approval_retur_picking.py b/indoteknik_custom/models/approval_retur_picking.py new file mode 100644 index 00000000..34c449a8 --- /dev/null +++ b/indoteknik_custom/models/approval_retur_picking.py @@ -0,0 +1,38 @@ +from odoo import models, fields +import logging + +_logger = logging.getLogger(__name__) + + +class ApprovalReturPicking(models.TransientModel): + _name = 'approval.retur.picking' + _description = 'Wizard to add Note Return' + + note_return = fields.Text(string="Note Return") + + def action_confirm_note_return(self): + picking_ids = self._context.get('picking_ids') + picking = self.env['stock.picking'].browse(picking_ids) + + # Update the note_return field + picking.update({ + 'approval_return_status': 'pengajuan1' + }) + + # Post a highlighted message to lognote + # picking.message_post( + # body=f"<div style='background-color: #fdf2e9; border: 1px solid #f5c6cb; padding: 10px;'>" + # f"<b>Note Return (Pinned):</b><br>{self.note_return}</div>", + # subtype_id=self.env.ref("mail.mt_note").id + # ) + + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Notification', + 'message': 'Status pengajuan telah berubah', + 'next': {'type': 'ir.actions.act_window_close'}, + } + } + |
