mirror of
https://github.com/bringout/oca-ocb-vertical-industry.git
synced 2026-04-21 17:12:03 +02:00
19.0 vanilla
This commit is contained in:
parent
4607ccbd2e
commit
825ff6514e
487 changed files with 184979 additions and 195262 deletions
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue