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,37 @@
import {Component, markup, onMounted, onPatched, onWillStart, useRef} from "@odoo/owl";
import {loadJS} from "@web/core/assets";
import {registry} from "@web/core/registry";
export default class Mpld3ChartJsonWidget 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(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...");
return markup(value);
}
}
Mpld3ChartJsonWidget.template = "web_widget_mpld3_chart.Mpld3ChartJsonWidget";
export const mpld3ChartJsonWidget = {
component: Mpld3ChartJsonWidget,
};
registry.category("fields").add("mpld3_chart", mpld3ChartJsonWidget);

18568
web_widget_mpld3_chart/static/src/lib/d3/d3.v5.js vendored Executable file

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="UTF-8" ?>
<templates xml:space="preserve">
<div t-ref="widget" t-name="web_widget_mpld3_chart.Mpld3ChartJsonWidget">
<t
t-if="this.props.record.data[this.props.name].div"
t-out="markup(this.props.record.data[this.props.name].div)"
/>
</div>
</templates>