mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
opt misc
This commit is contained in:
@@ -39,7 +39,7 @@
|
||||
'summary': '''
|
||||
AiSaas云服务,使用Ai通行证,一键实现全社交媒体统一登录SSO。
|
||||
支持微信、抖音、QQ、淘宝、钉钉、支付宝、企业微信、Facebook、Google、微软Azure等整合登录。
|
||||
在Odoo中获取最新的中文翻译(另行收费),获取当前Odoo模块最新版本更新等。
|
||||
在Odoo中获取最新的中文翻译(会员专属),获取当前Odoo模块最新版本更新等。
|
||||
支持Odoo中文版在线更新及 www.odooapp.cn 的信息推送等。
|
||||
安装即代表同意我司云服务用户协议及隐私政策。 https://www.odooapp.cn/conditions
|
||||
''',
|
||||
@@ -47,7 +47,7 @@
|
||||
1. Ai通行证实现全社交媒体登录支持
|
||||
2. 快速访问Odoo中文应用商店并获取独享Odoo中文通行码,可随时断开云服务连接
|
||||
3. 一键获取最新Odoo中文应用模块与主题,最新行业服务包
|
||||
4. 一键获取Odoo中文翻译更新(收费)
|
||||
4. 一键获取Odoo中文翻译更新(会员专属)
|
||||
5. 快速获取Odoo服务,Odoo升级评估
|
||||
6. 系统出错时一键提交,获取技术支持(会员专属)
|
||||
11.多语言支持,多公司支持
|
||||
|
||||
@@ -34,32 +34,42 @@ class ResUsers(models.Model):
|
||||
_inherit = 'res.users'
|
||||
|
||||
@api.model
|
||||
def auth_oauth(self, provider, params):
|
||||
def get_token_with_code(self, provider, params):
|
||||
# 通过 code 取 token
|
||||
# 这里原生是没处理code模式,此处将增加使用code取token,不在 controller 中处理
|
||||
oauth_provider = self.env['auth.oauth.provider'].sudo().browse(provider)
|
||||
|
||||
# odoo 特殊处理,用code取token
|
||||
params.update({
|
||||
'scope': oauth_provider.scope or '',
|
||||
'client_id': oauth_provider.client_id or '',
|
||||
})
|
||||
if hasattr(oauth_provider, 'client_secret') and oauth_provider.client_secret:
|
||||
params.update({
|
||||
'client_secret': oauth_provider.client_secret or '',
|
||||
})
|
||||
response = requests.get(oauth_provider.code_endpoint, params=params, timeout=30)
|
||||
if response.ok:
|
||||
ret = response.json()
|
||||
# todo: 客户机首次连接时,取到的 server 端 key 写入 provider 的 client_secret
|
||||
if ret.get('push_client_secret') and hasattr(oauth_provider, 'client_secret'):
|
||||
oauth_provider.write({'client_secret': ret.get('push_client_secret')})
|
||||
self._cr.commit()
|
||||
return ret
|
||||
return {}
|
||||
|
||||
@api.model
|
||||
def auth_oauth(self, provider, params):
|
||||
code = params.get('code', False)
|
||||
access_token = params.get('access_token')
|
||||
oauth_provider = self.env['auth.oauth.provider'].sudo().browse(provider)
|
||||
|
||||
# 额外code 处理
|
||||
kw = {}
|
||||
if oauth_provider.code_endpoint and code and not access_token:
|
||||
# odoo 特殊处理,用code取token
|
||||
params.update({
|
||||
'scope': oauth_provider.scope or '',
|
||||
'client_id': oauth_provider.client_id or '',
|
||||
})
|
||||
if hasattr(oauth_provider, 'client_secret') and oauth_provider.client_secret:
|
||||
params.update({
|
||||
'client_secret': oauth_provider.client_secret or '',
|
||||
})
|
||||
response = requests.get(oauth_provider.code_endpoint, params=params, timeout=30)
|
||||
if response.ok:
|
||||
ret = response.json()
|
||||
# todo: 客户机首次连接时,取到的 server 端 key 写入 provider 的 client_secret
|
||||
if ret.get('push_client_secret') and hasattr(oauth_provider, 'client_secret'):
|
||||
oauth_provider.write({'client_secret': ret.get('push_client_secret')})
|
||||
self._cr.commit()
|
||||
ret = self.get_token_with_code(provider, params)
|
||||
kw = {**ret, **params}
|
||||
kw.pop('code', False)
|
||||
|
||||
self = self.with_context(auth_extra=kw)
|
||||
res = super(ResUsers, self).auth_oauth(provider, kw)
|
||||
return res
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 58 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 241 KiB After Width: | Height: | Size: 457 KiB |
BIN
app_saas/static/description/banner2.png
Normal file
BIN
app_saas/static/description/banner2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 236 KiB |
BIN
app_saas/static/description/banner3.png
Normal file
BIN
app_saas/static/description/banner3.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 241 KiB |
@@ -17,12 +17,16 @@
|
||||
<!-- quick demo-->
|
||||
<section class="oe_container container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">1.启用后即可使用 odooapp.cn 提供的社媒整合登录</h2>
|
||||
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">1.启用后即可使用 odooapp.cn 提供的全网社交媒体整合登录</h2>
|
||||
<h4 class="oe_slogan">支持微信、抖音、QQ、淘宝、钉钉、支付宝、企业微信、Facebook、Google、微软Azure等整合登录。</h4>
|
||||
<p>未经用户明确同意,本应用不会获取任何用户系统数据.</p>
|
||||
<p class="">相关内容,请参考用户协议及我们的隐私政策:</p>
|
||||
<p> https://www.odooapp.cn/conditions</p>
|
||||
<p> https://www.odooapp.cn/privacy-policy</p>
|
||||
<div class="oe_demo oe_screenshot img img-fluid">
|
||||
<img src="banner1.png"/>
|
||||
</div>
|
||||
<p>用户可直接调用SSO一键登录</p>
|
||||
<div class="oe_demo oe_screenshot img img-fluid">
|
||||
<img src="demo1.jpg"/>
|
||||
</div>
|
||||
@@ -32,7 +36,7 @@
|
||||
<section class="oe_container container">
|
||||
<div class="oe_row oe_spaced">
|
||||
<h2 class="bg-warning text-center pt8 pb8 mt16 mb16">2. 快速访问Odoo中文应用商店并获取独享Odoo中文通行码,可随时断开云服务连接</h2>
|
||||
<h4 class="oe_slogan">启用云服务务后,即可获取最新功能推送,版本比对信息,提供版本升级建议</h4>
|
||||
<h4 class="oe_slogan">启用云服务后,即可获取最新功能推送,版本比对信息,提供版本升级建议</h4>
|
||||
<div class="oe_demo oe_screenshot img img-fluid">
|
||||
<img src="demo2.jpg"/>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user