[MIG] web_widget_mpld3_chart: Migration to 18.0

pull/3140/head
ThiagoMForgeFlow 2025-03-28 16:31:42 +01:00
parent ec068a2000
commit 3f4074c9f3
4 changed files with 32 additions and 34 deletions

View File

@ -17,13 +17,13 @@ Web Widget mpld3 Chart
:target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html
:alt: License: LGPL-3 :alt: License: LGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github .. |badge3| image:: https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github
:target: https://github.com/OCA/web/tree/17.0/web_widget_mpld3_chart :target: https://github.com/OCA/web/tree/18.0/web_widget_mpld3_chart
:alt: OCA/web :alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png .. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_mpld3_chart :target: https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_mpld3_chart
:alt: Translate me on Weblate :alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png .. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=17.0 :target: https://runboat.odoo-community.org/builds?repo=OCA/web&target_branch=18.0
:alt: Try me on Runboat :alt: Try me on Runboat
|badge1| |badge2| |badge3| |badge4| |badge5| |badge1| |badge2| |badge3| |badge4| |badge5|
@ -102,7 +102,7 @@ Bug Tracker
Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_. Bugs are tracked on `GitHub Issues <https://github.com/OCA/web/issues>`_.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_. `feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.
Do not contact contributors directly about support or help with technical issues. Do not contact contributors directly about support or help with technical issues.
@ -117,20 +117,20 @@ Authors
Contributors Contributors
------------ ------------
- Jordi Ballester Alomar <jordi.ballester@forgeflow.com> - Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
- Christopher Ormaza <chris.ormaza@forgeflow.com> - Christopher Ormaza <chris.ormaza@forgeflow.com>
Other credits Other credits
------------- -------------
- This module uses the library - This module uses the library
`mpld3 <https://github.com/mpld3/mpld3>`__ which is under the `mpld3 <https://github.com/mpld3/mpld3>`__ which is under the
open-source BSD 3-clause "New" or "Revised" License. Copyright (c) open-source BSD 3-clause "New" or "Revised" License. Copyright (c)
2013, Jake Vanderplas 2013, Jake Vanderplas
- This module uses the library `BeautifulSoup - This module uses the library `BeautifulSoup
4 <https://pypi.org/project/beautifulsoup4/>`__ which is under the 4 <https://pypi.org/project/beautifulsoup4/>`__ which is under the
open-source MIT License. Copyright (c) 2014, Leonard Richardson open-source MIT License. Copyright (c) 2014, Leonard Richardson
- Odoo Community Association (OCA) - Odoo Community Association (OCA)
Maintainers Maintainers
----------- -----------
@ -148,14 +148,14 @@ promote its widespread use.
.. |maintainer-JordiBForgeFlow| image:: https://github.com/JordiBForgeFlow.png?size=40px .. |maintainer-JordiBForgeFlow| image:: https://github.com/JordiBForgeFlow.png?size=40px
:target: https://github.com/JordiBForgeFlow :target: https://github.com/JordiBForgeFlow
:alt: JordiBForgeFlow :alt: JordiBForgeFlow
.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px .. |maintainer-ThiagoMForgeFlow| image:: https://github.com/ThiagoMForgeFlow.png?size=40px
:target: https://github.com/ChrisOForgeFlow :target: https://github.com/ThiagoMForgeFlow
:alt: ChrisOForgeFlow :alt: ThiagoMForgeFlow
Current `maintainers <https://odoo-community.org/page/maintainer-role>`__: Current `maintainers <https://odoo-community.org/page/maintainer-role>`__:
|maintainer-JordiBForgeFlow| |maintainer-ChrisOForgeFlow| |maintainer-JordiBForgeFlow| |maintainer-ThiagoMForgeFlow|
This module is part of the `OCA/web <https://github.com/OCA/web/tree/17.0/web_widget_mpld3_chart>`_ project on GitHub. This module is part of the `OCA/web <https://github.com/OCA/web/tree/18.0/web_widget_mpld3_chart>`_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute. You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

View File

