[MIG]web_field_tooltip: Migration to 17.0

This commit is contained in:
manu
2024-07-24 10:16:30 +02:00
parent 9945b0a036
commit e74989d55f
12 changed files with 39 additions and 46 deletions

View File

@@ -427,6 +427,12 @@ If you spotted it first, help us to smash it by providing a detailed and welcome
<h2><a class="toc-backref" href="#toc-entry-6">Contributors</a></h2>
<ul class="simple">
<li>Benoit Aimont &lt;<a class="reference external" href="mailto:benoit.aimont&#64;acsone.eu">benoit.aimont&#64;acsone.eu</a>&gt; (<a class="reference external" href="https://www.acsone.eu/">https://www.acsone.eu/</a>)</li>
<li><a class="reference external" href="https://sygel.es">Sygel</a>:<ul>
<li>Manuel Regidor &lt;<a class="reference external" href="mailto:manuel.regidor&#64;sygel.es">manuel.regidor&#64;sygel.es</a>&gt;</li>
<li>Harald Panten &lt;<a class="reference external" href="mailto:harald.panten&#64;sygel.es">harald.panten&#64;sygel.es</a>&gt;</li>
<li>Valentín Vinagre &lt;<a class="reference external" href="mailto:valentin.vinagre&#64;sygel.es">valentin.vinagre&#64;sygel.es</a>&gt;</li>
</ul>
</li>
</ul>
</div>
<div class="section" id="maintainers">

View File

@@ -4,7 +4,6 @@ import {Component, markup} from "@odoo/owl";
import {FormViewDialog} from "@web/views/view_dialogs/form_view_dialog";
import {session} from "@web/session";
import {usePopover} from "@web/core/popover/popover_hook";
import {useService} from "@web/core/utils/hooks";
export class FieldTooltipPopover extends Component {}
@@ -12,7 +11,7 @@ FieldTooltipPopover.template = "web_field_tooltip.FieldTooltipPopover";
export class FieldTooltip extends Component {
setup() {
this.popover = usePopover();
this.popover = useService("popover");
this.tooltipPopover = null;
this.hasFieldTooltip = this.props.hasFieldTooltip;
this.canManageTooltip = session.can_manage_tooltips;

View File

@@ -1,4 +1,5 @@
sup.field-tooltip {
padding-top: 6px;
.tooltip-icon {
background: none;
border: none;

View File

@@ -1,18 +1,18 @@
/** @odoo-module **/
import {FormController} from "@web/views/form/form_controller";
import {_t} from "@web/core/l10n/translation";
import {patch} from "@web/core/utils/patch";
import {session} from "@web/session";
patch(FormController.prototype, "web_field_tooltip", {
getActionMenuItems() {
const menuItems = this._super(...arguments);
const otherMenuItems = menuItems.other;
const web_field_tooltip = {
get actionMenuItems() {
const menuItems = super.actionMenuItems;
const otherMenuItems = menuItems.action;
if (session.can_manage_tooltips) {
otherMenuItems.push({
key: "manage_tooltips",
description: this.env._t("Manage tooltips"),
description: _t("Manage tooltips"),
callback: () => this.manageTooltips(),
});
}
@@ -31,4 +31,6 @@ patch(FormController.prototype, "web_field_tooltip", {
}
);
},
});
};
patch(FormController.prototype, web_field_tooltip);

View File

@@ -7,7 +7,7 @@ import {patch} from "@web/core/utils/patch";
import {session} from "@web/session";
patch(FormLabel.prototype, "web_field_tooltip", {
const web_field_tooltip = {
get showTooltipAddHelper() {
return session.tooltip_show_add_helper;
},
@@ -27,7 +27,9 @@ patch(FormLabel.prototype, "web_field_tooltip", {
fieldName: props.fieldName,
};
},
});
};
patch(FormLabel.prototype, web_field_tooltip);
FormLabel.components = Object.assign({}, FormLabel.components, {
FieldTooltip,

View File

@@ -7,7 +7,7 @@ import {patch} from "@web/core/utils/patch";
import {session} from "@web/session";
patch(ListRenderer.prototype, "web_field_tooltip", {
const web_field_tooltip = {
showTooltipAddHelper() {
return session.tooltip_show_add_helper;
},
@@ -29,7 +29,9 @@ patch(ListRenderer.prototype, "web_field_tooltip", {
fieldName: fieldName,
};
},
});
};
patch(ListRenderer.prototype, web_field_tooltip);
ListRenderer.components = Object.assign({}, ListRenderer.components, {
FieldTooltip,