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

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 @@
@include media-breakpoint-down(md) {
.o_control_panel {
.o_cp_today_button {
margin-left: auto;
}
.o_calendar_button_today {
font-size: 0.7em;
line-height: 1.9em;
> .o_calendar_text {
margin-top: 3px;
}
}
.o_renderer_selection_banner .o_cp_action_menus {
margin-left: auto;
}
}
}

View File

@@ -0,0 +1,36 @@
// = Enterprise dropdown customizations
// ----------------------------------------------------------------------------
.o_web_client.o_touch_device {
.dropdown-item > *:first-child {
&:before {
padding-top: 7.5px;
}
}
}
.dropdown {
&.show .dropdown-toggle.btn-light,
.dropdown-toggle.o_dropdown_active.btn-light {
&, &:hover, &:focus {
position: relative;
z-index: $zindex-dropdown + 1;
border-color: $dropdown-border-color;
border-bottom-color: $dropdown-bg;
background-color: $dropdown-bg;
box-shadow: none;
color: $dropdown-link-active-color;
}
+ .dropdown-menu {
margin-top: $dropdown-border-width * -1;
}
}
}
// = Enterprise jQueryUI dropdown
// ----------------------------------------------------------------------------
.ui-widget.ui-autocomplete {
border-top: $dropdown-border-width solid transparent;
}

View File

@@ -0,0 +1,85 @@
//
// This file regroups all the rules which apply to field widgets wherever they
// are in the DOM, in enterprise version.
//
//------------------------------------------------------------------------------
// Fields
//------------------------------------------------------------------------------
.o_field_widget.o_legacy_field_widget {
.o_field_many2one, .o_field_many2manytags {
.o_input_dropdown .o_input {
transform: translateY($input-border-width + $dropdown-border-width);
}
}
// HTML fields
&.o_field_html.o_field_html { // Make rules more important
.note-editor {
border-color: map-get($grays, '400');
}
.note-editable {
border-radius: 0;
}
:not(.oe-bordered-editor).note-editable {
border: 0;
padding: 3px 0 5px;
}
.note-toolbar.panel-heading, .popover-body {
border-color: map-get($grays, '400');
background: map-get($grays, '100');
.btn-secondary {
background: transparent;
border-color: transparent;
@include o-hover-text-color($body-color, $link-color);
}
.show .btn-secondary, .btn-secondary.active, .btn-secondary:focus {
background: white !important;
color: $body-color !important;
border-color: map-get($grays, '400');
}
.dropdown-menu {
margin-top: 0;
border-top: none;
border-color: map-get($grays, '400');
background-color: white;
box-shadow: none;
a {
background-color: transparent;
color: $body-color;
&:hover {
background-color: map-get($grays, '200');
}
}
&.show .btn-secondary, .btn-secondary.active, .btn-secondary:focus {
border: none;
}
}
.btn-group.show::after {
@include o-position-absolute(auto, 1px, -1px, 1px);
height: 1px;
background-color: white;
}
}
}
}
.o_field_many2one {
input[type="text"]:disabled{
background-color:#FFF;
}
}
.ui-autocomplete .ui-menu-item {
&.o_m2o_dropdown_option > a {
color: $o-brand-primary;
&.ui-state-active {
color: $o-brand-primary;
}
}
}

View File

