From 8978868864925683d02342112020e7fc047a4acf Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 2 Feb 2024 13:32:55 +0700 Subject: logbook sj and mark as cancel po --- indoteknik_custom/models/po_multi_cancel.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 indoteknik_custom/models/po_multi_cancel.py (limited to 'indoteknik_custom/models/po_multi_cancel.py') diff --git a/indoteknik_custom/models/po_multi_cancel.py b/indoteknik_custom/models/po_multi_cancel.py new file mode 100644 index 00000000..52c156b5 --- /dev/null +++ b/indoteknik_custom/models/po_multi_cancel.py @@ -0,0 +1,22 @@ +from odoo import models, fields +import logging + +_logger = logging.getLogger(__name__) + + +class PoMultiCancel(models.TransientModel): + _name = 'po.multi.cancel' + + def save_multi_cancel_po(self): + purchase_ids = self._context['purchase_ids'] + purchase = self.env['purchase.order'].browse(purchase_ids) + purchase.button_cancel() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Notification', + 'message': 'Status berhasil diubah', + 'next': {'type': 'ir.actions.act_window_close'}, + } + } \ No newline at end of file -- cgit v1.2.3