[IMP] web: truncate date in list view

When the width of the column is too small to fit the date, the date was
cut by the following column instead of having its content
truncated. This could be seen on the "Creation date" in the list view of
Sales Quotations.

task-3463329
part of task-3326263

closes odoo/odoo#144039

X-original-commit: b9675c38b49d99e00e401dbdb90445354aab43c3
Related: odoo/enterprise#51684
Signed-off-by: Pierre Paridans (app) <app@odoo.com>
This commit is contained in:
Elisabeth Dickinson
2023-12-04 11:58:16 +00:00
committed by Pierre Paridans
parent 38dfa6ca27
commit 28b0168463
3 changed files with 10 additions and 10 deletions
@@ -5,7 +5,7 @@
<div class="d-flex gap-2 align-items-center" t-ref="root">
<!-- Start date -->
<t t-if="props.readonly">
<t t-esc="getFormattedValue(0)" />
<span class="text-truncate" t-esc="getFormattedValue(0)" />
</t>
<t t-elif="!props.required and isEmpty(startDateField) and !isEmpty(endDateField)">
<button
@@ -42,7 +42,7 @@
<!-- End date -->
<t t-if="endDateField">
<t t-if="props.readonly">
<t t-esc="getFormattedValue(1)" />
<span class="text-truncate" t-esc="getFormattedValue(1)" />
</t>
<t t-elif="!props.required and !isEmpty(startDateField) and isEmpty(endDateField)">
<button
@@ -1126,10 +1126,10 @@ QUnit.module("Fields", (hooks) => {
.map((node) => {
if (node === arrowIcon) {
return "->";
} else if (node.nodeType === 3) {
} else if (node.nodeType === Node.TEXT_NODE) {
return node.nodeValue.trim();
} else {
return false;
return node.innerText?.trim();
}
})
.filter(Boolean);
@@ -1157,10 +1157,10 @@ QUnit.module("Fields", (hooks) => {
.map((node) => {
if (node === arrowIcon) {
return "->";
} else if (node.nodeType === 3) {
} else if (node.nodeType === Node.TEXT_NODE) {
return node.nodeValue.trim();
} else {
return false;
return node.innerText?.trim();
}
})
.filter(Boolean);
@@ -11572,10 +11572,10 @@ QUnit.module("Views", (hooks) => {
.map((node) => {
if (node === arrowIcon) {
return "->";
} else if (node.nodeType === 3) {
} else if (node.nodeType === Node.TEXT_NODE) {
return node.nodeValue.trim();
} else {
return false;
return node.innerText?.trim();
}
})
.filter(Boolean);
@@ -11603,10 +11603,10 @@ QUnit.module("Views", (hooks) => {
.map((node) => {
if (node === arrowIcon) {
return "->";
} else if (node.nodeType === 3) {
} else if (node.nodeType === Node.TEXT_NODE) {
return node.nodeValue.trim();
} else {
return false;
return node.innerText?.trim();
}
})
.filter(Boolean);