Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
import {markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
import {CharField, charField} from "@web/views/fields/char/char_field";
import {loadJS} from "@web/core/assets";
import {registry} from "@web/core/registry";
export async function loadBokehLibraries() {
const scripts = [
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.6.3.min.js",
];
for (const script of scripts) {
await loadJS(script);
}
}
export default class BokehChartWidget extends CharField {
setup() {
this.widget = useRef("widget");
onPatched(() => {
var script = document.createElement("script");
script.text = this.json_value.script;
this.widget.el.append(script);
});
onMounted(() => {
var script = document.createElement("script");
script.text = this.json_value.script;
this.widget.el.append(script);
});
super.setup();
onWillStart(() => loadBokehLibraries());
}
get json_value() {
var value = false;
if (this.props.record.data[this.props.name]) {
value = JSON.parse(this.props.record.data[this.props.name]);
if (value) {
value.div = markup(value.div.trim());
}
}
return value;
}
}
BokehChartWidget.template = "web_widget_bokeh_chart.BokehChartField";
export const bokehChartWidget = {
...charField,
component: BokehChartWidget,
};
registry.category("fields").add("bokeh_chart", bokehChartWidget);

View File

@@ -0,0 +1,47 @@
import {Component, markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
import {loadJS} from "@web/core/assets";
import {registry} from "@web/core/registry";
export async function loadBokehLibraries() {
const scripts = [
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-api-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-widgets-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-tables-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-mathjax-3.6.3.min.js",
"/web_widget_bokeh_chart/static/src/lib/bokeh/bokeh-gl-3.6.3.min.js",
];
for (const script of scripts) {
await loadJS(script);
}
}
export default class BokehChartJsonWidget extends Component {
setup() {
this.widget = useRef("widget");
onPatched(() => {
var script = document.createElement("script");
script.text = this.props.record.data[this.props.name].script;
this.widget.el.append(script);
});
onMounted(() => {
var script = document.createElement("script");
script.text = this.props.record.data[this.props.name].script;
this.widget.el.append(script);
});
onWillStart(() => loadBokehLibraries());
}
markup(value) {
console.log("Marking up...");
return markup(value);
}
}
BokehChartJsonWidget.template = "web_widget_bokeh_chart.BokehChartlJsonField";
export const bokehChartJsonWidget = {
component: BokehChartJsonWidget,
};
registry.category("fields").add("bokeh_chart_json", bokehChartJsonWidget);