@@ -0,0 +1,361 @@
.o_legacy_form_view {
@include media-breakpoint-up(md) {
display: flex;
flex-flow: column nowrap;
min-height: 100%;
}
.o_statusbar_status .o_arrow_button:not(.disabled) {
@extend .btn-light;
&:hover, &:focus, &:active {
&:after {
border-left-color: $o-btn-light-background-hover;
}
}
}
// Sheet
.o_form_sheet_bg {
flex: 1 0 auto;
background-color: $o-webclient-background-color;
border-bottom: 1px solid $border-color;
> .o_form_sheet {
@include make-container();
@include make-container-max-widths();
background-color: $o-view-background-color;
border: 1px solid $border-color;
box-shadow: 0 5px 20px -15px rgba(#000, 0.4);
margin: $o-sheet-vpadding*0.2 auto;
@include media-breakpoint-up(md) {
margin: $o-sheet-vpadding*0.5 auto;
}
padding: $o-sheet-vpadding;
@include o-form-sheet-inner-right-padding;
@include o-form-sheet-inner-left-padding;
// Selection
> .o_selection {
float: right;
}
}
}
// Fields
.o_td_label .o_form_label:not(.o_status), .o_checkbox_optional_field > .o_form_label {
min-height: 23px;
}
td:not(.o_field_cell) .o_form_uri > span:first-child {
display: inline-block;
padding: 1px 0;
margin-bottom: 1px;
}
// Title & avatar
.oe_title {
color: $headings-color;
@include media-breakpoint-up(vsm, $o-extra-grid-breakpoints) {
padding-right: $o-innergroup-rpadding;
}
h1 {
min-height: 55px;
}
h2 {
min-height: 42px;
}
}
.oe_avatar + .oe_title {
padding-right: $o-avatar-size + 10;
}
// Groups
.o_group {
// all groups take width 100% in mobile
@mixin o-generate-groups($n) {
@for $i from 1 through $n {
.o_group_col_#{$i} {
@include media-breakpoint-down(lg) {
width: 100%;
}
}
}
}
@include o-generate-groups($o-form-group-cols);
&.o_inner_group {
> tbody > tr > td {
padding: 0 $o-innergroup-rpadding 0 0;
}
}
@include media-breakpoint-up(vsm, $o-extra-grid-breakpoints) {
.o_field_widget {
&.o_text_overflow {
width: 1px!important; // hack to make the table layout believe it is a small element (so that the table does not grow too much) ...
min-width: 100%; // ... but in fact it takes the whole table space
}
}
.o_form_label {
margin-bottom: $o-form-spacing-unit;
}
}
@include media-breakpoint-down(lg) {
&.o_label_nowrap .o_form_label {
white-space: normal;
}
}
}
// Labels
.o_form_label {
&.o_form_label_empty, &.o_form_label_false, &.o_form_label_readonly {
opacity: 0.5;
font-weight: $font-weight-normal;
}
@include media-breakpoint-down(md) {
font-size: $o-font-size-base-touch;
}
}
// Notebooks
.o_notebook {
> .o_notebook_headers {
@include o-form-sheet-negative-margin;
> .nav.nav-tabs {
@include o-form-sheet-inner-left-padding;
> .nav-item {
white-space: nowrap;
}
}
}
> .tab-content {
border-bottom: 1px solid map-get($grays, '400');
> .tab-pane {
> :first-child {
// Reset margin to 0 and use tab-pane's padding
// to define the distance between panel and content
margin-top: 0;
// These elements will appear attached to the tabs
&.o_field_html {
border: none;
.note-editor.panel {
border: none;
}
.note-toolbar.panel-heading {
@include o-form-sheet-inner-left-padding;
@include o-form-sheet-inner-right-padding;
border-top: none;
padding-top: 0;
background: white;
}
.note-editing-area, .o_readonly {
padding: $card-spacer-y $card-spacer-x;
@include o-form-sheet-inner-left-padding;
@include o-form-sheet-inner-right-padding;
}
.note-editable.panel-body {
padding: 0;
}
// If immediatly followed by an .clearfix element, the note-editor it's the 'only'
// tab's element. Reset margins to push the bar at the bottom.
+ .clearfix:last-child {
margin-bottom: -$o-horizontal-padding - $o-sheet-vpadding - $o-form-spacing-unit;
}
}
// Full width on first x2many or on second x2many if first is invisible
&.o_field_x2many.o_field_x2many_list,
&.o_field_widget.o_invisible_modifier + .o_field_x2many.o_field_x2many_list {
display: block;
width: auto;
@include o-form-sheet-negative-margin;
margin-top: -$o-horizontal-padding;
// use original padding-left for handle cell in editable list
tr > :first-child.o_handle_cell {
padding-left: 0.3rem;
}
tr > :first-child {
@include o-form-sheet-inner-left-padding;
}
tr > :last-child {
@include o-form-sheet-inner-right-padding;
}
}
}
}
}
&:last-child > .tab-content {
border-bottom: none;
}
}
// Notebooks inside form without sheet tag
&.o_form_nosheet .o_notebook {
> .o_notebook_headers {
@include o-form-nosheet-negative-margin;
> .nav.nav-tabs {
@include o-form-nosheet-inner-left-padding;
}
}
> .tab-content > .tab-pane > :first-child {
// These elements will appear attached to the tabs
&.o_field_x2many.o_field_x2many_list {
@include o-form-nosheet-negative-margin;
}
}
}
// Notebooks for small screen
@include media-breakpoint-down(md) {
.o_notebook .o_notebook_headers {
overflow-x: auto;
&::-webkit-scrollbar {
display: none;
}
.nav.nav-tabs {
flex-flow: row nowrap;
}
}
.o_cp_buttons {
width: 100%;
div, .o-kanban-button-new {
width: 100%;
}
}
}
// One2Many List views
.o_field_widget .o_list_table {
&.table-striped {
> tbody {
> tr:not(.o_data_row) > td {
border-top: none;
}
}
// Show "border" if tfoot has content only
> tfoot > tr {
box-shadow: inset 0 1px 0 map-get($grays, '300');
> td {
border:none;
&:empty {
padding: 0;
}
}
}
}
}
// Translate icon
.o_field_translate {
padding-right: 0;
}
// Specific style classes
.o_group.o_inner_group.oe_subtotal_footer {
border-top: 1px solid map-get($grays, '300');
.oe_subtotal_footer_separator {
border-top: 1px solid map-get($grays, '300');
}
}
// Status Bar
.o_form_statusbar {
> .o_statusbar_status > .o_arrow_button {
font-weight: $font-weight-bold;
// Last element at the right should respect overall padding
&:first-of-type {
padding-right: $o-horizontal-padding;
}
}
// Match the status bar button styles with rest of the buttons in touch device
@include media-breakpoint-down(md) {
> .o_statusbar_buttons > .btn {
margin: 0;
padding: $o-touch-btn-padding;
}
}
}
&.o_xxl_form_view {
flex-flow: row nowrap;
height: 100%;
> .o_form_sheet_bg {
flex: 1 1 auto; // Side chatter is disabled if this has to shrink but this was added for safety
width: $o-form-sheet-min-width + 2 * $o-horizontal-padding;
// max-width: map-get($container-max-widths, xl) + 2 * $o-horizontal-padding; // would be logical but breaks no-chatter form views
padding: 0 $o-horizontal-padding;
overflow: auto;
border-bottom: none;
> .o_form_statusbar, > .alert {
margin-left: -$o-horizontal-padding;
margin-right: -$o-horizontal-padding;
}
> .o_form_sheet {
width: 100%;
max-width: map-get($container-max-widths, xl);
}
}
}
}
// Overriden style when form view in modal
.modal .modal-dialog {
.o_legacy_form_view {
@include media-breakpoint-down(lg) {
.o_group.o_inner_group > tbody > tr > td.o_td_label {
min-width: 100px;
}
}
}
&.modal-sm .o_legacy_form_view {
.o_group {
@include form-break-table;
}
}
}
// XXS form view specific rules
.o_legacy_form_view.o_xxs_form_view {
.o_group {
// Target XXS form view on mobile devices in portrait mode
@include media-breakpoint-down(md) {
&.o_inner_group:not(.oe_subtotal_footer) > tbody > tr > td {
> .o_field_widget {
margin-bottom: $o-form-spacing-unit * 4;
}
}
}
.o_td_label .o_form_label {
font-weight: $font-weight-normal;
}
}
.o_form_label {
margin-top: 3px;
font-size: $o-label-font-size-factor * $o-font-size-base-touch;
font-weight: $font-weight-normal;
color: $o-brand-secondary;
}
}

