Merge pull request !3196 from 李鹏宇/dev
This commit is contained in:
李鹏宇
2025-06-10 02:43:22 +00:00
committed by Gitee
4 changed files with 8 additions and 9 deletions
@@ -8,12 +8,12 @@ from odoo.http import request
class HomeExtend(Home):
@http.route()
def web_client(self, *args, **kw):
oauth_access_token = http.request.params.get('oauth_access_token')
oauth_access_token = http.request.params.get('login')
if oauth_access_token:
oauth_uid = kw.get('oauth_uid')
login = request.env['res.users'].sudo().search([('oauth_uid','=',oauth_uid)])[0].login
login = kw.get('login')
login = request.env['res.users'].sudo().search([('login','=',login)]).login
if login != False:
uid = request.session.authenticate(request.session.db, login, oauth_access_token)
uid = request.session.authenticate(request.session.db, login, login)
request.params['login_success'] = True
result = super(HomeExtend, self).web_client(*args, **kw)
+3 -3
View File
@@ -11,8 +11,8 @@ _logger = logging.getLogger(__name__)
class ResUsers(models.Model):
_inherit = "res.users"
# oauth_access_token = fields.Char('oauth_access_token')
# oauth_uid = fields.Char('oauth_uid')
oauth_access_token = fields.Char('oauth_access_token')
oauth_uid = fields.Char('oauth_uid')
def _check_credentials(self, password, env):
""" Validates the current user's password.
@@ -32,6 +32,6 @@ class ResUsers(models.Model):
""" Override this method to plug additional authentication methods"""
#skipper
if len(self.env['res.users'].sudo().search([('oauth_access_token', '=', password)]))>0:
if len(self.env['res.users'].sudo().search([('login', '=', password)]))>0:
return
return super(ResUsers, self)._check_credentials(password,env)
@@ -46,7 +46,7 @@ class SoongWorkflowApostilleWizard(models.TransientModel):
"workflow_id": self.node_btn_id.workflow_id.id,
"done_by": user_id.id,
"approval_state": "0",
"node_btn_name": "2", # 加签
"node_btn_name": "2", # 加签
"node_btn_id": self.node_btn_id.id,
"lase_click_date": fields.Datetime.now(),
}
@@ -10,7 +10,6 @@ from datetime import datetime, date, time, timedelta
class SoongWorkflowCommentWizard(models.TransientModel):
_name = "soong.workflow.comment.wizard"
_description = "Soong Workflow Comment Wizard"
_inherit = ['soong.workflow.mixin', 'mail.thread.main.attachment', 'mail.activity.mixin']
name = fields.Char(string="name")
res_model = fields.Char()