Skip to content

Commit

Permalink
[IMP] sign_oca: Remove warning by using the proper function
Browse files Browse the repository at this point in the history
  • Loading branch information
etobella committed Aug 25, 2024
1 parent 863a2ac commit 1908a2f
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions sign_oca/controllers/main.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
import base64
import io

from odoo import http
from odoo.exceptions import AccessError, MissingError
from odoo.http import request
Expand Down Expand Up @@ -70,8 +67,9 @@ def get_sign_oca_content_access(self, signer_id, access_token):
)
except (AccessError, MissingError):
return request.redirect("/my")
data = io.BytesIO(base64.standard_b64decode(signer_sudo.request_id.data))
return http.send_file(data, filename=signer_sudo.request_id.name)
return http.Stream.from_binary_field(
signer_sudo.request_id, "data"
).get_response(mimetype="application/pdf")

@http.route(
["/sign_oca/info/<int:signer_id>/<string:access_token>"],
Expand Down

0 comments on commit 1908a2f

Please sign in to comment.