diff options
| author | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-03 14:30:17 +0700 |
|---|---|---|
| committer | Azka Nathan <darizkyfaz@gmail.com> | 2024-04-03 14:30:17 +0700 |
| commit | 72b6d34df5606cf2be49bb66936be092b86c9d15 (patch) | |
| tree | 971eddbc5eb0f84258886a744e85607fa90fb63c | |
| parent | 357c51e9d3f73831d7b565ac8e1beb83430931ef (diff) | |
Change request automatic purchase and bug fixing
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 2 | ||||
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 9 | ||||
| -rw-r--r-- | indoteknik_custom/views/automatic_purchase.xml | 7 |
3 files changed, 6 insertions, 12 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 4a892b05..485f7a45 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -187,7 +187,7 @@ class AutomaticPurchase(models.Model): # i start from zero (0) for i in range(page): new_po = self.env['purchase.order'].create([param_header]) - new_po.name = new_po.name + "/A/" + str(i + 1) + new_po.name = new_po.name + "/B/" + str(i + 1) self.env['automatic.purchase.match'].create([{ 'automatic_purchase_id': self.id, diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 8f107de1..35fefbe2 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -458,10 +458,11 @@ class PurchaseOrder(models.Model): return res def compute_total_margin(self): - if self.from_apo: - self.compute_total_margin_from_apo() - return - + for rec in self: + if rec.from_apo: + rec.compute_total_margin_from_apo() + return + sum_so_margin = sum_sales_price = sum_margin = 0 for line in self.order_line: sale_order_line = line.so_line_id diff --git a/indoteknik_custom/views/automatic_purchase.xml b/indoteknik_custom/views/automatic_purchase.xml index 17abd888..360fdd16 100644 --- a/indoteknik_custom/views/automatic_purchase.xml +++ b/indoteknik_custom/views/automatic_purchase.xml @@ -113,13 +113,6 @@ /> </div> <div> - <button name="generate_regular_purchase" - string="Generate Fulfillment" - type="object" - class="mr-2 oe_highlight" - /> - </div> - <div> <button name="create_po_from_automatic_purchase" string="Create PO" type="object" |
