mirror of
https://github.com/bringout/oca-ocb-vertical-industry.git
synced 2026-04-21 12:12:05 +02:00
Initial commit: Vertical Industry packages
This commit is contained in:
commit
d5567a0017
766 changed files with 733028 additions and 0 deletions
|
|
@ -0,0 +1,36 @@
|
|||
/** @odoo-module **/
|
||||
|
||||
import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog";
|
||||
import { registry } from "@web/core/registry";
|
||||
import { FormController } from "@web/views/form/form_controller";
|
||||
import { formView } from "@web/views/form/form_view";
|
||||
|
||||
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);
|
||||
};
|
||||
}
|
||||
return menuItems;
|
||||
}
|
||||
}
|
||||
|
||||
export const fleetFormView = {
|
||||
...formView,
|
||||
Controller: FleetFormController,
|
||||
};
|
||||
|
||||
registry.category("views").add("fleet_form", fleetFormView);
|
||||
Loading…
Add table
Add a link
Reference in a new issue