summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-22 09:49:07 +0700
committerFIN-IT_AndriFP <andrifebriyadiputra@gmail.com>2026-01-22 09:49:07 +0700
commit230027f0bfedfedc27e5067d0b25d167f751688b (patch)
tree68feac9ba067666194bc60b7a90fda8ad8abfb94
parente0004f24f001e8417f80933caa5b94d36ded003f (diff)
fix edit note pj
-rw-r--r--indoteknik_custom/models/purchasing_job_multi_update.py17
1 files changed, 13 insertions, 4 deletions
diff --git a/indoteknik_custom/models/purchasing_job_multi_update.py b/indoteknik_custom/models/purchasing_job_multi_update.py
index 80a43e45..0eca499f 100644
--- a/indoteknik_custom/models/purchasing_job_multi_update.py
+++ b/indoteknik_custom/models/purchasing_job_multi_update.py
@@ -20,10 +20,19 @@ class PurchasingJobMultiUpdate(models.TransientModel):
# purchasing_job_state.unlink()
- purchasing_job_state.create({
- 'purchasing_job_id': product.id,
- 'status_apo': 'apo',
- })
+ vals = {
+ 'purchasing_job_id': product.id, # Pastikan ID ini benar mapping ke ID produk
+ 'status_apo': 'apo',
+ }
+
+ if purchasing_job_state:
+ purchasing_job_state.write(vals)
+ else:
+ purchasing_job_state.create(vals)
+ # purchasing_job_state.create({
+ # 'purchasing_job_id': product.id,
+ # 'status_apo': 'apo',
+ # })
apo = self.env['automatic.purchase'].generate_regular_purchase(products)
return {