diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-12 08:27:42 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-02-12 08:27:42 +0700 |
| commit | 0738a192409687790c16c757f85fe440cb1f377d (patch) | |
| tree | fbfc307d46a178d698c9694192677d33c4d3ebdb | |
| parent | c76e3d6126c3d595a6c3c5d6802a9f5e7015f378 (diff) | |
change request purchasing job
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 713853e9..da845645 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -63,13 +63,6 @@ class AutomaticPurchase(models.Model): def create_po_from_automatic_purchase(self): - po = self.env['purchase.order'].search([ - ('state', '=', 'draft') - ]) - - if po: - raise UserError('Ada PO yang statusnya draft, proses dulu') - if not self.purchase_lines: raise UserError('Tidak ada Lines, belum bisa create PO') if self.is_po: @@ -270,6 +263,11 @@ class AutomaticPurchase(models.Model): sales_order_purchase_match = self.env['sales.order.purchase.match'].create([matches_po_line]) def generate_regular_purchase(self): + po = self.env['purchase.order'].search([ + ('state', '=', 'draft') + ]) + if po: + raise UserError('Ada PO yang statusnya draft, proses dulu') if self.apo_type == 'reordering': raise UserError('Tombol ini hanya untuk Regular Fulfill SO') if self.vendor_id: |
