优化工单模块,增加企微模块

This commit is contained in:
mgw
2024-07-10 15:58:47 +08:00
parent e8512b23e4
commit 6b140fe6dd
134 changed files with 12830 additions and 2 deletions

View File

@@ -0,0 +1,26 @@
# -*- coding: utf-8 -*-
import random
from odoo import models, fields, api
from odoo.http import request
from odoo.exceptions import AccessDenied
import logging
_logger = logging.getLogger(__name__)
class ResUsers(models.Model):
_inherit = 'res.users'
we_employee_id = fields.Char(string=u'企业微信账号', default="")
def _check_credentials(self, we_employee_id, env):
"""
用户验证
"""
try:
return super(ResUsers, self)._check_credentials(we_employee_id, env)
except AccessDenied:
user_id = self.env['res.users'].sudo().search([('we_employee_id', '=', we_employee_id)])
if not (user_id and user_id.id == self.env.uid):
raise