Skip to content

Commit b67336c

Browse files
[15.0][MIG] web_widget_bokeh_chart
1 parent 6ad99ee commit b67336c

20 files changed

+1356
-825
lines changed

requirements.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# generated from manifests external_dependencies
2-
bokeh==2.3.1
2+
bokeh==2.4.2

web_environment_ribbon/static/src/js/ribbon.js

-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
odoo.define("web_environment_ribbon.ribbon", function (require) {
99
"use strict";
10-
1110
var rpc = require("web.rpc");
1211
var core = require("web.core");
1312

web_m2x_options/static/src/js/form.js

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44
odoo.define("web_m2x_options.web_m2x_options", function (require) {
55
"use strict";
6-
76
var core = require("web.core"),
87
data = require("web.data"),
98
Dialog = require("web.Dialog"),

web_widget_bokeh_chart/README.rst

+10-5
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Web Widget Bokeh Chart
2323
:target: https://runbot.odoo-community.org/runbot/162/14.0
2424
:alt: Try me on Runbot
2525

26-
|badge1| |badge2| |badge3| |badge4| |badge5|
26+
|badge1| |badge2| |badge3| |badge4| |badge5|
2727

2828
This module add the possibility to insert Bokeh charts into Odoo standard views.
2929

@@ -52,7 +52,7 @@ Installation
5252

5353
You need to install the python bokeh library::
5454

55-
pip3 install bokeh==2.3.1
55+
pip3 install bokeh==2.4.2
5656

5757
Usage
5858
=====
@@ -75,7 +75,7 @@ To insert a Bokeh chart in a view proceed as follows:
7575
line = p.line([0, 2], [1, 8], line_width=5)
7676
# (...)
7777
# fill the record field with both markup and the script of a chart.
78-
script, div = components(p)
78+
script, div = components(p, wrap_script=False)
7979
rec.bokeh_chart = '%s%s' % (div, script)
8080

8181
#. In the view, add something like this wherever you want to display your
@@ -109,6 +109,7 @@ Contributors
109109
* Jordi Ballester Alomar <[email protected]>
110110
* Lois Rilo Antelo <[email protected]>
111111
* Artem Kostyuk <[email protected]>
112+
* Christopher ormaza <[email protected]>
112113

113114
Other credits
114115
~~~~~~~~~~~~~
@@ -134,11 +135,15 @@ promote its widespread use.
134135
.. |maintainer-LoisRForgeFlow| image:: https://github.com/LoisRForgeFlow.png?size=40px
135136
:target: https://github.com/LoisRForgeFlow
136137
:alt: LoisRForgeFlow
138+
.. |maintainer-ChrisOForgeFlow| image:: https://github.com/ChrisOForgeFlow.png?size=40px
139+
:target: https://github.com/ChrisOForgeFlow
140+
:alt: ChrisOForgeFlow
137141

138142
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
139143

140-
|maintainer-LoisRForgeFlow|
144+
|maintainer-LoisRForgeFlow|
145+
|maintainer-ChrisOForgeFlow|
141146

142-
This module is part of the `OCA/web <https://github.com/OCA/web/tree/14.0/web_widget_bokeh_chart>`_ project on GitHub.
147+
This module is part of the `OCA/web <https://github.com/OCA/web/tree/15.0/web_widget_bokeh_chart>`_ project on GitHub.
143148

144149
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

web_widget_bokeh_chart/__manifest__.py

+9-4
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,18 @@
66
"category": "Hidden",
77
"summary": "This widget allows to display charts using Bokeh library.",
88
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
9-
"version": "14.0.2.3.1",
10-
"maintainers": ["LoisRForgeFlow"],
9+
"version": "15.0.1.0.0",
10+
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
1111
"development_status": "Production/Stable",
1212
"website": "https://github.com/OCA/web",
1313
"depends": ["web"],
14-
"data": ["views/web_widget_bokeh_chart.xml"],
15-
"external_dependencies": {"python": ["bokeh==2.3.1"]},
14+
"data": [],
15+
"external_dependencies": {"python": ["bokeh==2.4.2"]},
1616
"auto_install": False,
1717
"license": "LGPL-3",
18+
"assets": {
19+
"web.assets_backend": [
20+
"web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.esm.js",
21+
],
22+
},
1823
}
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
* Jordi Ballester Alomar <[email protected]>
22
* Lois Rilo Antelo <[email protected]>
33
* Artem Kostyuk <[email protected]>
4+
* Christopher Ormaza <[email protected]>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
You need to install the python bokeh library::
22

3-
pip3 install bokeh==2.3.1
3+
pip3 install bokeh==2.4.2

web_widget_bokeh_chart/readme/USAGE.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ To insert a Bokeh chart in a view proceed as follows:
1616
line = p.line([0, 2], [1, 8], line_width=5)
1717
# (...)
1818
# fill the record field with both markup and the script of a chart.
19-
script, div = components(p)
19+
script, div = components(p, wrap_script=False)
2020
rec.bokeh_chart = '%s%s' % (div, script)
2121

2222
#. In the view, add something like this wherever you want to display your
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
/** @odoo-module **/
2+
3+
import basicFields from "web.basic_fields";
4+
import fieldRegistry from "web.field_registry";
5+
6+
const BokehChartWidget = basicFields.FieldChar.extend({
7+
jsLibs: [
8+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js",
9+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js",
10+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js",
11+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js",
12+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js",
13+
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js",
14+
],
15+
_renderReadonly: function () {
16+
try {
17+
const val = JSON.parse(this.value);
18+
this.$el.html(val.div);
19+
const script = document.createElement("script");
20+
script.setAttribute("type", "text/javascript");
21+
if ("textContent" in script) script.textContent = val.script;
22+
else script.text = val.script;
23+
$("head").append(script);
24+
} catch (error) {
25+
return this._super(...arguments);
26+
}
27+
},
28+
});
29+
30+
fieldRegistry.add("bokeh_chart", BokehChartWidget);
31+
32+
export default BokehChartWidget;

web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.js

-17
This file was deleted.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.3.1.min.js

-594
This file was deleted.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js

+596
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.3.1.min.js

-54
This file was deleted.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js

+53
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js

+74
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js

+328
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)