37 lines
1.0 KiB
JavaScript
37 lines
1.0 KiB
JavaScript
/** @odoo-module **/
|
|
|
|
import { _lt } from "@web/core/l10n/translation";
|
|
|
|
import { patch } from "@web/core/utils/patch";
|
|
import { SelectionField } from "@web/views/fields/selection/selection_field";
|
|
import { useEffect, useRef, onWillUnmount } from "@odoo/owl";
|
|
|
|
patch(SelectionField.prototype, {
|
|
setup() {
|
|
// this._super(...arguments);
|
|
super.setup(...arguments);
|
|
|
|
let selectRef = useRef("select");
|
|
useEffect(() => {
|
|
// if (!this.props.readonly) {
|
|
// if (selectRef.el) {
|
|
// $(selectRef.el).select2({});
|
|
// }
|
|
// }
|
|
// return () => {
|
|
// if (selectRef.el) {
|
|
// $(selectRef.el).select2("destroy");
|
|
// }
|
|
// };
|
|
}, () => [this.props.readonly, selectRef.el]);
|
|
|
|
onWillUnmount(() => {
|
|
// if (selectRef.el) {
|
|
// $(selectRef.el).select2("destroy");
|
|
// }
|
|
});
|
|
}
|
|
});
|
|
|
|
SelectionField.template = "awesome_theme.SelectionField";
|