Reputation: 21
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.
Upvotes: 0
Views: 22