Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
1744 Lượt xem

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,


Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
4
thg 10 24
1502
3
thg 4 24
3146
Assign groups Đã xử lý
1
thg 1 25
3310
0
thg 3 24
2001
1
thg 8 25
1627