a站网址,大连甘井子区教育公共服务平台,如何查做的网站排名,用html做的零食网站文章目录 问题描述梳理写法xml写法前端方法后端action的写法 错误解释 问题描述
在前端的kanban视图上添加了几个自定义按钮#xff0c;按钮点击可以跳转到对应的tree视图#xff0c;在写按钮调用方法的时候报错如下#xff1a; 前端调用后端action报错#xff1a;
actio… 文章目录 问题描述梳理写法xml写法前端方法后端action的写法 错误解释 问题描述
在前端的kanban视图上添加了几个自定义按钮按钮点击可以跳转到对应的tree视图在写按钮调用方法的时候报错如下 前端调用后端action报错
action.views [...action.views.map((v) [v[0], v[1] tree ? list : v[1]])]; // manipulate a copy to keep cached action unmodified梳理写法
xml写法
div classcol-sm-12 col-md-6 col-lg-4 col-xl-4 col-xxl-3 t-on-clickopenQuant quantproducta href#classbtn btn-primary w-100 h-100 border-0 rounded-0 text-capitalize text-break fw-normal p-3库存/a
/div前端方法
async openQuant(ev) {const quant ev.currentTarget.getAttribute(quant);const action await this.orm.call(stock.picking.type, open_action_stock_quant,[[]], {context: {quant: quant}});this.action.doAction(action);}后端action的写法
action {type: ir.actions.act_window,res_model: stock.quant,view_mode: tree,views: [(False, list), (False, form)],
}错误解释
报错的一个原因是后端的action必须有个views这个现实的字段设置才行哪怕id是False都可以的。