summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorit-fixcomart <it@fixcomart.co.id>2025-05-27 10:09:54 +0700
committerit-fixcomart <it@fixcomart.co.id>2025-05-27 10:09:54 +0700
commitb7cb8418e18de4507bc81d04e8c150f78343b92e (patch)
treea6eef685d6d7a59ffe8192570b605f408cac5a04
parent121f5f732fc837e1f8b801eaaed038962aa574fd (diff)
<hafid> validation qty demand
-rw-r--r--indoteknik_custom/models/stock_picking.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index 0fcb7ca1..cbfcda22 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1269,6 +1269,20 @@ class StockPicking(models.Model):
current_time = datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S')
self.date_reserved = current_time
+ # Validate Qty Demand Can't higher than Qty Product
+ for move_line in self.move_line_ids_without_package:
+ purchase_line = move_line.move_id.purchase_line_id
+ if purchase_line:
+ if purchase_line.product_uom_qty < move_line.product_uom_qty:
+ raise UserError(
+ _("Quantity demand (%s) tidak bisa lebih besar dari qty product (%s) untuk produk %s") % (
+ move_line.product_uom_qty,
+ purchase_line.product_uom_qty,
+ move_line.product_id.display_name
+ )
+ )
+
+
self.validation_minus_onhand_quantity()
self.responsible = self.env.user.id
# self.send_koli_to_so()