19.0 vanilla

This commit is contained in:
Ernad Husremovic 2026-03-09 09:32:43 +01:00
parent 4607ccbd2e
commit 825ff6514e
487 changed files with 184979 additions and 195262 deletions

View file

@ -1,5 +1,4 @@
/** @odoo-module **/
import { _t } from "@web/core/l10n/translation";
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
import { registry } from "@web/core/registry";
import { FormController } from "@web/views/form/form_controller";
@ -9,21 +8,18 @@ export class FleetFormController extends FormController {
/**
* @override
**/
getActionMenuItems() {
const menuItems = super.getActionMenuItems();
const archiveAction = menuItems.other.find((item) => item.key === "archive");
if (archiveAction) {
archiveAction.callback = () => {
const dialogProps = {
body: this.env._t(
"Every service and contract of this vehicle will be considered as archived. Are you sure that you want to archive this record?"
),
confirm: () => this.model.root.archive(),
cancel: () => {},
};
this.dialogService.add(ConfirmationDialog, dialogProps);
getStaticActionMenuItems() {
const menuItems = super.getStaticActionMenuItems();
menuItems.archive.callback = () => {
const dialogProps = {
body: _t(
"Every service and contract of this vehicle will be considered as archived. Are you sure that you want to archive this record?"
),
confirm: () => this.model.root.archive(),
cancel: () => {},
};
}
this.dialogService.add(ConfirmationDialog, dialogProps);
};
return menuItems;
}
}