Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1781 Näkymät

Greetings everyone,

As a newcomer to Odoo, I'm currently navigating the process of defining a 'saveBoard' function within my custom module's 'board_controller.js'. However, I've encountered a persistent error that I hope to resolve with your assistance.

The error message states: "The following modules are needed by other modules but have not been defined, they may not be present in the correct asset bundle:

  • web.core
  • board.board"

Below is the code snippet I've been working with:


/** @odoo-module **/


odoo.define('my_custom', ['web.core', 'board'], function (require) {

    "use strict";


    var core = require('web.core');

    var originalModule = require('board');


    var renderToString = core._lt;

    var blockDom = core._lt;

    var xmlSerializer = core._lt;


    originalModule.BoardController.include({

        saveBoard: function () {

            const templateFn = renderToString.app.getTemplate("board.arch");

            const bdom = templateFn(this.board, {});

            const root = document.createElement("rendertostring");

            blockDom.mount(bdom, root);

            const result = xmlSerializer.serializeToString(root);

            const arch = result.slice(result.indexOf(""));

            this.rpc("/web/view/edit_custom", {

                custom_id: this.board.customViewId != null ? customViewId : '',

                arch: arch,

            });

            this.env.bus.trigger("CLEAR-CACHES");

        }

    });

});


I would greatly appreciate any assistance or guidance you can provide to resolve this issue. Thank you for your time and support.

Warm regards,


Avatar
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
4
lokak. 24
1514
3
huhtik. 24
3240
Assign groups Ratkaistu
1
tammik. 25
3432
0
maalisk. 24
2011
1
elok. 25
1635