summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models
diff options
context:
space:
mode:
authorMiqdad <ahmadmiqdad27@gmail.com>2025-08-06 08:55:23 +0700
committerMiqdad <ahmadmiqdad27@gmail.com>2025-08-06 08:55:23 +0700
commit71dd0102df8cc3831a3c13d4bc0f430b061d1094 (patch)
tree9a563ec9bee53866da98cc30de358d1210248fc3 /indoteknik_custom/models
parent9f9081714356e87500ab05bc5a294e9ca9e526fe (diff)
parentc42bdba2996d85d328897e42e7a1d86001b3a14d (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into odoo-backup
Diffstat (limited to 'indoteknik_custom/models')
-rwxr-xr-xindoteknik_custom/models/__init__.py1
-rwxr-xr-xindoteknik_custom/models/purchase_order.py6
-rw-r--r--indoteknik_custom/models/update_date_planned_po_wizard.py14
3 files changed, 18 insertions, 3 deletions
diff --git a/indoteknik_custom/models/__init__.py b/indoteknik_custom/models/__init__.py
index 51d25c1f..3a9f9312 100755
--- a/indoteknik_custom/models/__init__.py
+++ b/indoteknik_custom/models/__init__.py
@@ -156,3 +156,4 @@ from . import refund_sale_order
# from . import patch
from . import tukar_guling
from . import tukar_guling_po
+from . import update_date_planned_po_wizard \ No newline at end of file
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 27aca0d1..103a9131 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -1083,9 +1083,9 @@ class PurchaseOrder(models.Model):
# Tambahan: redirect ke BU hanya untuk single PO yang berhasil dikonfirmasi
_logger.info("Jumlah PO: %s | State: %s", len(self), self.state)
- if len(self) == 1:
- _logger.info("Redirecting ke BU")
- return self.action_view_related_bu()
+ # if len(self) == 1:
+ # _logger.info("Redirecting ke BU")
+ # return self.action_view_related_bu()
return res
diff --git a/indoteknik_custom/models/update_date_planned_po_wizard.py b/indoteknik_custom/models/update_date_planned_po_wizard.py
new file mode 100644
index 00000000..a0d241c8
--- /dev/null
+++ b/indoteknik_custom/models/update_date_planned_po_wizard.py
@@ -0,0 +1,14 @@
+from odoo import models, fields, api
+
+class PurchaseOrderUpdateDateWizard(models.TransientModel):
+ _name = 'purchase.order.update.date.wizard'
+ _description = 'Wizard to Update Receipt Date on Purchase Order Lines'
+
+ date_planned = fields.Datetime(string="New Receipt Date", required=True)
+
+ def action_update_date(self):
+ active_ids = self.env.context.get('active_ids', [])
+ orders = self.env['purchase.order'].browse(active_ids)
+ for order in orders:
+ order.write({'date_planned': self.date_planned})
+ return {'type': 'ir.actions.act_window_close'}