mirror of
https://github.com/bringout/oca-storage.git
synced 2026-04-19 09:12:03 +02:00
Initial commit: OCA Storage packages (17 packages)
This commit is contained in:
commit
7a380f05d3
659 changed files with 41828 additions and 0 deletions
|
|
@ -0,0 +1 @@
|
|||
from . import main
|
||||
|
|
@ -0,0 +1,20 @@
|
|||
# Part of Odoo. See LICENSE file for full copyright and licensing details.
|
||||
|
||||
|
||||
from odoo import http
|
||||
from odoo.http import request
|
||||
|
||||
|
||||
class StorageFileController(http.Controller):
|
||||
@http.route(
|
||||
["/storage.file/<string:slug_name_with_id>"], type="http", auth="public"
|
||||
)
|
||||
def content_common(self, slug_name_with_id, token=None, download=None, **kw):
|
||||
storage_file = request.env["storage.file"].get_from_slug_name_with_id(
|
||||
slug_name_with_id
|
||||
)
|
||||
return (
|
||||
request.env["ir.binary"]
|
||||
._get_image_stream_from(storage_file, "data")
|
||||
.get_response()
|
||||
)
|
||||
Loading…
Add table
Add a link
Reference in a new issue