View File

@@ -0,0 +1,87 @@
@include media-breakpoint-down(md) {
.o_legacy_form_view {
.o_form_sheet {
padding: 16px;
}
.o_form_sheet_bg > .o_form_sheet {
border: 0;
margin: 0 auto;
}
.o_form_label:not(.o_invisible_modifier) {
padding-bottom: 4px;
}
.o_group {
margin-top: 0;
.o_inner_group {
margin-bottom: 0 !important;
div[name="carrier_selection"] {
> div:not(.alert) {
display: inline-flex;
align-items: baseline;
justify-content: space-evenly;
&:first-child {
width: 100%;
.o_field_widget {
width: 100% !important;
}
.text-success {
margin: 2px 10px;
}
}
}
}
}
}
.o_notebook {
> .tab-content {
> .tab-pane.active {
.oe_subtotal_footer {
width: 100% !important;
tr {
> td {
width: 35% !important;
&:first-child {
width: 65% !important;
}
}
}
}
}
}
}
.btn-add-record {
margin-left: 0 !important;
margin-bottom: 10px !important;
}
button.btn.o_external_button.fa {
padding-right: 0 !important;
}
.oe_inline.o_field_widget.o_field_many2one {
width: 100% !important;
}
}
// change the dropdown ui for mobile website
.ui-autocomplete.ui-front.ui-menu.ui-widget.ui-widget-content {
width: 100% !important;
height: 80%;
max-height: fit-content;
left: 0 !important;
overflow-y: auto;
}
}

