-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[MIG] cmis_web_bus - Migration to 16.0
- Loading branch information
1 parent
46597e3
commit da94685
Showing
10 changed files
with
103 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg | ||
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html | ||
:alt: License: AGPL-3 | ||
|
||
============ | ||
Cmis Web Bus | ||
============ | ||
|
||
This module provide an update of the cmis widget after adding a new file in the folder via the bus. | ||
|
||
Documentation: `alfodoo.org <http://alfodoo.org>`_ | ||
|
||
Credits | ||
======= | ||
|
||
Contributors | ||
------------ | ||
|
||
* Laurent Mignon <laurent.mignon@acsone.eu> | ||
* Maxime Franco <maxime.franco@acsone.eu> | ||
|
||
Most of the code of the DocumentViewer widget is copied from `Odoo | ||
<https://github.com/odoo/odoo/blob/c1fa3b8ab3dfa1306dbdd3b6dc910405a3357d16 | ||
/addons/mail/static/src/js/document_viewer.js>`_ | ||
|
||
|
||
Maintainer | ||
---------- | ||
|
||
.. image:: https://www.acsone.eu/logo.png | ||
:alt: ACSONE SA/NV | ||
:target: http://www.acsone.eu | ||
|
||
This module is maintained by ACSONE SA/NV. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** @odoo-module **/ | ||
|
||
/* --------------------------------------------------------- | ||
+ * Odoo cmis_web_bus | ||
+ * Authors Laurent Mignon 2016, Maxime Franco 2023 Acsone SA/NV | ||
+ * License in __openerp__.py at root level of the module | ||
+ *--------------------------------------------------------- | ||
+*/ | ||
|
||
import {CmisFolderField} from "@cmis_web/cmis_folder/cmis_folder"; | ||
import {patch} from "web.utils"; | ||
import {useBus, useService} from "@web/core/utils/hooks"; | ||
|
||
patch(CmisFolderField.prototype, "cmis_folder_notification", { | ||
setup() { | ||
this._super.apply(this, arguments); | ||
this.cmis_service = useService("deliveryCmisService"); | ||
useBus(this.cmis_service, "cmis_bus", (event) => { | ||
this._handleNotify(event); | ||
}); | ||
}, | ||
async _handleNotify(event) { | ||
if(event.detail.action === "update"){ | ||
this.queryCmisData(); | ||
} | ||
}, | ||
}); |
27 changes: 27 additions & 0 deletions
27
cmis_web_bus/static/src/cmis_folder/delivery_cmis_service.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
/** @odoo-module **/ | ||
|
||
/* --------------------------------------------------------- | ||
+ * Odoo cmis_web_bus | ||
+ * Authors Laurent Mignon 2016, Maxime Franco 2023 Acsone SA/NV | ||
+ * License in __openerp__.py at root level of the module | ||
+ *--------------------------------------------------------- | ||
+*/ | ||
|
||
import {EventBus} from "@odoo/owl"; | ||
import {registry} from "@web/core/registry"; | ||
|
||
export const deliveryCmisService = { | ||
dependencies: ["bus_service", "notification"], | ||
start(_, {bus_service, notification}) { | ||
const bus = new EventBus(); | ||
bus_service.addEventListener("notification", ({detail: notifications}) => { | ||
for (const {payload, type} of notifications) { | ||
if (type === "cmis_node_notification") { | ||
bus.trigger("cmis_bus", payload); | ||
} | ||
} | ||
}); | ||
return bus; | ||
}, | ||
}; | ||
registry.category("services").add("deliveryCmisService", deliveryCmisService); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../cmis_web_bus |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import setuptools | ||
|
||
setuptools.setup( | ||
setup_requires=['setuptools-odoo'], | ||
odoo_addon=True, | ||
) |