跳至內容
選單
此問題已被標幟
1 回覆
430 瀏覽次數
odoo.define("hide_archive_unarchive_buttons.BasicView", function (require) {
"use strict";
var BasicView = require("web.BasicView");
var rpc = require("web.rpc");


BasicView.include({
init: function (viewInfo, params) {
this._super(viewInfo, params);
var self = this;
rpc.query({
model: "ir.config_parameter",
method: "get_to_archive_models",
args: [[]],
}).then(function (models) {
if (models.includes(self.controllerParams.modelName)) {
console.log("code executed");
self.controllerParams.archiveEnabled = "False" in viewInfo.fields;
}
});
},
});
});

This code works perfectly on the odoo15 but its not working on odoo16, I doubt that the code inside the include block is not getting executed,i have also tried with the patch and extend methods. There is no error but the "code executed" statement is not getting printed in console

頭像
捨棄