diff options
| author | IT Fixcomart <it@fixcomart.co.id> | 2025-05-30 02:13:42 +0000 |
|---|---|---|
| committer | IT Fixcomart <it@fixcomart.co.id> | 2025-05-30 02:13:42 +0000 |
| commit | ab3b534beaaa9be924741e72c0280289fe6ac5a0 (patch) | |
| tree | e6ac3f55ba46248fd7051acc0317d622580f90ee | |
| parent | cf659eab17c38994334badb8c332450aaf0bf5c9 (diff) | |
| parent | b7cb8418e18de4507bc81d04e8c150f78343b92e (diff) | |
Merged in CR/val-qty (pull request #316)
<hafid> validation qty demand
| -rw-r--r-- | indoteknik_custom/models/stock_picking.py | 14 |
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() |
