summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchase_order.py
diff options
context:
space:
mode:
authorAzka Nathan <darizkyfaz@gmail.com>2024-06-06 10:45:47 +0700
committerAzka Nathan <darizkyfaz@gmail.com>2024-06-06 10:45:47 +0700
commit00ebebce72441282bae3494088b9d6dd28df6e97 (patch)
treea044ed69f7715c1008c4fc2a90b1b5a285ad0b8a /indoteknik_custom/models/purchase_order.py
parent9acb6bc2039b7004105a1987be8002c4067f85f9 (diff)
add short_spesification on product variant, fix note detail purchasing job
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
-rwxr-xr-xindoteknik_custom/models/purchase_order.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py
index 5946399d..3a959391 100755
--- a/indoteknik_custom/models/purchase_order.py
+++ b/indoteknik_custom/models/purchase_order.py
@@ -388,9 +388,22 @@ class PurchaseOrder(models.Model):
delta_time = delta_time.strftime('%Y-%m-%d %H:%M:%S')
self.date_planned = delta_time
self.date_deadline_ref_date_planned()
+ self.unlink_purchasing_job_state()
return res
+ def unlink_purchasing_job_state(self):
+ for line in self.order_line:
+ purchasing_job_state = self.env['purchasing.job.state'].search([
+ ('purchasing_job_id', '=', line.product_id.id)
+ ])
+
+ if purchasing_job_state:
+ for purchasing_job in purchasing_job_state:
+ purchasing_job.unlink()
+
+
+
def _send_po_not_sync(self):
# Mengirim data ke model Po Sync Price jika harga po dan purchase pricelist tidak singkron
for line in self.order_line: