summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 e83ab13f..a215eb74 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -1270,6 +1270,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()