From 4cec68ef40a33071d949c33c1592c146779f1abe Mon Sep 17 00:00:00 2001 From: stephanchrst Date: Mon, 16 Jan 2023 11:43:41 +0700 Subject: add delivered validation system parameter and add sequence for new product template scheduler --- indoteknik_custom/models/stock_picking.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'indoteknik_custom/models/stock_picking.py') diff --git a/indoteknik_custom/models/stock_picking.py b/indoteknik_custom/models/stock_picking.py index 84a374c5..d19214d2 100644 --- a/indoteknik_custom/models/stock_picking.py +++ b/indoteknik_custom/models/stock_picking.py @@ -145,8 +145,10 @@ class StockPicking(models.Model): continue raise UserError('Sudah pernah dikirim kalender') + is_delivered_validation = self.env['ir.config_parameter'].get_param( + 'stock_picking.qty_delivered_validation') for line in self.move_line_ids_without_package: - if line.move_id.sale_line_id and self.picking_type_id.code == 'outgoing': + if line.move_id.sale_line_id and self.picking_type_id.code == 'outgoing' and is_delivered_validation == 'Y': if line.move_id.sale_line_id.qty_delivered + line.qty_done > line.move_id.sale_line_id.product_uom_qty: raise UserError("Qty Delivered akan lebih dari Qty SO") -- cgit v1.2.3