51 lines
1.0 KiB
JavaScript
51 lines
1.0 KiB
JavaScript
/** @odoo-module **/
|
|
import { Component } from "@odoo/owl";
|
|
import { registry } from "@web/core/registry";
|
|
import { useService } from "@web/core/utils/hooks";
|
|
|
|
export class Version extends Component {
|
|
static template = "base_foundation.version";
|
|
static props = ["*"];
|
|
|
|
setup() {
|
|
this.actionService = useService("action");
|
|
}
|
|
|
|
async openDialog(size) {
|
|
const action = {
|
|
name: 'Mitchell Admin',
|
|
type: 'ir.actions.act_window',
|
|
res_model: 'res.users',
|
|
res_id: 2,
|
|
views: [[162, 'form']],
|
|
target: 'new',
|
|
context: {
|
|
dialog_size: size,
|
|
},
|
|
};
|
|
this.actionService.doAction(action);
|
|
}
|
|
|
|
async openSmall() {
|
|
this.openDialog("small");
|
|
}
|
|
|
|
async openMedium() {
|
|
this.openDialog("medium");
|
|
}
|
|
|
|
async openLarge() {
|
|
this.openDialog("large");
|
|
}
|
|
|
|
async openExtraLarge() {
|
|
this.openDialog("extra-large");
|
|
}
|
|
|
|
async openFullscreen() {
|
|
this.openDialog("fullscreen");
|
|
}
|
|
}
|
|
|
|
registry.category("actions").add("issue.version", Version);
|