View File

@@ -0,0 +1,11 @@
.o_legacy_kanban_view {
.o_column_quick_create .o_kanban_quick_create {
input {
&, &:focus, &:hover {
background: transparent;
border-bottom: 1px solid map-get($grays, '600');
}
}
}
}

View File

@@ -0,0 +1,209 @@
// ------- Provide room for the caret -------
@mixin o-list-view-sortable-caret-padding($base-x: $table-cell-padding-x, $ratio: 1) {
> thead > tr > th.o_column_sortable:not(:empty) {
padding-right: ceil((($base-x * $ratio) / 1rem) * $o-root-font-size) + 5px; // FIXME
// Extra room when needed
&:last-child {
padding-right: ceil((($base-x * $ratio) / 1rem) * $o-root-font-size) + 5px + $o-horizontal-padding!important; // FIXME
}
}
}
// ------- Define paddings independently for each table component -------
@mixin o-list-view-full-width-padding($base-x: $table-cell-padding-x, $base-y: $table-cell-padding-y, $ratio: 1) {
$body-padding: floor((($base-y * $ratio * 0.7) / 1rem) * $o-root-font-size); // FIXME
> thead > tr > :not(:empty),
.o_optional_columns_dropdown_toggle {
padding: ceil((($base-y * $ratio) / 1rem) * $o-root-font-size + 4px) 4px; // FIXME
}
> tbody > tr:not(.o_list_table_grouped) > td {
padding: $body-padding 4px;
}
> tfoot > tr > :not(:empty) {
padding: ceil((($base-y * $ratio) / 1rem) * $o-root-font-size + 2px) 4px; // FIXME
}
@include o-list-view-sortable-caret-padding($base-x, $ratio);
// ------- Make full-width tables to fit odoo layout -------
> thead, > tbody, > tfoot {
> tr > * {
&:first-child {
padding-left: $o-horizontal-padding!important;
}
&:last-child {
padding-right: $o-horizontal-padding!important;
}
&.o_list_record_selector {
padding-right: 5px!important;
}
}
}
}
// Common style for list views (also inside form views)
.o_legacy_list_view .o_list_table {
// We need this to be collapse because we want to add a border on the rows
// for sale order/invoice lines of type section.
border-collapse: collapse;
.o_column_sortable:not(:empty)::after {
position: absolute;
}
@include o-list-view-sortable-caret-padding;
// ------- Force empty cells' padding -------
> thead, > tbody, > tfoot {
> tr > :empty {
padding: 0;
&::after {
// ... end hide caret icon
display: none;
}
}
}
// ------- Increase thead and tfoot vertical padding -------
> thead, > tfoot {
> tr > *,
+ .o_optional_columns_dropdown_toggle {
// List views always have the table-sm class, maybe we should
// remove it (and consider it does not exist) and change the default
// table paddings
padding-top: $table-cell-padding-y-sm * 1.25;
padding-bottom: $table-cell-padding-y-sm * 1.25;
}
}
// ------- Style thead -------
> thead {
background-color: white;
border: none;
th {
font-weight: $font-weight-bold;
}
> tr:first-child > th {
border: none;
}
}
> tfoot {
border-bottom: none;
border-top: none;
}
// ------- Decrease table's inner content "visual depth" -------
tbody:first-of-type > tr:first-child:not(.o_group_header) {
box-shadow: inset 0px 5px 10px -4px rgba(black, 0.1);
}
// ------- Force progress bars to respect table's layout -------
.o_progressbar_cell {
.o_progressbar {
display: table-row;
> div {
width: 100%;
display: table-cell;
}
.o_progressbar_value {
width: 45px;
min-width: 45px;
}
}
}
// ------- Grouped list views -------
&.o_list_table_grouped {
> tbody > tr.o_group_header {
background-color: rgba(map-get($grays, '200'), 0.9);
&.o_group_has_content {
@include o-hover-text-color($gray-600, map-get($theme-colors, 'primary'));
&.o_group_open {
font-weight: bold;
@include o-hover-text-color($headings-color, map-get($theme-colors, 'primary'));
}
}
&, &.o_group_has_content {
&:focus-within {
color: $o-brand-primary;
}
}
}
// Disable striped design for grouped content
&.table-striped > tbody + tbody > tr:not(.o_group_header):nth-of-type(odd) {
background-color: $table-bg;
}
}
.o_data_row:not(.o_selected_row) > .o_data_cell:not(.o_readonly_modifier):not(:last-child) {
border-right: 1px solid transparent;
}
.o_data_row.o_selected_row > .o_data_cell {
border-bottom: 1px solid $table-border-color;
&.o_required_modifier:not(.o_readonly_modifier) {
border-bottom: 1px solid black;
&.o_invalid_cell {
border-bottom: 1px solid red;
}
}
&:not(.o_readonly_modifier):not(:last-child) {
border-right: 1px solid $table-border-color;
}
}
.o_data_row.o_selected_row > .o_list_record_remove {
border-bottom: 1px solid $table-border-color;
}
}
// Standalone list views
.o_content > .o_legacy_list_view > .table-responsive > .table {
// List views always have the table-sm class, maybe we should remove
// it (and consider it does not exist) and change the default table paddings
@include o-list-view-full-width-padding($base-x: $table-cell-padding-x-sm, $base-y: $table-cell-padding-y-sm, $ratio: 2);
&:not(.o_list_table_grouped) {
@include media-breakpoint-up(xl) {
@include o-list-view-full-width-padding($base-x: $table-cell-padding-x-sm, $base-y: $table-cell-padding-y-sm, $ratio: 2.5);
}
}
}
// Restore on mobile the scroll on list view
@include media-breakpoint-down(md) {
.o_view_controller > .o_content > .o_legacy_list_view > .table-responsive {
overflow: auto;
.o_list_table tr:focus-within {
background-color: inherit;
}
}
.o_data_row_selected {
user-select: none; // Prevent text selection when editing
> td {
border-top-color: $primary;
border-bottom: 1px solid $primary;
background-color: rgba($primary, .1);
}
}
.o_web_client.o_touch_device .o_content table.o_list_table.table tr > {
.o_list_record_selector:first-child {
display: none;
// first-child will be hidden so add left padding to second child
& + * {
padding-left: $o-horizontal-padding!important;
}
}
}
}

