修改接口授权后,没有赋予用户的bug,导致无法获取公司,增加替换sf销售订单行产品名称的模块

This commit is contained in:
胡尧
2025-06-13 17:53:57 +08:00
parent 0ef6fe73f3
commit f53e34aeb4
6 changed files with 62 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
import logging
from datetime import datetime, timedelta
import hashlib
from odoo import models
from odoo import models, SUPERUSER_ID
from odoo.http import request
__author__ = 'jinling.yang'
@@ -48,5 +48,7 @@ class Http(models.AbstractModel):
_logger.info('sf_secret_key:%s' % factory_secret.sf_secret_key)
if check_sf_str != datas['HTTP_CHECKSTR']:
raise AuthenticationError('数据校验不通过')
# 设置管理员用户
request.update_env(user=SUPERUSER_ID)
else:
raise AuthenticationError('请求参数中无token')