diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-25 11:59:33 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-05-25 11:59:33 +0700 |
| commit | ae2dcf170e30653418a2026f215768015b19eb21 (patch) | |
| tree | a0a1f82b17f85eab1478a149c38eb390204ad9bf | |
| parent | d0bcbd1b93719b2145a5cdc131f6fa6c9272a4e6 (diff) | |
fix bug purchasing job
| -rw-r--r-- | indoteknik_custom/models/purchasing_job_multi_update.py | 14 | ||||
| -rw-r--r-- | indoteknik_custom/views/purchasing_job.xml | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/indoteknik_custom/models/purchasing_job_multi_update.py b/indoteknik_custom/models/purchasing_job_multi_update.py index 0145b112..deba960a 100644 --- a/indoteknik_custom/models/purchasing_job_multi_update.py +++ b/indoteknik_custom/models/purchasing_job_multi_update.py @@ -15,15 +15,15 @@ class PurchasingJobMultiUpdate(models.TransientModel): # if product.status_apo == 'apo': # raise UserError('Ada Purchase Order yang statusnya APO, proses dulu') purchasing_job_state = self.env['purchasing.job.state'].search([ - ('purchasing_job_id', '=', product.id), - ('status_apo', '=', 'apo') + ('purchasing_job_id', '=', product.id) ]) - if not purchasing_job_state: - purchasing_job_state.create({ - 'purchasing_job_id': product.id, - 'status_apo': 'apo', - }) + purchasing_job_state.unlink() + + purchasing_job_state.create({ + 'purchasing_job_id': product.id, + 'status_apo': 'apo', + }) apo = self.env['automatic.purchase'].generate_regular_purchase(products) return { diff --git a/indoteknik_custom/views/purchasing_job.xml b/indoteknik_custom/views/purchasing_job.xml index 290955cf..16f1bedd 100644 --- a/indoteknik_custom/views/purchasing_job.xml +++ b/indoteknik_custom/views/purchasing_job.xml @@ -14,7 +14,7 @@ <field name="onhand"/> <field name="incoming"/> <field name="outgoing"/> - <field name="status_apo"/> + <field name="status_apo" invisible="1"/> <field name="action"/> <field name="note"/> </tree> |
