/** @odoo-module **/ // Copyright (C) 2018 DynApps // Copyright (C) 2022 Yizuo // @author Stefan Rijnhart // @author Robin Conjour // PengYB(YiZuo) use OWL Rewrite. // @author PengYB // License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import { FormController } from "@web/views/form/form_controller"; import { _lt } from "@web/core/l10n/translation"; import { ConfirmationDialog } from "@web/core/confirmation_dialog/confirmation_dialog"; import { patch } from "@web/core/utils/patch"; patch(FormController.prototype,"Duplicate Confirm",{ async duplicateRecord() { const dialogProps = { body: _lt("Are you sure that you would like to copy this record?"), confirm: async () => { await this.model.root.duplicate(); // if (!this.model.root.resId) { // this.env.config.historyBack(); // } }, cancel: () => {}, }; this.dialogService.add(ConfirmationDialog, dialogProps); } });