diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 14:38:58 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2026-02-04 14:38:58 +0700 |
| commit | d2a64b4e6023f0768d5c326c833fd5a9d8a11444 (patch) | |
| tree | 98149f6da42a924b7ad1a1b01c50feeaa138a0bb /indoteknik_custom/models/purchasing_job_multi_update.py | |
| parent | 8bb3696e35dc122ea153566834a48ec0659e0101 (diff) | |
| parent | fb9b47c3fb5773782f84628764a01c5deb9be035 (diff) | |
Merge branch 'odoo-backup' of bitbucket.org:altafixco/indoteknik-addons into cr_renca_find
merge
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 { |
