Merge branch '16.0' of github.com:guohuadeng/app-odoo into 16.0

This commit is contained in:
Chill
2025-01-06 10:57:27 +08:00
9 changed files with 118 additions and 21 deletions

View File

@@ -39,7 +39,7 @@
{ {
'name': "odooAi Common Util and Tools,欧度智能基础功能及面板", 'name': "odooAi Common Util and Tools,欧度智能基础功能及面板",
'version': '16.25.01.03', 'version': '16.0.25.01.03',
'author': 'odooai.cn', 'author': 'odooai.cn',
'category': 'Extra tools', 'category': 'Extra tools',
'website': 'https://www.odooai.cn', 'website': 'https://www.odooai.cn',

View File

@@ -28,6 +28,11 @@ msgstr "=================被忽略的邮箱: %s"
msgid "Base" msgid "Base"
msgstr "基础" msgstr "基础"
#. module: app_common
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid "Checked and Save to Enable odoo China cloud service."
msgstr "勾选并保存即可启用Odoo中文应用商店云服务"
#. module: app_common #. module: app_common
#: model:ir.model.fields,help:app_common.field_res_config_settings__app_saas_ok #: model:ir.model.fields,help:app_common.field_res_config_settings__app_saas_ok
msgid "Checked to Enable www.odooapp.cn cloud service." msgid "Checked to Enable www.odooapp.cn cloud service."
@@ -43,6 +48,15 @@ msgstr "设置"
msgid "Contact" msgid "Contact"
msgstr "联系人" msgstr "联系人"
#. module: app_common
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid ""
"Easy Get Odoo Chinese App, Theme, and industry solution. You can get the SaaS client from\n"
" <br/>"
msgstr ""
"您可快速获取Odoo中文应用模块主题行业应用方案等。我们不会搜索您系统的敏感信息信息上传前都会征得您的同意。"
"SaaS云客户端在此免费下载<br/>"
#. module: app_common #. module: app_common
#. odoo-python #. odoo-python
#: code:addons/app_common/models/ir_mail_server.py:0 #: code:addons/app_common/models/ir_mail_server.py:0
@@ -52,9 +66,19 @@ msgstr "忽略的邮箱: %s"
#. module: app_common #. module: app_common
#: model:ir.model.fields,field_description:app_common.field_res_config_settings__app_saas_ok #: model:ir.model.fields,field_description:app_common.field_res_config_settings__app_saas_ok
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid "Enable CN SaaS" msgid "Enable CN SaaS"
msgstr "启用Odoo中文云服务" msgstr "启用Odoo中文云服务"
#. module: app_common
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid ""
"Get the Industry Apps, Themes and Support from China odooapp store.\n"
" https://www.odooapp.cn"
msgstr ""
"获取Odoo行业应用模块主题。请访问Odoo中国应用商店\n"
" https://www.odooapp.cn"
#. module: app_common #. module: app_common
#: model:ir.model,name:app_common.model_ir_http #: model:ir.model,name:app_common.model_ir_http
msgid "HTTP Routing" msgid "HTTP Routing"
@@ -90,6 +114,11 @@ msgstr "云通讯设置"
msgid "Scheduled Actions" msgid "Scheduled Actions"
msgstr "安排的动作" msgstr "安排的动作"
#. module: app_common
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid "Setup the communication to odooAi Cloud"
msgstr "设置云面板"
#. module: app_common #. module: app_common
#. odoo-python #. odoo-python
#: code:addons/app_common/wizard/mail_compose_message.py:0 #: code:addons/app_common/wizard/mail_compose_message.py:0
@@ -111,6 +140,11 @@ msgstr ""
"欢迎访问欧度智能官方网站获取Odoo企业级运营支持。\n" "欢迎访问欧度智能官方网站获取Odoo企业级运营支持。\n"
"\t\t\t\t\t\t\t\t\t\t\t\t\t https://www.odooai.cn" "\t\t\t\t\t\t\t\t\t\t\t\t\t https://www.odooai.cn"
#. module: app_common
#: model_terms:ir.ui.view,arch_db:app_common.app_res_config_settings_view_form
msgid "https://www.odooapp.cn/apps/modules/app_saas"
msgstr "https://www.odooapp.cn/apps/modules/app_saas"
#. module: app_common #. module: app_common
#. odoo-python #. odoo-python
#: code:addons/app_common/models/ir_ui_view.py:0 #: code:addons/app_common/models/ir_ui_view.py:0

View File

@@ -11,7 +11,8 @@ _logger = logging.getLogger(__name__)
class ResConfigSettings(models.TransientModel): class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
app_saas_ok = fields.Boolean('Enable CN SaaS', help="Checked to Enable www.odooapp.cn cloud service.", default=True, config_parameter='app_saas_ok') app_saas_ok = fields.Boolean('Enable CN SaaS', default=True, config_parameter='app_saas_ok',
help="Checked to Enable www.odooapp.cn cloud service.")
app_saas_common_token = fields.Char('SaaS Common Token', config_parameter='app_saas_common_token') app_saas_common_token = fields.Char('SaaS Common Token', config_parameter='app_saas_common_token')
def set_values(self): def set_values(self):

View File

@@ -6,10 +6,12 @@
<field name="model">res.config.settings</field> <field name="model">res.config.settings</field>
<field name="inherit_id" ref="base.res_config_settings_view_form"/> <field name="inherit_id" ref="base.res_config_settings_view_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<!-- 以下有些设置主要是为了兼容18-->
<xpath expr="//div[@data-key='general_settings']" position="before"> <xpath expr="//div[@data-key='general_settings']" position="before">
<div class="app_settings_block ml8" data-string="odoAi Cloud" string="odooAi Cloud" data-key="app_common" <div class="app_settings_block ml8" data-string="odoAi Cloud" string="odooAi Cloud" data-key="app_common"
logo="/app_common/static/description/odooai.png" groups="base.group_erp_manager"> logo="/app_common/static/description/odooai.png" groups="base.group_erp_manager">
<div class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25" name="app_settings_header"> <div id="app_slot1" class="o_hidden"></div>
<div id="app_odooai_banner" class="row app_settings_header my-0 ms-0 mw-100 bg-warning bg-opacity-25" name="app_settings_header">
<div class="col-lg-12 col-md-12 ms-0 o_setting_box"> <div class="col-lg-12 col-md-12 ms-0 o_setting_box">
<div class="o_setting_right_pane border-start-0 ms-0 ps-0"> <div class="o_setting_right_pane border-start-0 ms-0 ps-0">
<div class="content-group"> <div class="content-group">
@@ -24,15 +26,42 @@
</div> </div>
</div> </div>
</div> </div>
<h2>SaaS Settings</h2> <h2>Setup the communication to odooAi Cloud</h2>
<div class="col-xs-12 col-md-6 row o_settings_container" id="app_saas_settings" name="app_saas_settings"> <div class="row mt16 o_settings_container" name="odooai_cloud_block">
<div class="border-start-0"> <setting id="odooai_cloud_block_title" class="mt16 o_settings_container"
<div class="row mt0"> title="Setup the communication to odooAi Cloud" string="Setup the communication to odooAi Cloud">
<div name="app_odooapp_link">
<a href="https://www.odooapp.cn" target="_blank">Get the Industry Apps, Themes and Support from China odooapp store.
https://www.odooapp.cn
</a>
</div>
</setting>
<div class="col-lg-6 col-12 o_setting_box" id="odooai_cloud_saas_ok">
<div class="o_setting_left_pane">
<field name="app_saas_ok"/>
</div>
<div class="o_setting_right_pane">
<label for="app_saas_ok"/>
<div class="content-group">
<div>
<p class="text-warning">Checked and Save to Enable odoo China cloud service.</p>
<p class="ml4">
Easy Get Odoo Chinese App, Theme, and industry solution. You can get the SaaS client from
<br/>
<a href="https://www.odooapp.cn/apps/modules/app_saas" class="o_doc_link ml8"
target="_blank">https://www.odooapp.cn/apps/modules/app_saas
</a>
</p>
</div>
</div>
</div>
</div>
</div>
<div class="row mt16 o_settings_container" id="odooai_cloud_saas_common_token">
<label class="col-4" for="app_saas_common_token"/> <label class="col-4" for="app_saas_common_token"/>
<field name="app_saas_common_token" password="True"/> <field name="app_saas_common_token" password="True"/>
</div> </div>
</div> <div id="app_slot2" class="o_hidden"></div>
</div>
</div> </div>
</xpath> </xpath>
</field> </field>

View File

@@ -11,8 +11,8 @@
<label class="h2 bg-warning text-white" for="app_system_name"/> <label class="h2 bg-warning text-white" for="app_system_name"/>
<field name="app_system_name"/> <field name="app_system_name"/>
</xpath> </xpath>
<xpath expr="//div[@name='app_saas_settings']" position="after"> <xpath expr="//div[@id='app_slot2']" position="before">
<h2>Security and Boost</h2> <h2 name="app_security_boost_begin">Security and Boost</h2>
<div class="row mt16 o_settings_container" name="app_security_boost"> <div class="row mt16 o_settings_container" name="app_security_boost">
<group> <group>
<group> <group>
@@ -117,7 +117,6 @@
</div> </div>
</group> </group>
</div> </div>
<h2 name="data-clean" class="o_horizontal_separator">Data Cleaning (Be careful to do that!)</h2> <h2 name="data-clean" class="o_horizontal_separator">Data Cleaning (Be careful to do that!)</h2>
<div class="mt16 o_settings_container" name="data-clean"> <div class="mt16 o_settings_container" name="data-clean">
<div class="col-12 col-lg-12 mb4"> <div class="col-12 col-lg-12 mb4">

View File

@@ -12,3 +12,5 @@ class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings' _inherit = 'res.config.settings'
module_app_cn_po = fields.Boolean('SaaS Chinese PO', help="Checked to Sync Odoo Chinese from www.odooapp.cn") module_app_cn_po = fields.Boolean('SaaS Chinese PO', help="Checked to Sync Odoo Chinese from www.odooapp.cn")
app_saas_db_token = fields.Boolean('Ai Cloud Token', default=True, config_parameter='app_saas_db_token',
help="The odooapp SaaS Token for this Odoo Database. You can reset in https://www.odooapp.cn")

View File

@@ -95,6 +95,37 @@ class ResUsers(models.Model):
res = super(ResUsers, self)._auth_oauth_signin(provider, validation, params) res = super(ResUsers, self)._auth_oauth_signin(provider, validation, params)
return res return res
def _create_user_from_template(self, values):
# todo: 注意,选模板用户的功能暂时不可开放,因为会与 social_login 不兼容
# 注意,没有装 app_partner_user时删除 user 时不会删除 partner故容易出错测试时要手工再把partner删除
# self = self.sudo()
# oauth_provider_id = values.get('oauth_provider_id')
# if oauth_provider_id:
# provider = request.env['auth.oauth.provider'].sudo().browse(int(oauth_provider_id))
# if provider:
# template_user = provider.user_template_id
# if not template_user and provider.scope.find('odoo') >= 0:
# template_user = self.env.ref('base.default_user', False)
# if not template_user:
# template_user_id = literal_eval(self.env['ir.config_parameter'].sudo().get_param('base.template_portal_user_id', 'False'))
# template_user = self.browse(template_user_id)
#
# if not values.get('login'):
# raise ValueError(_('Signup: no login given for new user'))
# if not values.get('partner_id') and not values.get('name'):
# raise ValueError(_('Signup: no name or partner given for new user'))
#
# # create a copy of the template user (attached to a specific partner_id if given)
# values['active'] = True
# try:
# with self.env.cr.savepoint():
# return template_user.sudo().with_context(no_reset_password=True).copy(values)
# except Exception as e:
# # copy may failed if asked login is not available.
# raise SignupError(str(e))
res = super(ResUsers, self)._create_user_from_template(values)
return res
@api.model @api.model
def _generate_signup_values(self, provider, validation, params): def _generate_signup_values(self, provider, validation, params):
# 此处生成 创建 odoo user 的初始值,增加字段如头像 # 此处生成 创建 odoo user 的初始值,增加字段如头像

View File

@@ -39,7 +39,7 @@
{ {
'name': "Website Blogs,Page Editor in source code. mass edit blog and page.Odoo网页与博文源码编辑器", 'name': "Website Blogs,Page Editor in source code. mass edit blog and page.Odoo网页与博文源码编辑器",
'version': '16.24.08.04', 'version': '16.0.25.01.05',
'author': 'odooai.cn', 'author': 'odooai.cn',
'category': 'Website', 'category': 'Website',
'website': 'https://www.odooai.cn', 'website': 'https://www.odooai.cn',

View File

@@ -26,9 +26,10 @@
<xpath expr="//field[@name='is_seo_optimized']" position="attributes"> <xpath expr="//field[@name='is_seo_optimized']" position="attributes">
<attribute name="optional">show</attribute> <attribute name="optional">show</attribute>
</xpath> </xpath>
<xpath expr="//field[@name='website_id'][2]" position="attributes"> <!-- 修正,当没开启多站点时,这里会报错-->
<attribute name="optional">show</attribute> <!-- <xpath expr="//field[@name='website_id'][2]" position="attributes">-->
</xpath> <!-- <attribute name="optional">show</attribute>-->
<!-- </xpath>-->
<xpath expr="//field[@name='is_published']" position="before"> <xpath expr="//field[@name='is_published']" position="before">
<field name="is_force_all" widget="boolean_toggle" optional="show"/> <field name="is_force_all" widget="boolean_toggle" optional="show"/>
</xpath> </xpath>