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

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,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="FieldMany2OneBarcode" t-extend="FieldMany2One">
<t t-jquery="button.o_external_button " t-operation="after">
<button
type="button"
class="btn o_barcode"
tabindex="-1"
draggable="false"
aria-label="Scan barcode"
title="Scan barcode"
/>
</t>
</t>
</templates>

View File

@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="StatusbarButtonsDropdown">
<div class="o_statusbar_buttons">
<div t-attf-class="btn-group #{open ? 'show' : ''}">
<a role="button" class="btn btn-primary dropdown-toggle" href="#"
data-bs-toggle="dropdown" aria-expanded="false">Action</a>
<div t-attf-class="dropdown-menu #{open ? 'show' : ''}" role="menu"/>
</div>
</div>
</t>
<t t-name="FieldStatus.content.mobile">
<button type="button" class="btn btn-primary dropdown-toggle" data-bs-toggle="dropdown">
<t t-if="status" t-esc="status.display_name"/>
</button>
<div class="dropdown-menu" role="menu">
<t t-foreach="selection" t-as="i" t-key="i_index">
<t t-call="FieldStatus.content.button">
<t t-set="is_dropdown" t-value="true"/>
</t>
</t>
</div>
</t>
<t t-extend="ListView.selection">
<t t-jquery=".o_list_selection_box" t-operation="prepend">
<button class="btn btn-link py-0 o_discard_selection" t-if="isMobile">
<span class="fa-2x">&#215;</span>
</button>
</t>
</t>
<t t-inherit="web.Legacy.ActionMenus" t-inherit-mode="extension" owl="1" t-translation="off">
<xpath expr="//DropdownMenu[@items='printItems']" position="attributes">
<attribute name="closeOnSelected">env.device.isMobile</attribute>
</xpath>
</t>
</templates>

View File

