summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstephanchrst <stephanchrst@gmail.com>2023-04-03 15:53:07 +0700
committerstephanchrst <stephanchrst@gmail.com>2023-04-03 15:53:07 +0700
commit81459d357684bed948dce1ade7d195036c99a82d (patch)
treeba1a68314740d982dbdd2c13992aa6d53ac44846
parent85f0d48ed4da1f6c72bec2dcf5208c48b1d2ee08 (diff)
only for altama will be split PO
-rw-r--r--indoteknik_custom/models/automatic_purchase.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py
index af46dd8e..60444b6a 100644
--- a/indoteknik_custom/models/automatic_purchase.py
+++ b/indoteknik_custom/models/automatic_purchase.py
@@ -45,17 +45,18 @@ class AutomaticPurchase(models.Model):
], order='brand_id')
count = brand_id = 0
for product in products_vendors:
- if count == 200 or brand_id != product.brand_id.id:
+ if vendor.id == 5571 and (count == 200 or brand_id != product.brand_id.id):
count = 0
counter_po_number += 1
new_po = self.env['purchase.order'].create([param_header])
- # print (new_po.name)
new_po.name = new_po.name + "/A/"+str(counter_po_number)
self.env['automatic.purchase.match'].create([{
'automatic_purchase_id': self.id,
'order_id': new_po.id
}])
self.env.cr.commit()
+ else:
+ new_po = self.env['purchase.order'].create([param_header])
brand_id = product.brand_id.id
count += 10
param_line = {