diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-17 16:40:42 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-17 16:40:42 +0700 |
| commit | 7c893b6cfeae88c82231f682517ae143b4cf580b (patch) | |
| tree | b249c3d3a462d4817a39ff00954765f3a4f7788f /indoteknik_custom/models/purchasing_job_multi_update.py | |
| parent | 8bb3696e35dc122ea153566834a48ec0659e0101 (diff) | |
| parent | a461efcda1637c267b3c4195eb0f7d649f10f145 (diff) | |
Merge branch 'odoo-backup' of https://bitbucket.org/altafixco/indoteknik-addons into cr_renca_find
Diffstat (limited to 'indoteknik_custom/models/purchasing_job_multi_update.py')
| -rw-r--r-- | indoteknik_custom/models/purchasing_job_multi_update.py | 17 |
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 { |
