diff options
| author | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-17 11:52:04 +0700 |
|---|---|---|
| committer | Rafi Zadanly <zadanlyr@gmail.com> | 2023-04-17 11:52:04 +0700 |
| commit | 015ca8f0ae8ecdaaf388ee08420af54a84fb2d0c (patch) | |
| tree | 6e95bf27732dc9958ab161363a121bd46d68b717 /indoteknik_custom/models/purchase_order.py | |
| parent | 719dc824379bff729a97007432ef6871954b0980 (diff) | |
| parent | 4eb477f655231e39eaacb4453f216692a8355bac (diff) | |
Merge branch 'release' into staging
Diffstat (limited to 'indoteknik_custom/models/purchase_order.py')
| -rwxr-xr-x | indoteknik_custom/models/purchase_order.py | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/indoteknik_custom/models/purchase_order.py b/indoteknik_custom/models/purchase_order.py index 0ef6a9f2..8809d048 100755 --- a/indoteknik_custom/models/purchase_order.py +++ b/indoteknik_custom/models/purchase_order.py @@ -139,11 +139,17 @@ class PurchaseOrder(models.Model): self.order_line.unlink() for order_line in self.sale_order_id.order_line: if order_line.product_id.id and order_line.product_id.id not in products_exception: + qty_available = order_line.product_id.virtual_available + suggest = 'harus beli' + if order_line.product_id.virtual_available > order_line.product_qty: + suggest = 'masih cukup' values = { 'order_id': self.id, 'product_id': order_line.product_id.id, 'name': order_line.product_id.display_name, 'product_qty': order_line.product_qty, + 'qty_available_store': qty_available, + 'suggest': suggest, } self.env['purchase.order.line'].sudo().create(values) |
