summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--indoteknik_custom/models/stock_picking_return.py15
1 files changed, 13 insertions, 2 deletions
diff --git a/indoteknik_custom/models/stock_picking_return.py b/indoteknik_custom/models/stock_picking_return.py
index 53a85f67..9cf017f9 100644
--- a/indoteknik_custom/models/stock_picking_return.py
+++ b/indoteknik_custom/models/stock_picking_return.py
@@ -120,8 +120,19 @@ class ReturnPicking(models.TransientModel):
'target': 'current',
'context': context,
}
- if picking.sale_id or 'SO' in (picking.origin or ''):
- _logger.info("This picking is NOT from a PO, fallback to SO.")
+ # if picking.sale_id or 'SO' in (picking.origin or ''):
+ # _logger.info("This picking is NOT from a PO, fallback to SO.")
+ # return {
+ # 'name': _('Tukar Guling SO'),
+ # 'type': 'ir.actions.act_window',
+ # 'res_model': 'tukar.guling',
+ # 'view_mode': 'form',
+ # 'target': 'current',
+ # 'context': context,
+ # }
+
+ if picking.name and any(k in picking.name.upper() for k in ('PICK', 'OUT')):
+ _logger.info("Redirect ke Tukar Guling SO via sale_id / origin")
return {
'name': _('Tukar Guling SO'),
'type': 'ir.actions.act_window',