summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/automatic_purchase.py2
-rwxr-xr-xindoteknik_custom/models/purchase_order.py9
-rw-r--r--indoteknik_custom/views/automatic_purchase.xml7
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"