diff options
| author | it-fixcomart <it@fixcomart.co.id> | 2025-05-27 10:19:09 +0700 |
|---|---|---|
| committer | it-fixcomart <it@fixcomart.co.id> | 2025-05-27 10:19:09 +0700 |
| commit | f0f414383b3bd34e6fce12e68e171014c08d2a55 (patch) | |
| tree | f9eef4c1331f6507fadc680bdd801656ff9f8ea7 /indoteknik_api/controllers/api_v1/stock_picking.py | |
| parent | 431229f2a6f1203fbdfe470229e55da8ebd3ea01 (diff) | |
| parent | d3f530b94569059106164172485aaa9665e80709 (diff) | |
Merge branch 'odoo-backup' into CR/repeat-order
Diffstat (limited to 'indoteknik_api/controllers/api_v1/stock_picking.py')
| -rw-r--r-- | indoteknik_api/controllers/api_v1/stock_picking.py | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/indoteknik_api/controllers/api_v1/stock_picking.py b/indoteknik_api/controllers/api_v1/stock_picking.py index 55e07152..31706b99 100644 --- a/indoteknik_api/controllers/api_v1/stock_picking.py +++ b/indoteknik_api/controllers/api_v1/stock_picking.py @@ -116,10 +116,10 @@ class StockPicking(controller.Controller): return self.response(picking.get_tracking_detail()) - @http.route(prefix + 'stock-picking/<picking_code>/documentation', auth='public', methods=['PUT', 'OPTIONS'], csrf=False) + @http.route(prefix + 'stock-picking/<scanid>/documentation', auth='public', methods=['PUT', 'OPTIONS'], csrf=False) @controller.Controller.must_authorized() def write_partner_stock_picking_documentation(self, **kw): - picking_code = int(kw.get('picking_code', 0)) + scanid = int(kw.get('scanid', 0)) sj_document = kw.get('sj_document', False) paket_document = kw.get('paket_document', False) @@ -128,7 +128,10 @@ class StockPicking(controller.Controller): 'driver_arrival_date': datetime.utcnow(), } - picking_data = request.env['stock.picking'].search([('picking_code', '=', picking_code)], limit=1) + picking_data = request.env['stock.picking'].search([('id', '=', scanid)], limit=1) + + if not picking_data: + picking_data = request.env['stock.picking'].search([('picking_code', '=', scanid)], limit=1) if not picking_data: return self.response(code=404, description='picking not found') |
