跳至内容
菜单
此问题已终结
1 回复
444 查看
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

形象
丢弃