Hii,
To override the Website Menu Editor dialog in Odoo 18 without modifying core addons, you need to extend the existing Owl components used in the website menu editor through a custom module.
Here js file,
/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { MenuDialog } from "@website/js/menu/menu_dialog"; // Adjust if path changes
patch(MenuDialog.prototype, {
setup() {
this._super();
this.state.extraImage = null; // Custom field state
},
async saveMenuItem() {
// Add your custom logic here (e.g., save extraImage)
console.log("Saving image:", this.state.extraImage);
await this._super();
},
});
assets.xml
<odoo>
<template id="assets_frontend" inherit_id="web.assets_frontend" name="Custom Menu Dialog Patch">
<xpath expr="." position="inside">
<script type="module" src="/your_module/static/src/js/menu_dialog_patch.js"/>
</xpath>
</template>
</odoo>