@@ -0,0 +1,125 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="web_enterprise._ControlPanel" owl="1">
<div class="o_control_panel" t-on-switch-view="_onSwitchView" t-ref="controlPanel">
<!-- Mobile search view open -->
<t t-portal="'body'" t-if="state.showMobileSearch">
<div class="o_searchview o_mobile_search">
<div class="o_mobile_search_header">
<button type="button" class="o_mobile_search_button btn"
t-on-click="() => state.showMobileSearch = false"
>
<i class="fa fa-arrow-left"/>
<strong class="ml8">FILTER</strong>
</button>
<button type="button" class="o_mobile_search_button btn"
t-on-click="() => model.dispatch('clearQuery')"
>
<t>CLEAR</t>
</button>
</div>
<div class="o_mobile_search_content">
<SearchBar t-if="props.withSearchBar" fields="fields"/>
<!-- Additional content: searchview buttons(legacy) -->
<div class="o_mobile_search_filter o_search_options" t-ref="searchViewButtons">
<FilterMenu t-if="props.searchMenuTypes.includes('filter')"
fields="fields"
/>
<GroupByMenu t-if="props.searchMenuTypes.includes('groupBy')"
fields="fields"
/>
<ComparisonMenu t-if="props.searchMenuTypes.includes('comparison') and model.get('filters', f => f.type === 'comparison').length"/>
<FavoriteMenu t-if="props.searchMenuTypes.includes('favorite')"/>
</div>
</div>
<button type="button" class="btn btn-primary o_mobile_search_footer"
t-on-click="() => state.showMobileSearch = false"
>
<t>SEE RESULT</t>
</button>
</div>
</t>
<!-- Standard control panel display -->
<t t-else="">
<div class="o_cp_top">
<ol t-if="props.withBreadcrumbs and !state.showSearchBar" class="breadcrumb" role="navigation">
<t t-set="breadcrumb" t-value="props.breadcrumbs[props.breadcrumbs.length - 1]"/>
<li t-if="breadcrumb" class="breadcrumb-item o_back_button btn btn-secondary" accesskey="b"
t-on-click.prevent="() => this.trigger('breadcrumb_clicked', { controllerID: breadcrumb.controllerID })"
/>
<li class="breadcrumb-item active" t-esc="props.title"/>
</ol>
<!-- Additional content: searchview (legacy) -->
<div class="o_cp_searchview" t-att-class="{ o_searchview_quick: state.showSearchBar or !props.withBreadcrumbs }"
role="search" t-ref="searchView"
>
<div t-if="props.withSearchBar" class="o_searchview" role="search" aria-autocomplete="list">
<t t-if="!state.showMobileSearch">
<button type="button" class="o_enable_searchview btn btn-link"
t-if="props.withBreadcrumbs"
t-att-class="state.showSearchBar ? 'fa fa-arrow-left' : 'oi oi-search'"
t-on-click="() => state.showSearchBar = !state.showSearchBar"
/>
<t t-if="state.showSearchBar or !props.withBreadcrumbs">
<SearchBar t-if="props.withSearchBar" fields="fields"/>
<button type="button" class="o_toggle_searchview_full btn fa fa-filter"
t-on-click="() => state.showMobileSearch = !state.showMobileSearch"
/>
</t>
</t>
</div>
</div>
</div>
<div t-if="props.actionMenus and props.actionMenus.items and props.view and props.view.type == 'list'"
class="o_cp_bottom o_renderer_selection_banner align-items-center ml-n2">
<ActionMenus t-props="props.actionMenus" />
</div>
<div t-else="" class="o_cp_bottom">
<div class="o_cp_bottom_left">
<!-- Additional content: buttons (legacy) -->
<div class="o_cp_buttons" role="toolbar" aria-label="Control panel toolbar" t-ref="buttons">
<t t-slot="buttons"/>
</div>
</div>
<div class="o_cp_bottom_right">
<!-- Show "searchViewButtons" when custom CP have search view buttons but no SearchBar -->
<div class="btn-group o_search_options position-static" role="search" t-if="!props.withSearchBar" t-ref="searchViewButtons"/>
<button t-if="props.view and props.view.type === 'calendar'"
class="o_cp_today_button btn btn-sm btn-link"
t-on-click="() => this.trigger('today-button-click')"
>
<span class="fa-stack o_calendar_button_today">
<i class="fa fa-calendar-o fa-stack-2x" role="img" aria-label="Today" title="Today"/>
<strong class="o_calendar_text fa-stack-1x" t-esc="_getToday()"/>
</span>
</button>
<!-- Additional content: pager (legacy) -->
<div t-else="" class="o_cp_pager" role="search" t-ref="pager">
<Pager t-if="props.pager and props.pager.limit" t-props="props.pager"/>
</div>
<nav t-if="props.views and props.views.length gt 1" class="btn-group o_cp_switch_buttons"
t-att-class="{ show: state.showViewSwitcher }" role="toolbar" aria-label="View switcher"
>
<button type="button" class="btn btn-link"
t-attf-aria-expanded="{{ state.showViewSwitcher ? 'true' : 'false' }}"
t-on-click="() => state.showViewSwitcher = !state.showViewSwitcher"
>
<span class="fa-lg" t-att-class="props.views.find(v => v.type === props.view.type).icon"/>
</button>
<ul t-if="state.showViewSwitcher" class="dropdown-menu dropdown-menu-end list-inline"
t-att-class="{ show: state.showViewSwitcher }"
>
<li t-foreach="props.views" t-as="view" t-key="view.type">
<t t-call="web.ViewSwitcherButton"/>
</li>
</ul>
</nav>
<ActionMenus t-if="props.actionMenus and props.actionMenus.items" t-props="props.actionMenus"/>
</div>
</div>
</t>
</div>
</t>
</templates>

View File

@@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8" ?>
<template>
<button t-name="web_enterprise.open_studio_button" type="button" class ="dropdown-item-studio">
<i class="fa fa-plus"></i>
<span>Add Custom Field</span>
</button>
<div t-name="web_enterprise.install_web_studio" class="modal-studio">
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close" tabindex="-1"></button>
<h2 class="modal-title">Add new fields and much more with <b>Odoo Studio</b></h2>
<div class="o_video_embed">
<div class="ratio ratio-16x9">
<iframe class="embed-responsive-item" t-attf-src="https://www.youtube.com/embed/xCvFZrrQq7k?autoplay=1" frameborder="0" allowfullscreen="true"/>
</div>
</div>
<div class="o_install_studio_btn">
<button class="btn btn-primary btn-block o_install_studio"><b>Install Odoo Studio</b></button>
</div>
</div>
</template>

