diff options
| author | Miqdad <ahmadmiqdad27@gmail.com> | 2025-06-25 04:58:10 +0700 |
|---|---|---|
| committer | Miqdad <ahmadmiqdad27@gmail.com> | 2025-06-25 04:58:10 +0700 |
| commit | 8fc5488d18ac3005df9e8e259b2fbc0b67664841 (patch) | |
| tree | 2d7a5ea974a4a2da8f119b4a3d05205e7533f20a | |
| parent | 0b875d76478b861fbe6d0001aefb0fd6e39cf488 (diff) | |
<miqdad> additional changes
| -rw-r--r-- | indoteknik_custom/models/tukar_guling.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/indoteknik_custom/models/tukar_guling.py b/indoteknik_custom/models/tukar_guling.py index d75dad41..0c6e5eca 100644 --- a/indoteknik_custom/models/tukar_guling.py +++ b/indoteknik_custom/models/tukar_guling.py @@ -302,14 +302,15 @@ class TukarGuling(models.Model): related_pickings = self.env['stock.picking'].search([ ('origin', '=', record.origin), ('state', '=', 'done'), + ('picking_type_id', 'in', [29, 30]) ]) if not related_pickings: raise UserError( "Tidak ditemukan BU/PICK atau BU/OUT dari SO: %s" % record.origin) # filter based on stockin.picking picking type - bu_pick_to_return = related_pickings.filtered(lambda ktl: ktl.picking_type_id.id == 30) # BU/PICK - bu_out_to_return = related_pickings.filtered(lambda ktl: ktl.picking_type_id.id == 29) # BU/OUT + bu_pick_to_return = self.env['stock.picking'] or related_pickings.filtered(lambda ktl: ktl.picking_type_id.id == 30) # BU/PICK + bu_out_to_return = record.operations or related_pickings.filtered(lambda ktl: ktl.picking_type_id.id == 29) # BU/OUT if not bu_pick_to_return and not bu_out_to_return: raise UserError("Tidak ada BU/PICK atau BU/OUT yang selesai untuk diretur.") |
