[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
:alt: License: LGPL-3
.. |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
.. |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
.. |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
|badge1| |badge2| |badge3| |badge4| |badge5|
@ -102,7 +102,7 @@ Bug Tracker
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.
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.
@ -117,20 +117,20 @@ Authors
Contributors
------------
- Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
- Christopher Ormaza <chris.ormaza@forgeflow.com>
- Jordi Ballester Alomar <jordi.ballester@forgeflow.com>
- Christopher Ormaza <chris.ormaza@forgeflow.com>
Other credits
-------------
- This module uses the library
`mpld3 <https://github.com/mpld3/mpld3>`__ which is under the
open-source BSD 3-clause "New" or "Revised" License. Copyright (c)
2013, Jake Vanderplas
- This module uses the library `BeautifulSoup
4 <https://pypi.org/project/beautifulsoup4/>`__ which is under the
open-source MIT License. Copyright (c) 2014, Leonard Richardson
- Odoo Community Association (OCA)
- This module uses the library
`mpld3 <https://github.com/mpld3/mpld3>`__ which is under the
open-source BSD 3-clause "New" or "Revised" License. Copyright (c)
2013, Jake Vanderplas
- This module uses the library `BeautifulSoup
4 <https://pypi.org/project/beautifulsoup4/>`__ which is under the
open-source MIT License. Copyright (c) 2014, Leonard Richardson
- Odoo Community Association (OCA)
Maintainers
-----------
@ -148,14 +148,14 @@ promote its widespread use.
.. |maintainer-JordiBForgeFlow| image:: https://github.com/JordiBForgeFlow.png?size=40px
:target: https://github.com/JordiBForgeFlow
:alt: JordiBForgeFlow
.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px
:target: https://github.com/ChrisOForgeFlow
:alt: ChrisOForgeFlow
.. |maintainer-ThiagoMForgeFlow| image:: https://github.com/ThiagoMForgeFlow.png?size=40px
:target: https://github.com/ThiagoMForgeFlow
:alt: ThiagoMForgeFlow
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.

View File

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

View File

@ -369,7 +369,7 @@ ul.auto-toc {
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! 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
standard views. This is an interactive D3js-based viewer which brings
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>.
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
<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>
</div>
<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
promote its widespread use.</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>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><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/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>
</div>
</div>

View File

@ -1,5 +1,5 @@
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";
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;
this.widget.el.append(script);
});
onWillStart(() =>
loadBundle({
jsLibs: [
"/web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js",
"/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js",
],
})
);
onWillStart(async () => {
await loadJS("/web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js");
await loadJS(
"/web_widget_mpld3_chart/static/src/lib/mpld3/mpld3.v0.5.10.js"
);
});
}
markup(value) {
console.log("Marking up...");