mirror of
https://github.com/guohuadeng/app-odoo.git
synced 2025-02-23 04:11:36 +02:00
update chatgpt add 对话 and 更新许可
This commit is contained in:
@@ -31,7 +31,7 @@
|
|||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
'live_test_url': 'https://demo.odooapp.cn',
|
'live_test_url': 'https://demo.odooapp.cn',
|
||||||
'license': 'OPL-1',
|
'license': 'LGPL-3',
|
||||||
'sequence': 2,
|
'sequence': 2,
|
||||||
'price': 0.00,
|
'price': 0.00,
|
||||||
'currency': 'EUR',
|
'currency': 'EUR',
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心,聚合全网Ai',
|
'name': 'ChatGPT4, China Ali,AiGC Center.Ai服务中心,聚合全网Ai',
|
||||||
'version': '16.24.07.29',
|
'version': '16.0.25.02.07',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'company': 'odooai.cn',
|
'company': 'odooai.cn',
|
||||||
'maintainer': 'odooai.cn',
|
'maintainer': 'odooai.cn',
|
||||||
@@ -48,11 +48,8 @@
|
|||||||
pip3 install typing-extensions==4.12.2
|
pip3 install typing-extensions==4.12.2
|
||||||
''',
|
''',
|
||||||
'depends': [
|
'depends': [
|
||||||
'base',
|
|
||||||
'app_odoo_customize',
|
'app_odoo_customize',
|
||||||
'base_setup',
|
|
||||||
'mail',
|
'mail',
|
||||||
'queue_job',
|
|
||||||
],
|
],
|
||||||
'data': [
|
'data': [
|
||||||
'security/ir.model.access.csv',
|
'security/ir.model.access.csv',
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<odoo>
|
<odoo>
|
||||||
<data noupdate="1">
|
<data noupdate="1">
|
||||||
<record model="mail.channel" id="channel_chatgpt">
|
<record id="channel_chatgpt" model="mail.channel">
|
||||||
<field name="name">ChatGPT Group Chat</field>
|
<field name="name">ChatGPT Group Chat</field>
|
||||||
<field name="description">ChatGPT话题</field>
|
<field name="description">ChatGPT话题</field>
|
||||||
<field name="image_128" type="base64" file="app_chatgpt/static/description/chatgpt.png"/>
|
<field name="image_128" type="base64" file="app_chatgpt/static/description/chatgpt.png"/>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
<record model="mail.message" id="module_install_notification">
|
<record id="module_install_notification" model="mail.message">
|
||||||
<field name="model">mail.channel</field>
|
<field name="model">mail.channel</field>
|
||||||
<field name="res_id" ref="app_chatgpt.channel_chatgpt"/>
|
<field name="res_id" ref="app_chatgpt.channel_chatgpt"/>
|
||||||
<field name="message_type">email</field>
|
<field name="message_type">email</field>
|
||||||
@@ -17,6 +17,13 @@
|
|||||||
<p>Please ask me any question.</p>]]></field>
|
<p>Please ask me any question.</p>]]></field>
|
||||||
</record>
|
</record>
|
||||||
|
|
||||||
|
<record id="channel_chatgpt" model="mail.channel">
|
||||||
|
<field name="name">Ai Conversation Group</field>
|
||||||
|
<field name="description">Ai互怼/辩论/二人转</field>
|
||||||
|
<field name="image_128" type="base64" file="app_chatgpt/static/img/icon_odooai.png"/>
|
||||||
|
<field name="image_128" type="base64" file="app_chatgpt/static/img/icon_odooai.png"/>
|
||||||
|
</record>
|
||||||
|
|
||||||
<!-- <record model="mail.channel.member" id="channel_member_chatgtp_channel_for_admin">-->
|
<!-- <record model="mail.channel.member" id="channel_member_chatgtp_channel_for_admin">-->
|
||||||
<!-- <field name="partner_id" ref="base.partner_admin"/>-->
|
<!-- <field name="partner_id" ref="base.partner_admin"/>-->
|
||||||
<!-- <field name="channel_id" ref="app_chatgpt.channel_chatgpt"/>-->
|
<!-- <field name="channel_id" ref="app_chatgpt.channel_chatgpt"/>-->
|
||||||
@@ -24,7 +31,7 @@
|
|||||||
<!-- <field name="seen_message_id" ref="app_chatgpt.module_install_notification"/>-->
|
<!-- <field name="seen_message_id" ref="app_chatgpt.module_install_notification"/>-->
|
||||||
<!-- </record>-->
|
<!-- </record>-->
|
||||||
|
|
||||||
<record model="mail.channel" id="app_chatgpt.channel_chatgpt">
|
<record id="app_chatgpt.channel_chatgpt" model="mail.channel">
|
||||||
<field name="group_ids" eval="[Command.link(ref('base.group_user'))]"/>
|
<field name="group_ids" eval="[Command.link(ref('base.group_user'))]"/>
|
||||||
</record>
|
</record>
|
||||||
</data>
|
</data>
|
||||||
|
|||||||
@@ -81,6 +81,17 @@ class Channel(models.Model):
|
|||||||
|
|
||||||
is_current_channel = fields.Boolean('是否当前用户默认频道', compute='_compute_is_current_channel', help='是否当前用户默认微信对话频道')
|
is_current_channel = fields.Boolean('是否当前用户默认频道', compute='_compute_is_current_channel', help='是否当前用户默认微信对话频道')
|
||||||
|
|
||||||
|
# begin 处理Ai对话
|
||||||
|
is_ai_conversation = fields.Boolean('Ai Conversation', default=False,
|
||||||
|
help='Set active to make conversation between 2+ Ai Employee. You Just say first word, then Ai robots Auto Chat.')
|
||||||
|
# 主Ai角色设定
|
||||||
|
ai_sys_content = fields.Char('Main Robot Role', change_default=True,
|
||||||
|
help='The Role the First Ai robot play for. This is for Ai Conversation.')
|
||||||
|
# 辅助Ai角色设定
|
||||||
|
ext_ai_sys_content = fields.Char('Extend Robot Role', change_default=True,
|
||||||
|
help='The Role the Second Ai robot play for. This is for Ai Conversation.')
|
||||||
|
# end 处理Ai对话
|
||||||
|
|
||||||
def name_get(self):
|
def name_get(self):
|
||||||
result = []
|
result = []
|
||||||
for c in self:
|
for c in self:
|
||||||
@@ -318,7 +329,10 @@ class Channel(models.Model):
|
|||||||
if sync_config == 'sync':
|
if sync_config == 'sync':
|
||||||
self.get_ai_response(ai, messages, channel, user_id, message)
|
self.get_ai_response(ai, messages, channel, user_id, message)
|
||||||
else:
|
else:
|
||||||
|
if hasattr(self, 'with_delay'):
|
||||||
self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
|
self.with_delay().get_ai_response(ai, messages, channel, user_id, message)
|
||||||
|
else:
|
||||||
|
self.get_ai_response(ai, messages, channel, user_id, message)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
raise UserError(_(e))
|
raise UserError(_(e))
|
||||||
|
|
||||||
@@ -358,3 +372,10 @@ class Channel(models.Model):
|
|||||||
def _onchange_ai_partner_id(self):
|
def _onchange_ai_partner_id(self):
|
||||||
if self.ai_partner_id and self.ai_partner_id.image_1920:
|
if self.ai_partner_id and self.ai_partner_id.image_1920:
|
||||||
self.image_128 = self.ai_partner_id.avatar_128
|
self.image_128 = self.ai_partner_id.avatar_128
|
||||||
|
if self.ai_partner_id and not self.ai_sys_content:
|
||||||
|
self.ai_sys_content = self.ai_partner_id.sys_content
|
||||||
|
|
||||||
|
@api.onchange('ext_ai_partner_id')
|
||||||
|
def _onchange_ext_ai_partner_id(self):
|
||||||
|
if self.ext_ai_partner_id and not self.ext_ai_sys_content:
|
||||||
|
self.ext_ai_sys_content = self.ext_ai_partner_id.sys_content
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 89 KiB After Width: | Height: | Size: 72 KiB |
BIN
app_chatgpt/static/img/icon_odooai.png
Normal file
BIN
app_chatgpt/static/img/icon_odooai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 12 KiB |
BIN
app_chatgpt/static/img/icon_odooapp.png
Normal file
BIN
app_chatgpt/static/img/icon_odooapp.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 32 KiB |
BIN
app_chatgpt/static/img/logo_odooai.png
Normal file
BIN
app_chatgpt/static/img/logo_odooai.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.6 KiB |
@@ -27,10 +27,13 @@
|
|||||||
<group>
|
<group>
|
||||||
<group name="role_set" string="Ai Parameter">
|
<group name="role_set" string="Ai Parameter">
|
||||||
<field name="channel_type" readonly="1"/>
|
<field name="channel_type" readonly="1"/>
|
||||||
<field name="ai_partner_id"
|
<field name="ai_partner_id" widget="many2one_avatar"
|
||||||
options="{'no_open': True, 'no_create': True}"/>
|
options="{'no_open': True, 'no_create': True}"/>
|
||||||
<field name="ext_ai_partner_id"
|
<field name="ext_ai_partner_id" widget="many2one_avatar"
|
||||||
options="{'no_open': True, 'no_create': True}"/>
|
options="{'no_open': True, 'no_create': True}"/>
|
||||||
|
<field name="is_ai_conversation" widget="boolean_toggle" groups="base.group_no_one"/>
|
||||||
|
<field name="ai_sys_content" attrs="{'invisible':[('is_ai_conversation','!=',True)]}" groups="base.group_no_one"/>
|
||||||
|
<field name="ext_ai_sys_content" attrs="{'invisible':[('is_ai_conversation','!=',True)]}" groups="base.group_no_one"/>
|
||||||
</group>
|
</group>
|
||||||
<group name="param_set" string="Ai Character Set">
|
<group name="param_set" string="Ai Character Set">
|
||||||
<div class="o_td_label">
|
<div class="o_td_label">
|
||||||
@@ -88,11 +91,19 @@
|
|||||||
<field name="arch" type="xml">
|
<field name="arch" type="xml">
|
||||||
<xpath expr="//kanban//field[1]" position="before">
|
<xpath expr="//kanban//field[1]" position="before">
|
||||||
<field name="is_private"/>
|
<field name="is_private"/>
|
||||||
|
<field name="ai_partner_id"/>
|
||||||
|
<field name="ext_ai_partner_id"/>
|
||||||
|
<field name="is_ai_conversation"/>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//field[@name='description']" position="before">
|
<xpath expr="//field[@name='description']" position="before">
|
||||||
<em>角色:</em>
|
<em>角色:</em>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//button[@name='channel_join']" position="replace">
|
<xpath expr="//button[@name='channel_join']" position="replace">
|
||||||
|
<div class="row">
|
||||||
|
<field name="ai_partner_id" widget="many2one_avatar" class="ml4 mr8"
|
||||||
|
options="{'no_open': True, 'no_create': True}"/>
|
||||||
|
<field name="is_ai_conversation" widget="boolean_toggle"/>
|
||||||
|
</div>
|
||||||
<button attrs="{'invisible':[('is_private','=',True), ('group_ids', '!=', [])]}"
|
<button attrs="{'invisible':[('is_private','=',True), ('group_ids', '!=', [])]}"
|
||||||
class="btn btn-warning float-end" type="edit">
|
class="btn btn-warning float-end" type="edit">
|
||||||
智能设定
|
智能设定
|
||||||
|
|||||||
@@ -20,14 +20,14 @@
|
|||||||
</button>
|
</button>
|
||||||
</xpath>
|
</xpath>
|
||||||
<xpath expr="//page[@name='preferences']" position="after">
|
<xpath expr="//page[@name='preferences']" position="after">
|
||||||
<page name="page_chatgpt" string="ChatGPT">
|
<page name="page_chatgpt" string="Ai Robot Setting">
|
||||||
<group>
|
<group>
|
||||||
<group>
|
<group>
|
||||||
<field name="gpt_id"/>
|
<field name="gpt_id"/>
|
||||||
<field name="gpt_policy"/>
|
<field name="gpt_policy"/>
|
||||||
<field name="gpt_wl_partners" widget="many2many_tags" attrs="{'invisible': [('gpt_policy', '=', 'all')]}"/>
|
<field name="gpt_wl_partners" widget="many2many_tags" attrs="{'invisible': [('gpt_policy', '=', 'all')]}"/>
|
||||||
<field name="gpt_demo_time"/>
|
<field name="gpt_demo_time"/>
|
||||||
<field name="is_chat_private"/>
|
<field name="is_chat_private" widget="boolean_toggle"/>
|
||||||
</group>
|
</group>
|
||||||
</group>
|
</group>
|
||||||
</page>
|
</page>
|
||||||
|
|||||||
@@ -26,12 +26,12 @@
|
|||||||
|
|
||||||
{
|
{
|
||||||
'name': 'odooapp.cn SaaS Client-Ai Passport.Odoo中文应用商店SaaS云服务客户端',
|
'name': 'odooapp.cn SaaS Client-Ai Passport.Odoo中文应用商店SaaS云服务客户端',
|
||||||
'version': '16.0.25.01.26',
|
'version': '16.0.25.02.07',
|
||||||
'author': 'odooai.cn',
|
'author': 'odooai.cn',
|
||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
'live_test_url': 'https://demo.odooapp.cn',
|
'live_test_url': 'https://demo.odooapp.cn',
|
||||||
'license': 'OPL-1',
|
'license': 'LGPL-3',
|
||||||
'sequence': 2,
|
'sequence': 2,
|
||||||
'price': 0.00,
|
'price': 0.00,
|
||||||
'currency': 'EUR',
|
'currency': 'EUR',
|
||||||
|
|||||||
@@ -12,5 +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.Char('Cloud DB Token', default=True, config_parameter='app_saas_db_token',
|
app_saas_db_token = fields.Char('Cloud DB Token', default=None, config_parameter='app_saas_db_token',
|
||||||
help="The odooapp SaaS Token for this Odoo Database. You can reset in https://www.odooapp.cn")
|
help="The odooapp SaaS Token for this Odoo Database. You can reset in https://www.odooapp.cn")
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
'category': 'Base',
|
'category': 'Base',
|
||||||
'website': 'https://www.odooai.cn',
|
'website': 'https://www.odooai.cn',
|
||||||
'live_test_url': 'https://demo.odooapp.cn',
|
'live_test_url': 'https://demo.odooapp.cn',
|
||||||
'license': 'OPL-1',
|
'license': 'LGPL-3',
|
||||||
'sequence': 2,
|
'sequence': 2,
|
||||||
'price': 2.00,
|
'price': 2.00,
|
||||||
'currency': 'EUR',
|
'currency': 'EUR',
|
||||||
|
|||||||
Reference in New Issue
Block a user