summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order_multi_update.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2023-12-29 13:44:00 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2023-12-29 13:44:00 +0700
commit5446eefa619906ba785d1f867fd828cce0d0748c (patch)
treeaaaed54b3a366dd61c82f3ceece2f0650d4ab5cf /indoteknik_custom/models/purchase_order_multi_update.py
parent08724b92174a216a64b382012e83e45c16b326e7 (diff)
multi update paid status on po
Diffstat (limited to 'indoteknik_custom/models/purchase_order_multi_update.py')
-rw-r--r--indoteknik_custom/models/purchase_order_multi_update.py22
1 files changed, 22 insertions, 0 deletions
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