admin管理员组文章数量:1203458
I try to add a cogmenu that set my record to a soft deleted state.
My action is working correctly, but the view is not updated. how can I update my view ?
This is my current code. I force the reload since the form is not updated
export class CogMenuItemTrash extends Component {
static template = "CogMenuItemTrash";
static components = { DropdownItem };
static props = {};
setup() {
this.action = useService("action");
this.orm = useService("orm");
}
onTrash() {
const controller = this.action.currentController;
const currentId = controller.currentId || controller.props.resId;
this.orm.call('model', 'action_send_to_trash', [currentId])
this.action.doAction({
type: "ir.actions.client",
tag: "reload",
});
}
}
When I add this action to the view.xml it's correctly refreshed. I would like that my cogaction act like any others actions of the form view.
本文标签: odooAdding action on cogmenuStack Overflow
版权声明:本文标题:odoo - Adding action on cogmenu - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738634641a2103953.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论