# -*- coding: utf-8 -*- # Copyright 2026 Nexa Systems Inc. """Box scan endpoint. The per-box QR on the External Job Sticker encodes ``/fp/box/``; scanning it (logged-in operator on the tablet) lands on the box's backend form where they can advance its status.""" from odoo import http from odoo.http import request class FpBoxScan(http.Controller): @http.route(['/fp/box/'], type='http', auth='user', website=False) def fp_box_scan(self, box_id, **kw): box = request.env['fp.box'].sudo().browse(box_id).exists() if not box: return request.not_found() # Land on the box form in the web client (operator advances status there). return request.redirect('/web#id=%s&model=fp.box&view_type=form' % box.id)