Files
gzth/soong_workflow/static/src/js/select_create_dialog.js
T
2026-01-24 11:34:58 +08:00

34 lines
1.2 KiB
JavaScript

/** @odoo-module **/
import { patch } from "@web/core/utils/patch";
import { SelectCreateDialog } from "@web/views/view_dialogs/select_create_dialog";
patch(SelectCreateDialog.prototype, {
get viewProps() {
// ################### 使用context <field name="user_id" context="{'select_dialog': 'list'}"/>
const { select_dialog } = this.props.context;
const type = select_dialog && ["kanban", "list"].includes(select_dialog) ? select_dialog : this.env.isSmall ? "kanban" : "list";
// ###############################
// #################### 全局改
// const type = "list";
const props = {
loadIrFilters: true,
...this.baseViewProps,
context: this.props.context,
domain: this.props.domain,
dynamicFilters: this.props.dynamicFilters,
resModel: this.props.resModel,
searchViewId: this.props.searchViewId,
type,
};
if (type === "list") {
props.allowSelectors = this.props.multiSelect;
} else if (type === "kanban") {
props.forceGlobalClick = true;
}
return props;
},
});