1
This commit is contained in:
@@ -8,17 +8,12 @@ from odoo import http
|
||||
from odoo.http import request, content_disposition
|
||||
from jinja2 import Environment, PackageLoader
|
||||
import mammoth
|
||||
from odoo.exceptions import UserError
|
||||
|
||||
|
||||
class preview(http.Controller):
|
||||
@http.route('/web/content/preview/<int:id>', type='http', method=['Get'], auth="public")
|
||||
def content_preview(self, id=None):
|
||||
ir_attach = request.env['ir.attachment'].sudo()
|
||||
|
||||
# attach = request.env['ir.attachment'].sudo().browse(id)
|
||||
# if attach.datas:
|
||||
# raise UserError('附件内容为空,无法预览')
|
||||
|
||||
attach = ir_attach.browse(id)
|
||||
image = ['image/jpeg', 'image/png', 'image/bmp', 'image/gif', 'image/jpg', 'image/svg']
|
||||
html = ['text/html']
|
||||
|
||||
Reference in New Issue
Block a user