diff options
| author | Mqdd <ahmadmiqdad27@gmail.com> | 2025-11-21 13:46:33 +0700 |
|---|---|---|
| committer | Mqdd <ahmadmiqdad27@gmail.com> | 2025-11-21 13:46:33 +0700 |
| commit | cd165c35d8e984e9f38e76f52b95b223eab26784 (patch) | |
| tree | 9faf638239f5c5a12eb18c197503a515a701b867 | |
| parent | add0d418ab92e52197747f046d6d62e372ec4f97 (diff) | |
<Miqdad> allow return from srt or ort
| -rw-r--r-- | indoteknik_custom/models/stock_picking_return.py | 15 |
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', |
