1
This commit is contained in:
@@ -8,12 +8,17 @@ 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']
|
||||
|
||||
@@ -36,9 +36,9 @@ class YuThonPhone(http.Controller):
|
||||
employee_id = user_id.with_company(user_id.company_id.id).employee_id
|
||||
applet_security_setting_ids = request.env['applet.security'].search(
|
||||
[('employee_id', '=', employee_id.id)]).applet_security_setting_ids
|
||||
# access_list = [access.name for access in applet_security_setting_ids]
|
||||
access_list = ['OA', '抄表', '日程', '通知公告', '工作流', '薪资条', '考勤确认单', '物业账单', '报事报修',
|
||||
'用餐收集', '信息表收集', '财务表收集', '关于', '我的']
|
||||
access_list = [access.name for access in applet_security_setting_ids]
|
||||
# access_list = ['OA', '抄表', '日程', '通知公告', '工作流', '薪资条', '考勤确认单', '物业账单', '报事报修',
|
||||
# '用餐收集', '信息表收集', '财务表收集', '关于', '我的']
|
||||
company_list = []
|
||||
for company in user_id.company_ids:
|
||||
company_dict = {
|
||||
|
||||
@@ -37,7 +37,9 @@ class Home(http.Controller):
|
||||
def wechat_login_by_user_id(self, user_id=None, login=None, **kw):
|
||||
"""
|
||||
免登录接口:通过用户ID或登录名直接登录,绕过密码校验
|
||||
/wechat/login_by_user_id?user_id=2&redirect_url=/web#action=123
|
||||
/wechat/login_by_user_id?user_id=2&redirect_url=/web#action=3584
|
||||
/wechat/login_by_user_id?user_id=2&redirect_url=/web#action=3584
|
||||
https://oa.thtzjt.com/web#action=3584&cids=3-1-2-4&menu_id=9668
|
||||
参数:
|
||||
user_id: 用户ID (res.users的id)
|
||||
login: 用户登录名 (res.users的login字段)
|
||||
|
||||
Reference in New Issue
Block a user