@ -6,14 +6,14 @@
"category": "Hidden", "category": "Hidden",
"summary": "This widget allows to display charts using MPLD3 library.", "summary": "This widget allows to display charts using MPLD3 library.",
"author": "ForgeFlow, Odoo Community Association (OCA)", "author": "ForgeFlow, Odoo Community Association (OCA)",
"version": "17.0.1.0.0", "version": "18.0.1.0.0",
"website": "https://github.com/OCA/web", "website": "https://github.com/OCA/web",
"depends": ["web"], "depends": ["web"],
"data": [], "data": [],
"external_dependencies": {"python": ["mpld3==0.5.10", "beautifulsoup4"]}, "external_dependencies": {"python": ["mpld3==0.5.10", "beautifulsoup4"]},
"auto_install": False, "auto_install": False,
"development_status": "Beta", "development_status": "Beta",
"maintainers": ["JordiBForgeFlow", "ChrisOForgeFlow"], "maintainers": ["JordiBForgeFlow", "ThiagoMForgeFlow"],
"license": "LGPL-3", "license": "LGPL-3",
"assets": { "assets": {
"web.assets_backend": [ "web.assets_backend": [

View File

@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:671a850d1911018fe9105e0d3c6f95fd235257bade3adba7267cc1cad2641cbe !! source digest: sha256:671a850d1911018fe9105e0d3c6f95fd235257bade3adba7267cc1cad2641cbe
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! --> !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/17.0/web_widget_mpld3_chart"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-17-0/web-17-0-web_widget_mpld3_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=17.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p> <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/lgpl-3.0-standalone.html"><img alt="License: LGPL-3" src="https://img.shields.io/badge/licence-LGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/web/tree/18.0/web_widget_mpld3_chart"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/web-18-0/web-18-0-web_widget_mpld3_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/web&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module adds the possibility to insert mpld3 charts into Odoo <p>This module adds the possibility to insert mpld3 charts into Odoo
standard views. This is an interactive D3js-based viewer which brings standard views. This is an interactive D3js-based viewer which brings
matplotlib graphics to the browser.</p> matplotlib graphics to the browser.</p>
@ -445,7 +445,7 @@ your mpld3 chart:</p>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>. <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/web/issues">GitHub Issues</a>.
In case of trouble, please check there if your issue has already been reported. In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed If you spotted it first, help us to smash it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p> <a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_mpld3_chart%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p> <p>Do not contact contributors directly about support or help with technical issues.</p>
</div> </div>
<div class="section" id="credits"> <div class="section" id="credits">
@ -486,8 +486,8 @@ open-source MIT License. Copyright (c) 2014, Leonard Richardson</li>
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use.</p> promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p> <p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainers</a>:</p>
<p><a class="reference external image-reference" href="https://github.com/JordiBForgeFlow"><img alt="JordiBForgeFlow" src="https://github.com/JordiBForgeFlow.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/ChrisOForgeFlow"><img alt="ChrisOForgeFlow" src="https://github.com/ChrisOForgeFlow.png?size=40px" /></a></p> <p><a class="reference external image-reference" href="https://github.com/JordiBForgeFlow"><img alt="JordiBForgeFlow" src="https://github.com/JordiBForgeFlow.png?size=40px" /></a> <a class="reference external image-reference" href="https://github.com/ThiagoMForgeFlow"><img alt="ThiagoMForgeFlow" src="https://github.com/ThiagoMForgeFlow.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/17.0/web_widget_mpld3_chart">OCA/web</a> project on GitHub.</p> <p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/18.0/web_widget_mpld3_chart">OCA/web</a> project on GitHub.</p>
<p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p> <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
</div> </div>
</div> </div>

View File

@ -1,5 +1,5 @@
import {Component, markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl"; import {Component, markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
import {loadBundle} from "@web/core/assets"; import {loadJS} from "@web/core/assets";
import {registry} from "@web/core/registry"; import {registry} from "@web/core/registry";
export default class Mpld3ChartJsonWidget extends Component { export default class Mpld3ChartJsonWidget extends Component {
@ -15,14 +15,12 @@ export default class Mpld3ChartJsonWidget extends Component {
script.text = this.props.record.data[this.props.name].script; script.text = this.props.record.data[this.props.name].script;
this.widget.el.append(script); this.widget.el.append(script);
}); });
onWillStart(() => onWillStart(async () => {
loadBundle({ await loadJS("/web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js");
jsLibs: [ await loadJS(
"/web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js", "/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js"
"/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js", );
], });
})
);
} }
markup(value) { markup(value) {
console.log("Marking up..."); console.log("Marking up...");