summaryrefslogtreecommitdiff
path: root/indoteknik_custom/models/purchasing_job_multi_update.py
diff options
context:
space:
mode:
authorMqdd <ahmadmiqdad27@gmail.com>2026-01-22 13:51:02 +0700
committerMqdd <ahmadmiqdad27@gmail.com>2026-01-22 13:51:02 +0700
commit4f73c6225571608e0fed6ee94ae0d2c91eaefd1a (patch)
treef14b163f4793f1aee74d315557abc0cf27b83073 /indoteknik_custom/models/purchasing_job_multi_update.py
parent7e52c025439a8614a1ec6ae77dfdda934989a09b (diff)
parent230027f0bfedfedc27e5067d0b25d167f751688b (diff)
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into gudang-service
merge
Diffstat (limited to 'indoteknik_custom/models/purchasing_job_multi_update.py')
-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 {