View File

@@ -0,0 +1,63 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates id="template" xml:space="preserve">
<t t-name="web_enterprise.Legacy.SearchPanel.Mobile" owl="1">
<!-- Mobile search -->
<t t-portal="'body'" t-if="state.showMobileSearch">
<div class="o_search_panel o_searchview o_mobile_search">
<div class="o_mobile_search_header">
<button type="button" class="o_mobile_search_button btn"
t-on-click="() => this.state.showMobileSearch = false"
>
<i class="fa fa-arrow-left"/>
<strong class="ml8">FILTER</strong>
</button>
</div>
<div class="o_mobile_search_content">
<t t-call="web.Legacy.SearchPanel"/>
</div>
<button type="button" class="btn btn-primary o_mobile_search_footer"
t-on-click.stop="() => this.state.showMobileSearch = false"
>
<t>SEE RESULT</t>
</button>
</div>
</t>
<!-- Summary header -->
<button
t-else=""
class="o_search_panel o_search_panel_summary btn w-100 overflow-visible"
t-on-click="() => this.state.showMobileSearch = true"
>
<t t-set="categories" t-value="_getCategorySelection()"/>
<t t-set="filters" t-value="_getFilterSelection()"/>
<div class="d-flex align-items-center">
<i class="fa fa-fw fa-filter"/>
<div class="o_search_panel_current_selection text-truncate ms-2 me-auto">
<t t-if="!categories.length and !filters.length">All</t>
<t t-else="">
<span t-foreach="categories" t-as="category" t-key="category.id"
class="o_search_panel_category me-1"
>
<i t-if="category.icon"
t-attf-class="o_search_panel_section_icon fa {{ category.icon }} me-1"
t-att-style="category.color and ('color: ' + category.color)"
/>
<t t-esc="category.values.join('/')"/>
</span>
<span t-foreach="filters" t-as="filter" t-key="filter.id"
class="o_search_panel_filter me-1"
>
<i t-if="filter.icon"
t-attf-class="o_search_panel_section_icon fa {{ filter.icon }} me-1"
t-att-style="filter.color and ('color: ' + filter.color)"
/>
<t t-esc="filter.values.join(', ')"/>
</span>
</t>
</div>
</div>
</button>
</t>
</templates>

View File

@@ -0,0 +1,38 @@
<template>
<t t-extend="CalendarView.buttons">
<t t-jquery=".o_calendar_navigation_buttons" t-operation="replace">
<t t-if="!isMobile">
<span class="o_calendar_navigation_buttons">
<t t-call="CalendarView.navigation_buttons" />
</span>
</t>
</t>
</t>
<div t-name="CalendarView.OtherCalendarMobile" class="o_other_calendar_panel d-flex align-items-center">
<i class="fa fa-fw fa-filter me-3" />
<div class="o_filter me-auto d-flex overflow-auto">
<t t-foreach="filters" t-as="filter" t-if="filter.values.length > 0">
<span class="text-nowrap fw-bold text-uppercase me-1" t-esc="filter.label" />
<span t-foreach="filter.values" t-as="values" class="d-flex align-items-center text-nowrap ms-1 me-2">
<span t-attf-class="#{typeof values.color === 'number' ? _.str.sprintf('o_color_%s', values.color) : 'o_color_1'}"></span>
<span class="ms-1 fw-bold text-nowrap" t-esc="values.label" />
</span>
</t>
</div>
<i t-if="isSidePanelVisible" class="fa fa-fw fa-caret-down ms-2"/>
<i t-else="" class="fa fa-fw fa-caret-left ms-2"/>
</div>
<t t-extend="CalendarView">
<t t-jquery=".o_calendar_sidebar_container .o_calendar_sidebar" t-operation="append">
<div class="o_view_nocontent d-none">
<div class="o_nocontent_help">
<p class="o_view_nocontent_neutral_face">No filter available</p>
</div>
</div>
</t>
</t>
</template>