forked from Techsystech/web
[MIG] web_widget_bokeh_chart: Migration to 16.0
parent
2ec5b261dd
commit
d273326b9d
|
@ -5,19 +5,20 @@
|
||||||
"name": "Web Widget Bokeh Chart",
|
"name": "Web Widget Bokeh Chart",
|
||||||
"category": "Hidden",
|
"category": "Hidden",
|
||||||
"summary": "This widget allows to display charts using Bokeh library.",
|
"summary": "This widget allows to display charts using Bokeh library.",
|
||||||
"author": "ForgeFlow, " "Odoo Community Association (OCA)",
|
"author": "ForgeFlow, " "Odoo Community Association (OCA), " "Creu Blanca",
|
||||||
"version": "15.0.1.1.1",
|
"version": "16.0.1.0.0",
|
||||||
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
|
"maintainers": ["LoisRForgeFlow", "ChrisOForgeFlow"],
|
||||||
"development_status": "Production/Stable",
|
"development_status": "Production/Stable",
|
||||||
"website": "https://github.com/OCA/web",
|
"website": "https://github.com/OCA/web",
|
||||||
"depends": ["web"],
|
"depends": ["web"],
|
||||||
"data": [],
|
"data": [],
|
||||||
"external_dependencies": {"python": ["bokeh==2.4.2"]},
|
"external_dependencies": {"python": ["bokeh==3.1.1"]},
|
||||||
"auto_install": False,
|
"auto_install": False,
|
||||||
"license": "LGPL-3",
|
"license": "LGPL-3",
|
||||||
"assets": {
|
"assets": {
|
||||||
"web.assets_backend": [
|
"web.assets_backend": [
|
||||||
"web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.esm.js",
|
"web_widget_bokeh_chart/static/src/js/web_widget_bokeh_chart.esm.js",
|
||||||
|
"web_widget_bokeh_chart/static/src/xml/bokeh.xml",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,3 +2,6 @@
|
||||||
* Lois Rilo Antelo <lois.rilo@forgeflow.com>
|
* Lois Rilo Antelo <lois.rilo@forgeflow.com>
|
||||||
* Artem Kostyuk <a.kostyuk@mobilunity.com>
|
* Artem Kostyuk <a.kostyuk@mobilunity.com>
|
||||||
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
* Christopher Ormaza <chris.ormaza@forgeflow.com>
|
||||||
|
* Enric Tobella <etobella@creublanca.es>
|
||||||
|
* Oriol Miranda Garrido <oriol.miranda@forgeflow.com>
|
||||||
|
* Bernat Puig Font <bernat.puig@forgeflow.com>
|
||||||
|
|
|
@ -1,3 +1,3 @@
|
||||||
You need to install the python bokeh library::
|
You need to install the python bokeh library::
|
||||||
|
|
||||||
pip3 install bokeh==2.4.2
|
pip3 install bokeh==3.1.1
|
||||||
|
|
|
@ -1,32 +1,32 @@
|
||||||
/** @odoo-module **/
|
/** @odoo-module **/
|
||||||
|
|
||||||
import basicFields from "web.basic_fields";
|
import {CharField} from "@web/views/fields/char/char_field";
|
||||||
import fieldRegistry from "web.field_registry";
|
import {registry} from "@web/core/registry";
|
||||||
|
import {loadBundle} from "@web/core/assets";
|
||||||
const BokehChartWidget = basicFields.FieldChar.extend({
|
const {onWillStart, markup} = owl;
|
||||||
jsLibs: [
|
class BokehChartWidget extends CharField {
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-2.4.2.min.js",
|
setup() {
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-2.4.2.min.js",
|
super.setup();
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-2.4.2.min.js",
|
onWillStart(() =>
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-2.4.2.min.js",
|
loadBundle({
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-2.4.2.min.js",
|
jsLibs: [
|
||||||
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-2.4.2.min.js",
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.1.1.min.js",
|
||||||
],
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.1.1.min.js",
|
||||||
_renderReadonly: function () {
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.1.1.min.js",
|
||||||
try {
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.1.1.min.js",
|
||||||
const val = JSON.parse(this.value);
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.1.1.min.js",
|
||||||
this.$el.html(val.div);
|
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.1.1.min.js",
|
||||||
const script = document.createElement("script");
|
],
|
||||||
script.setAttribute("type", "text/javascript");
|
})
|
||||||
if ("textContent" in script) script.textContent = val.script;
|
);
|
||||||
else script.text = val.script;
|
}
|
||||||
this.$el.append(script);
|
get json_value() {
|
||||||
} catch (error) {
|
var value = JSON.parse(this.props.value);
|
||||||
return this._super(...arguments);
|
value.div = markup(value.div.trim());
|
||||||
}
|
return value;
|
||||||
},
|
}
|
||||||
});
|
}
|
||||||
|
BokehChartWidget.template = "web_widget_bokeh_chart.BokehChartField";
|
||||||
fieldRegistry.add("bokeh_chart", BokehChartWidget);
|
registry.category("fields").add("bokeh_chart", BokehChartWidget);
|
||||||
|
|
||||||
export default BokehChartWidget;
|
export default BokehChartWidget;
|
||||||
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -0,0 +1,7 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
<templates xml:space="preserve">
|
||||||
|
<t t-name="web_widget_bokeh_chart.BokehChartField" owl="1">
|
||||||
|
<t t-out="json_value.div" />
|
||||||
|
<script type="text/javascript" t-out="json_value.script" />
|
||||||
|
</t>
|
||||||
|
</templates>
|
Loading…
Reference in New Issue