View File

@@ -0,0 +1,61 @@
@include media-breakpoint-down(md) {
.modal {
.modal-content {
.modal-body.o_act_window .o_group.o_inner_group > tbody > tr > td:not(.o_td_label) {
width: 100% !important;
> * {
width: 100%;
}
}
.modal-footer {
.btn {
width: 45%;
text-overflow: ellipsis;
white-space: inherit;
}
}
}
&.o_modal_full {
.modal-content {
.modal-header {
align-items: center;
height: $o-navbar-height;
padding: 0 1rem;
.btn {
color: white;
background-color: transparent;
border-color: transparent;
&, .btn-sm {
padding: 14px; // according to the padding for touch device
}
&.fa {
padding: 10px; // according to the padding for touch device
}
}
}
.modal-body {
.o_form_view .o_form_sheet_bg {
&, & > .o_form_sheet {
border-bottom: 0;
border-top: 0;
}
}
}
.modal-footer {
@include o-webclient-padding($top: 1rem, $bottom: 0.5rem);
box-shadow: 0 1rem 2rem black;
z-index: 0;
}
}
}
}
}

View File

@@ -0,0 +1,29 @@
.dropdown-item-studio {
@extend .dropdown-item;
text-align: left;
}
.dropdown-menu > hr {
margin-top: 6px;
margin-bottom: 6px;
}
.modal-studio {
.modal-title {
text-align: center;
color: #666666;
padding-bottom: .5rem;
}
.o_install_studio_btn {
display: flex;
align-items: center;
justify-content: center;
margin: 1rem 0 0 0;
button {
line-height: 1.5;
font-size: 1.5rem;
}
}
}

View File

@@ -0,0 +1,6 @@
// Disable the selection of element
// This allow to avoid the show "mobile menu" on long press to text on Mobile
// and so avoid JS preventDefault
.o_user_select_none {
user-select: none;
}