From dfd4a1617d2c62b99d4bbcb6386b477874a33ebf Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Tue, 9 Jan 2024 15:03:15 +0700 Subject: multiple confirm purchase orders --- .../models/purchase_order_multi_confirm.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 indoteknik_custom/models/purchase_order_multi_confirm.py (limited to 'indoteknik_custom/models/purchase_order_multi_confirm.py') diff --git a/indoteknik_custom/models/purchase_order_multi_confirm.py b/indoteknik_custom/models/purchase_order_multi_confirm.py new file mode 100644 index 00000000..ac77ca54 --- /dev/null +++ b/indoteknik_custom/models/purchase_order_multi_confirm.py @@ -0,0 +1,22 @@ +from odoo import models, fields +import logging + +_logger = logging.getLogger(__name__) + + +class PurchaseOrderMultiUpdate(models.TransientModel): + _name = 'purchase.order.multi_confirm' + + def save_multi_confirm_po(self): + order_ids = self._context['order_ids'] + purchase = self.env['purchase.order'].browse(order_ids) + purchase.action_multi_confirm_po() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Notification', + 'message': 'PO berhasil di Confirm', + 'next': {'type': 'ir.actions.act_window_close'}, + } + } \ No newline at end of file -- cgit v1.2.3