Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
1114 Zobrazení

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
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
4
říj 24
745
3
dub 24
1209
Assign groups Vyřešeno
1
led 25
1395
0
bře 24
1154
1
čvn 24
948