From 5446eefa619906ba785d1f867fd828cce0d0748c Mon Sep 17 00:00:00 2001 From: Azka Nathan Date: Fri, 29 Dec 2023 13:44:00 +0700 Subject: multi update paid status on po --- .../models/purchase_order_multi_update.py | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 indoteknik_custom/models/purchase_order_multi_update.py (limited to 'indoteknik_custom/models/purchase_order_multi_update.py') diff --git a/indoteknik_custom/models/purchase_order_multi_update.py b/indoteknik_custom/models/purchase_order_multi_update.py new file mode 100644 index 00000000..aab46de8 --- /dev/null +++ b/indoteknik_custom/models/purchase_order_multi_update.py @@ -0,0 +1,22 @@ +from odoo import models, fields +import logging + +_logger = logging.getLogger(__name__) + + +class PurchaseOrderMultiUpdate(models.TransientModel): + _name = 'purchase.order.multi_update' + + def save_multi_update_paid_status(self): + purchase_ids = self._context['purchase_ids'] + purchase = self.env['purchase.order'].browse(purchase_ids) + purchase.action_multi_update_paid_status() + return { + 'type': 'ir.actions.client', + 'tag': 'display_notification', + 'params': { + 'title': 'Notification', + 'message': 'Paid Status berhasil diubah', + 'next': {'type': 'ir.actions.act_window_close'}, + } + } \ No newline at end of file -- cgit v1.2.3