Skip to content

Commit

Permalink
[16.0][MIG] Migration to v16.0
Browse files Browse the repository at this point in the history
  • Loading branch information
robyf70 committed Jun 7, 2023
1 parent 60428a2 commit ff575d4
Show file tree
Hide file tree
Showing 12 changed files with 89 additions and 122 deletions.
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# generated from manifests external_dependencies
plotly==5.13.1
6 changes: 6 additions & 0 deletions setup/web_widget_plotly_chart/setup.py
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,
)
16 changes: 8 additions & 8 deletions web_widget_plotly_chart/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,20 +14,20 @@ Web Widget Plotly
: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/14.0/web_widget_plotly_chart
:target: https://github.com/OCA/web/tree/16.0/web_widget_plotly_chart
:alt: OCA/web
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_widget_plotly_chart
:target: https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_plotly_chart
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/162/14.0
:alt: Try me on Runbot
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/webui/builds.html?repo=OCA/web&target_branch=16.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module add the possibility to insert Plotly charts into Odoo standard views.

.. image:: https://raw.githubusercontent.com/OCA/web/14.0/web_widget_plotly_chart/static/description/example.png
.. image:: https://raw.githubusercontent.com/OCA/web/16.0/web_widget_plotly_chart/static/description/example.png
:alt: Plotly Chart inserted into an Odoo view
:width: 600 px

Expand Down Expand Up @@ -86,7 +86,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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/web/issues/new?body=module:%20web_widget_plotly_chart%0Aversion:%2014.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_plotly_chart%0Aversion:%2016.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.

Expand Down Expand Up @@ -133,6 +133,6 @@ Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-robyf70|

This module is part of the `OCA/web <https://github.com/OCA/web/tree/14.0/web_widget_plotly_chart>`_ project on GitHub.
This module is part of the `OCA/web <https://github.com/OCA/web/tree/16.0/web_widget_plotly_chart>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
14 changes: 9 additions & 5 deletions web_widget_plotly_chart/__manifest__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,17 @@
"maintainers": ["robyf70"],
"website": "https://github.com/OCA/web",
"category": "Web",
"version": "14.0.1.0.0",
"version": "16.0.1.0.0",
"depends": ["web"],
"data": [
"views/web_widget_plotly_chart.xml",
],
"data": [],
"external_dependencies": {
"python": ["plotly==5.4.0"],
"python": ["plotly==5.13.1"],
},
"assets": {
"web.assets_backend": [
"web_widget_plotly_chart/static/src/js/widget_plotly.esm.js",
"web_widget_plotly_chart/static/src/js/widget_plotly.xml",
],
},
"license": "LGPL-3",
}
10 changes: 5 additions & 5 deletions web_widget_plotly_chart/static/description/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.15.1: http://docutils.sourceforge.net/" />
<meta name="generator" content="Docutils: http://docutils.sourceforge.net/" />
<title>Web Widget Plotly</title>
<style type="text/css">

Expand Down Expand Up @@ -367,9 +367,9 @@ <h1 class="title">Web Widget Plotly</h1>
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" 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" href="https://github.com/OCA/web/tree/14.0/web_widget_plotly_chart"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-14-0/web-14-0-web_widget_plotly_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runbot.odoo-community.org/runbot/162/14.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p><a class="reference external" 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" 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" href="https://github.com/OCA/web/tree/16.0/web_widget_plotly_chart"><img alt="OCA/web" src="https://img.shields.io/badge/github-OCA%2Fweb-lightgray.png?logo=github" /></a> <a class="reference external" href="https://translation.odoo-community.org/projects/web-16-0/web-16-0-web_widget_plotly_chart"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external" href="https://runboat.odoo-community.org/webui/builds.html?repo=OCA/web&amp;target_branch=16.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
<p>This module add the possibility to insert Plotly charts into Odoo standard views.</p>
<img alt="Plotly Chart inserted into an Odoo view" src="https://raw.githubusercontent.com/OCA/web/14.0/web_widget_plotly_chart/static/description/example.png" style="width: 600px;" />
<img alt="Plotly Chart inserted into an Odoo view" src="https://raw.githubusercontent.com/OCA/web/16.0/web_widget_plotly_chart/static/description/example.png" style="width: 600px;" />
<p><a class="reference external" href="https://plot.ly/">Plotly</a> is a Python interactive visualization
library built on top of d3.js and stack.gl, plotly.js is a high-level,
declarative charting library. plotly.js ships with over 40 chart types,
Expand Down Expand Up @@ -435,7 +435,7 @@ <h1><a class="toc-backref" href="#id3">Bug Tracker</a></h1>
<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 smashing it by providing a detailed and welcomed
<a class="reference external" href="https://github.com/OCA/web/issues/new?body=module:%20web_widget_plotly_chart%0Aversion:%2014.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_plotly_chart%0Aversion:%2016.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">
Expand Down Expand Up @@ -471,7 +471,7 @@ <h2><a class="toc-backref" href="#id8">Maintainers</a></h2>
promote its widespread use.</p>
<p>Current <a class="reference external" href="https://odoo-community.org/page/maintainer-role">maintainer</a>:</p>
<p><a class="reference external" href="https://github.com/robyf70"><img alt="robyf70" src="https://github.com/robyf70.png?size=40px" /></a></p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/web/tree/14.0/web_widget_plotly_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/16.0/web_widget_plotly_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>
Expand Down
42 changes: 42 additions & 0 deletions web_widget_plotly_chart/static/src/js/widget_plotly.esm.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/** @odoo-module **/

import {loadJS} from "@web/core/assets";
import {registry} from "@web/core/registry";

import {Component, onPatched, onWillStart, useEffect, useRef} from "@odoo/owl";

export class PlotlyChartWidgetField extends Component {
setup() {
this.divRef = useRef("plotly");

onWillStart(async () => {
await loadJS(
"/web_widget_plotly_chart/static/src/lib/plotly/plotly-2.18.2.min.js"
);
this.updatePlotly(this.props.value);
});

onPatched(() => {
this.updatePlotly(this.props.value);
});

useEffect(() => {
this.updatePlotly(this.props.value);
});
}
updatePlotly(value) {
const value_html = $(value);
const div = value_html.find(".plotly-graph-div").get(0).outerHTML || "";
const script = value_html.find("script").get(0).textContent || "";

if (this.divRef.el) {
this.divRef.el.innerHTML = div;
new Function(script)();
}
}
}

PlotlyChartWidgetField.template = "web_widget_plotly_chart.PlotlyChartWidgetField";
PlotlyChartWidgetField.supportedTypes = ["char", "text"];

registry.category("fields").add("plotly_chart", PlotlyChartWidgetField);
17 changes: 0 additions & 17 deletions web_widget_plotly_chart/static/src/js/widget_plotly.js

This file was deleted.

8 changes: 8 additions & 0 deletions web_widget_plotly_chart/static/src/js/widget_plotly.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">

<t t-name="web_widget_plotly_chart.PlotlyChartWidgetField" owl="1">
<div t-ref="plotly" />
</t>

</templates>

Large diffs are not rendered by default.

65 changes: 0 additions & 65 deletions web_widget_plotly_chart/static/src/lib/plotly/plotly-2.7.0.min.js

This file was deleted.

22 changes: 0 additions & 22 deletions web_widget_plotly_chart/views/web_widget_plotly_chart.xml

This file was deleted.

0 comments on commit ff575d4

Please sign in to comment.