コンテンツへスキップ
メニュー
この質問にフラグが付けられました
2265 ビュー

Hello, I had this db and wanted to add some backend assets for new custom buttons. On the manifest file I added:

# 'assets': {
# 'web.assets_backend': [
# '/abs_property_management/static/src/js/buttons.js'
# ],
# 'web.assets_qweb': [
# '/abs_property_management/static/src/js/js_view.js',
# ],
# },

but the js was not loading. When I'd put the xml file into "data/views"  it would load the js but have lime a permanent which wouldn't be gone even if I'd delete the xml file. The error is:

Error to render compiling AST
AttributeError: 'NoneType' object has no attribute 'viewType'
Template: web.assets_backend
Path: /templates/t/t[3]/button
Node: - - -

How can I fix this issue?


xml file:

 

js:

odoo.define("skl_kartice.tree_view_button", function (require){
    "use strict";

    var ajax = require("web.ajax");
    var ListController = require("web.ListController");

    ListController.include({
        renderButtons: function($node) {
            this._super.apply(this, arguments);
            var self = this;
            if (this.$buttons) {
                $(this.$buttons).find(".oe_ispis_kartica").on("click", function() {
                    self.do_action("skl_kartice.action_kartica_report", {
                        additional_context: {},
                    });
                });
            }
        },
    });
});




TO ALL ODOO MODS: this editor isn't showing the xml code

アバター
破棄
関連投稿 返信 ビュー 活動
0
2月 22
1595
5
6月 20
6262
6
8月 19
9640
1
4月 16
4544
2
3月 15
6007