diff options
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 5 |
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 = { |
