diff --git a/odoo_chatgpt_connector/__manifest__.py b/odoo_chatgpt_connector/__manifest__.py index 264bbd9b9..2f265082f 100644 --- a/odoo_chatgpt_connector/__manifest__.py +++ b/odoo_chatgpt_connector/__manifest__.py @@ -41,6 +41,9 @@ 'odoo_chatgpt_connector/static/src/js/submit_request.js', 'odoo_chatgpt_connector/static/src/css/container.css' ], + 'web.assets_backend': [ + 'odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/**/*' + ], }, 'images': ['static/description/banner.jpg'], 'license': 'AGPL-3', diff --git a/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot10.png b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot10.png new file mode 100644 index 000000000..25953f3dd Binary files /dev/null and b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot10.png differ diff --git a/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot11.png b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot11.png new file mode 100644 index 000000000..9c0718d07 Binary files /dev/null and b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot11.png differ diff --git a/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot8.png b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot8.png new file mode 100644 index 000000000..27448d711 Binary files /dev/null and b/odoo_chatgpt_connector/static/description/assets/screenshots/screenshot8.png differ diff --git a/odoo_chatgpt_connector/static/description/index.html b/odoo_chatgpt_connector/static/description/index.html index ae576829e..e451cf470 100644 --- a/odoo_chatgpt_connector/static/description/index.html +++ b/odoo_chatgpt_connector/static/description/index.html @@ -261,7 +261,6 @@

-

@@ -286,6 +285,25 @@

+
+
+
+ +
+
+ ChatGPT in Odoo chatter. +
+

+

+
+
@@ -623,6 +641,64 @@ +
+
+
+
+

+ Add contents from chatGPT to + + + odoo chatter. +

+
+
+

+ Click GPT button to open chatGPT modal. +

+
+
+
+ +
+
+
+

+ Search for the content and click on insert to add it in chatter. +

+
+
+
+ +
+
+
+

+ Content is inserted into the input field when the "Insert" button is clicked. +

+
+
+
+ +
+
+
+
+
+
+
+
+
+ +
+

+ You can add contents from chatGPT to odoo chatter

+
+ +
+
diff --git a/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer.xml b/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer.xml new file mode 100644 index 000000000..eb1ff889a --- /dev/null +++ b/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer_patch.js b/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer_patch.js new file mode 100644 index 000000000..4dc9a87c6 --- /dev/null +++ b/odoo_chatgpt_connector/static/src/discuss/ChatGPT/common/composer_patch.js @@ -0,0 +1,20 @@ +/** @odoo-module **/ +import { Composer } from "@mail/core/common/composer"; +import { useService } from "@web/core/utils/hooks"; +import { patch } from "@web/core/utils/patch"; +import { ChatGPTPromptDialog } from "@html_editor/main/chatgpt/chatgpt_prompt_dialog"; + +patch(Composer.prototype, { + setup() { + super.setup(); + this.dialogService = useService("dialog"); + }, + onClickGPT() { + this.dialogService.add(ChatGPTPromptDialog, { + insert: (content) => this.props.composer.text += ` ${content.textContent}`, + sanitize: (fragment) => DOMPurify.sanitize(fragment, { + IN_PLACE: true, ADD_TAGS: ["#document-fragment"], ADD_ATTR: ["contenteditable"], + }), + }); + }, +});