[IMP] web,*: remove legacy o_field_many2manytags class & styles

task-3439226

Part-of: odoo/odoo#133289
This commit is contained in:
Pierre Paridans
2023-08-31 06:15:55 +00:00
parent 132e9f72ed
commit 6c2764a753
10 changed files with 6 additions and 189 deletions
+2 -2
View File
@@ -68,7 +68,7 @@
Tags:
<div class="ms-2 d-flex flex-row">
<div t-foreach="lead.tag_ids" t-as="tag" t-esc="tag.name"
t-attf-class="badge rounded-pill o_tag_color_#{tag.color} d-inline-block"/>
t-attf-class="badge rounded-pill o_tag o_tag_color_#{tag.color} d-inline-block"/>
</div>
</div>
<div t-if="lead.user_id" class="mt-3">
@@ -168,7 +168,7 @@
<div t-if="'values' in property"
class="ms-2 d-flex flex-row"> <!-- Tags -->
<div t-foreach="property['values']" t-as="tag" t-esc="tag['name']"
t-attf-class="badge rounded-pill o_tag_color_#{tag.get('color', 0)} d-inline-block me-2"/>
t-attf-class="badge rounded-pill o_tag o_tag_color_#{tag.get('color', 0)} d-inline-block me-2"/>
</div>
<div t-else="" class="ms-2" t-esc="property['value']"/>
</li>
@@ -152,9 +152,9 @@
<b class="o_kanban_record_title"><field name="name"/></b>
<field class="o_text_overflow" name="event_id" invisible="context.get('default_event_id')" readonly="state != 'draft'" />
<span class="o_text_overflow" invisible="not partner_id">Booked by <field name="partner_id" /></span>
<div id="event_ticket_id" class="o_field_many2manytags o_field_widget d-flex mt-auto">
<div id="event_ticket_id" class="o_field_many2many_tags o_field_widget d-flex mt-auto">
<t t-if="record.event_ticket_id.raw_value">
<div t-attf-class="badge rounded-pill o_tag_color_#{(record.event_ticket_id.raw_value % 11) + 1}" >
<div t-attf-class="badge rounded-pill o_tag o_tag_color_#{(record.event_ticket_id.raw_value % 11) + 1}" >
<b><span class="o_badge_text o_text_overflow"><t t-out="record.event_ticket_id.value"/></span></b>
</div>
</t>
@@ -37,10 +37,6 @@
cursor: pointer;
}
.o_kanban_project_tasks .o_kanban_renderer .o_field_many2manytags{
margin: 0px;
}
.o_project_m2m_avatar {
width: 20px;
height: 20px;
@@ -72,7 +72,6 @@
width: 100%;
}
.o_field_many2manytags,
.date_filter_values {
display: flex;
gap: map-get($spacers, 2);
+1 -146
View File
@@ -98,7 +98,7 @@
}
// Flex fields (inline)
&.o_field_many2one, &.o_field_radio, &.o_field_many2manytags, &.o_field_percent_pie, &.o_field_monetary, &.o_field_binary_file, &.o_field_float_percentage {
&.o_field_many2one, &.o_field_radio, &.o_field_percent_pie, &.o_field_monetary, &.o_field_binary_file, &.o_field_float_percentage {
display: inline-flex;
> span, > button {
flex: 0 0 auto;
@@ -153,151 +153,6 @@
padding-bottom: 0;
}
// Many2many tags
&.o_field_many2manytags {
flex-flow: row wrap;
align-items: stretch;
max-width: 100%;
> .o_field_widget {
flex: 1 0 100px;
position: initial;
max-width: 100%;
}
.o_field_many2one_selection, .o_input {
height: 100%;
}
.badge {
flex: 0 0 auto;
margin: 1px 2px 1px 0;
border: 0;
font-size: 12px;
user-select: none;
display: flex;
max-width: 100%;
&.dropdown {
cursor: pointer;
}
a {
color: inherit;
}
.o_badge_text {
@include o-text-overflow(inline-block);
max-width: 200px;
color: inherit;
line-height: 1.1;
}
.o_delete {
color: inherit;
cursor: pointer;
padding-left: 4px;
}
}
// o-kanban-colorpicker without customizing
// '&:first-child > a::before' (transparent red-crossed colorpick)
@mixin o-tag-colorpicker {
$o-tag-colorpicker-padding-right: $o-dropdown-hpadding - 2 * 5px; // FIXME was $o-kanban-inner-hmargin before scss convertion
max-width: 100%;
padding: 3px $o-tag-colorpicker-padding-right 3px $o-dropdown-hpadding;
> li {
display: inline-block;
margin: 5px 5px 0 0; // FIXME was $o-kanban-inner-hmargin before scss convertion
border: 1px solid white;
box-shadow: 0 0 0 1px map-get($grays, '300');
> a {
display: block;
&::after {
content: "";
display: block;
width: 20px;
height: 15px;
}
}
&:last-of-type {
box-shadow: 0 0 0 0px white; // remove grey border on hide in kanban
color: $o-main-text-color;
}
}
}
.tagcolor_dropdown_menu {
min-width: 150px; // down from 160px of .dropdown-menu
margin-right: 0px; // cancel right margin of .dropdown-menu
}
.o_colorpicker > ul {
@include o-tag-colorpicker;
white-space: normal;
li > .o_hide_in_kanban label {
line-height: $o-line-height-base;
}
}
.o_tag_error {
box-shadow: inset 0 0 0 2px #FF0000;
.o_delete {
color: #FF0000;
}
}
// Many2many tags avatar
&.avatar {
.badge {
align-items: center;
padding: 0;
padding-right: 0.6rem;
img {
height: 1.4em;
width: 1.4em;
object-fit: cover;
}
.o_badge_text, .o_delete {
padding-top: 0.25em;
padding-bottom: 0.25em;
}
.o_tag_badge_text {
padding-left:2px;
}
}
}
&.o_field_many2manytags_multi {
margin-bottom: 0px;
> span {
display: inline-block;
}
.o_m2m_avatar, .o_m2m_avatar_empty {
width: 20px;
height: 20px;
margin-left: 0px;
}
.o_m2m_avatar_empty {
background-color: #dee2e6;
vertical-align: bottom;
}
&.avatar.o_clickable_m2x_avatar {
img.o_m2m_avatar {
margin-right: 0px;
object-fit: cover;
}
}
}
}
// Stars
&.o_priority, & .o_priority {
display: inline-block;
@@ -8,17 +8,6 @@
//------------------------------------------------------------------------------
.o_field_widget {
&.o_field_many2manytags {
.o_dropdown_button {
top: 0;
right: 0;
}
&.avatar .o_dropdown_button {
top: $o-input-padding-y;
}
}
// Many2one
&.o_field_many2one .o_external_button {
flex: 0 0 auto;
@@ -30,10 +30,6 @@
width: 50%;
}
}
&.o_field_many2manytags > .o_field_widget {
flex: 1 0 50px;
}
}
button.btn-link:first-child {
@@ -341,13 +341,6 @@
.o_tag {
--Tag-max-width: MAX(200px, 100%);
--Tag-font-size: #{$o-font-size-base-smaller};
@for $size from 1 through length($o-colors) {
// Note: the first color is supposed to be invisible if there is a color
// field but it is used as a default color when there is no color field
&.o_tag_color_#{$size - 1} span {
background-color: nth($o-colors, $size);
}
}
}
}
@@ -292,13 +292,6 @@
pointer-events: auto;
}
}
&.o_many2many_avatar_user_cell {
.o_field_many2manytags {
> span {
margin-right: 2px;
}
}
}
}
.o_data_row:not(.o_selected_row) {
@@ -342,10 +335,6 @@
width: 0; // override width: 100px and let flex makes this input grow
margin: 0 4px;
}
&.o_field_many2manytags > .o_field_many2one {
// reduce basis to prevent many2one input from going to the next line to often
flex-basis: 40px;
}
.o_field_many2one_avatar {
display: flex;
}
@@ -83,7 +83,7 @@ export function getConsumeEventType(element, runCommand) {
const tag = tagName.toLowerCase();
// Many2one
if (classList.contains("o_field_many2one") || classList.contains("o_field_many2manytags")) {
if (classList.contains("o_field_many2one")) {
return "autocompleteselect";
}