合并企业版代码(未测试,先提交到测试分支)

This commit is contained in:
qihao.gong@jikimo.com
2023-04-14 17:42:23 +08:00
parent 7a7b3d7126
commit d28525526a
1300 changed files with 513579 additions and 5426 deletions

View File

@@ -0,0 +1,9 @@
.o_list_renderer {
--ListRenderer-thead-bg-color: #{$o-view-background-color};
--ListRenderer-thead-border-end-color: transparent;
// Standalone list views
.o_list_view & {
--ListRenderer-thead-padding-v: 1rem;
}
}

View File

@@ -0,0 +1,38 @@
/** @odoo-module */
import { isMobileOS } from "@web/core/browser/feature_detection";
import { useService } from "@web/core/utils/hooks";
import { patch } from "@web/core/utils/patch";
import { ListRenderer } from "@web/views/list/list_renderer";
import { PromoteStudioDialog } from "@web_enterprise/webclient/promote_studio_dialog/promote_studio_dialog";
export const patchListRendererDesktop = {
setup() {
this._super(...arguments);
this.userService = useService("user");
const { actionId, actionType } = this.env.config;
const list = this.props.list;
this.isStudioEditable =
!isMobileOS() &&
this.userService.isSystem &&
actionId &&
actionType === "ir.actions.act_window" &&
list === list.model.root;
},
get displayOptionalFields() {
return this.isStudioEditable || this.getOptionalFields.length;
},
/**
* This function opens promote studio dialog
*
* @private
*/
onSelectedAddCustomField() {
this.env.services.dialog.add(PromoteStudioDialog, {});
},
};
patch(ListRenderer.prototype, "web_enterprise.ListRendererDesktop", patchListRendererDesktop);

View File

@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-inherit="web.ListRenderer" t-inherit-mode="extension" owl="1">
<xpath expr="//Dropdown" position="inside">
<t t-if="isStudioEditable">
<div t-if="getOptionalFields.length" class="dropdown-divider"/>
<DropdownItem parentClosingMode="'none'" onSelected="() => this.onSelectedAddCustomField()" class="'dropdown-item-studio'">
<i class="fa fa-plus fa-fw me-2"/>
<span>Add Custom Field</span>
</DropdownItem>
</t>
</xpath>
</t>
</templates>