diff options
| -rw-r--r-- | indoteknik_custom/models/automatic_purchase.py | 8 | ||||
| -rwxr-xr-x | indoteknik_custom/models/product_template.py | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/indoteknik_custom/models/automatic_purchase.py b/indoteknik_custom/models/automatic_purchase.py index 6478f2c9..af09abf0 100644 --- a/indoteknik_custom/models/automatic_purchase.py +++ b/indoteknik_custom/models/automatic_purchase.py @@ -183,8 +183,10 @@ class AutomaticPurchase(models.Model): def create_po_by_vendor(self, vendor_id): current_time = datetime.now() - # if not self.apo_type =='reordering': - # self.check_qty_po() + if not self.apo_type =='reordering': + name = "/PJ/" + else: + name = "/A/" PRODUCT_PER_PO = 20 @@ -218,7 +220,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 + "/PJ/" + str(i + 1) + new_po.name = new_po.name + name + str(i + 1) self.env['automatic.purchase.match'].create([{ 'automatic_purchase_id': self.id, diff --git a/indoteknik_custom/models/product_template.py b/indoteknik_custom/models/product_template.py index 4bab2cad..8494e18a 100755 --- a/indoteknik_custom/models/product_template.py +++ b/indoteknik_custom/models/product_template.py @@ -410,7 +410,7 @@ class ProductProduct(models.Model): for product in self: qty_onhand = self.env['stock.quant'].search([ ('product_id', '=', product.id), - ('location_id', '=', 57) + ('location_id', 'in', [57, 83]) ]) qty = sum(qty_onhand.mapped('quantity')) product.qty_onhand_bandengan = qty |
