summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/stock_picking.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py
index cebd5fc1..c98b5f99 100644
--- a/indoteknik_custom/models/stock_picking.py
+++ b/indoteknik_custom/models/stock_picking.py
@@ -282,16 +282,22 @@ class StockPicking(models.Model):
return
def validation_minus_onhand_quantity(self):
- bu_location_id = 57
+ bu_location_id = 49
for line in self.move_line_ids_without_package:
quant = self.env['stock.quant'].search([
('product_id', '=', line.product_id.id),
('location_id', '=', bu_location_id),
])
- if self.sale_id and quant and quant.inventory_quantity < line.product_uom_qty:
+ if (
+ self.picking_type_id.id == 29
+ and quant
+ and line.location_id.id == bu_location_id
+ and quant.inventory_quantity < line.product_uom_qty
+ ):
raise UserError('Quantity reserved lebih besar dari quantity onhand di product')
+
def button_validate(self):
if self._name != 'stock.picking':
return super(StockPicking, self).button_validate()