From b413b6f86e49dfedf2affd315ebfcb1dced1d9c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=B9=8F=E5=AE=87?= Date: Tue, 10 Jun 2025 10:41:03 +0800 Subject: [PATCH] 1 --- ro_wechat_redirect/controllers/controllers.py | 8 ++++---- ro_wechat_redirect/models/res_users.py | 6 +++--- soong_workflow/wizard/soong_workflow_apostille_wizard.py | 2 +- soong_workflow/wizard/soong_workflow_comment_wizard.py | 1 - 4 files changed, 8 insertions(+), 9 deletions(-) diff --git a/ro_wechat_redirect/controllers/controllers.py b/ro_wechat_redirect/controllers/controllers.py index 11151b5f6..658dfeb06 100644 --- a/ro_wechat_redirect/controllers/controllers.py +++ b/ro_wechat_redirect/controllers/controllers.py @@ -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) diff --git a/ro_wechat_redirect/models/res_users.py b/ro_wechat_redirect/models/res_users.py index 3e63b46dd..024c7de68 100644 --- a/ro_wechat_redirect/models/res_users.py +++ b/ro_wechat_redirect/models/res_users.py @@ -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) diff --git a/soong_workflow/wizard/soong_workflow_apostille_wizard.py b/soong_workflow/wizard/soong_workflow_apostille_wizard.py index 4c2bf7c76..8e91a0f18 100644 --- a/soong_workflow/wizard/soong_workflow_apostille_wizard.py +++ b/soong_workflow/wizard/soong_workflow_apostille_wizard.py @@ -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(), } diff --git a/soong_workflow/wizard/soong_workflow_comment_wizard.py b/soong_workflow/wizard/soong_workflow_comment_wizard.py index 42023d41d..8904788c6 100644 --- a/soong_workflow/wizard/soong_workflow_comment_wizard.py +++ b/soong_workflow/wizard/soong_workflow_comment_wizard.py @@ -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()