From 21738b9d99acac49a041ab0c2a7dd99c94e3ed12 Mon Sep 17 00:00:00 2001 From: Miqdad Date: Thu, 30 Oct 2025 15:43:06 +0700 Subject: fix gk bisa edit tanggal kirim sj --- indoteknik_custom/models/stock_move.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/indoteknik_custom/models/stock_move.py b/indoteknik_custom/models/stock_move.py index 8f8ba66f..43c4676e 100644 --- a/indoteknik_custom/models/stock_move.py +++ b/indoteknik_custom/models/stock_move.py @@ -219,12 +219,14 @@ class StockMoveLine(models.Model): if done_qty == 0: line.delivery_status = 'none' elif done_qty > 0: - has_other_out = self.env['stock.picking'].search_count([ - ('group_id', '=', picking.group_id.id), - ('name', 'ilike', 'BU/OUT'), - ('id', '!=', picking.id), - ('state', '=', 'done'), - ]) + has_other_out = 0 + if picking.group_id and isinstance(picking.id, int): + has_other_out = self.env['stock.picking'].search_count([ + ('group_id', '=', picking.group_id.id), + ('name', 'ilike', 'BU/OUT'), + ('id', '!=', picking.id), + ('state', '=', 'done'), + ]) if has_other_out and done_qty == total_qty: line.delivery_status = 'partial_final' elif not has_other_out and done_qty >= total_qty: @@ -236,7 +238,6 @@ class StockMoveLine(models.Model): else: line.delivery_status = 'none' - # Ambil uom dari stock move @api.model def create(self, vals): -- cgit v1.2.3