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"
" # f"Note Return (Pinned):
{self.note_return}
", # 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'}, } }