跳至内容
菜单
此问题已终结
1115 查看

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,


形象
丢弃
相关帖文 回复 查看 活动
4
10月 24
745
3
4月 24
1209
Assign groups 已解决
1
1月 25
1395
0
3月 24
1154
1
6月 24
948