Monday, May 19, 2025
3 changes · saas-17.4
Resolved issues and error corrections
List views now calculate the needed column width for dates and times based on the user’s language and font, instead of relying on English-only assumptions. This prevents date and time values from being cut off in languages with longer formats, while allowing some date-only columns to use less space.
Original PR description
In list views, we have a custom logic for column widths which aims at optimizing as much as possible the available space, and freezing the table such that it doesn't flicker upon user interaction…
In list views, we have a custom logic for column widths which aims at optimizing as much as possible the available space, and freezing the table such that it doesn't flicker upon user interaction (like editing, adding records, browsing through pages...). This logic defines, for some field types, the exact width that values need to be properly displayed, especially for dates and datetimes for which we know upfront the format, i.e. the length of values. However, before this commit, the logic was incorrect. It didn't take into the account the fact that date and time formats are language dependant. It assumed that the required space for the english formats (+ a bit of security margin) was enough. Moreover, the fonts may obviously has an impact as well (some fonts requiring more space to display the same text, than others). As a consequence, on macos and, for instance, in deutch, date and datetime values were trimmed, which is something we never want: dates and datetimes should always be fully displayed. This is even worse in some languages, like arabic, basque or chinese, in which the month and/or the day of week is displayed in letters. This commit comes with a more elaborated solution to deal with those variable date and time formats + fonts. We no longer hardcode the ideal widths of dates and datetimes, but instead compute it (lazily) once, by rendering values in the DOM. This commit also improves the datetime and daterange cases with option "show_time" set to false: in that case, we know those fields only require the width of date values, not datetime, so we can shrink their columns. Task~4801116
Publishing shifts from the Planning Gantt view now correctly includes the full selected period, including the last day. This prevents published schedules from accidentally ending at the start of the final day, reducing confusion and manual correction for planners.
Original PR description
**Steps to reproduce:** - Install Planning app - Set the type of view to Gantt - (Create a shift if there is none) - Click on `Publish` button - The period end date doesn't take the last day into…
**Steps to reproduce:**
- Install Planning app
- Set the type of view to Gantt
- (Create a shift if there is none)
- Click on `Publish` button
- The period end date doesn't take the last day into account (time is 00:00)
**Issue:**
Gantt model default `_buildMetaData` computation behavior was changed multiple times during previous refactoring:
Previously used:
```
export function computeRange(scale, date) {
let start = date;
let end = date;
if (scale === "week") {
// startOf("week") does not depend on locale and will always give the
// "Monday" of the week... (ISO standard)
const { weekStart } = localization;
const weekday = start.weekday < weekStart ? weekStart - 7 : weekStart;
start = start.set({ weekday }).startOf("day");
end = start.plus({ weeks: 1, days: -1 }).endOf("day");
} else {
start = start.startOf(scale);
end = end.endOf(scale);
}
return { start, end };
}
```
Which became:
```
export function getRangeFromDate(rangeId, date) {
const startDate = localStartOf(date, rangeId);
const stopDate = startDate.plus({ [rangeId]: 1 }).minus({ day: 1 });
return { focusDate: date, startDate, stopDate, rangeId };
}
```
**Fix:**
Added `localStartOf` function in the context setup of PlanningGanttModel.
To avoid overwriting current changes for other modules (which could be intended), this was done instead of :
```
export function getRangeFromDate(rangeId, date) {
const startDate = localStartOf(date, rangeId);
const stopDate = localEndOf(startDate, rangeId);
return { focusDate: date, startDate, stopDate, rangeId };
}
```
related commits:
https://github.com/odoo/enterprise/commit/d18639785e622d97102227103d62ddb3a2716be6 https://github.com/odoo/enterprise/commit/c175a848369057cc69596737dcd9d21dd24c9d5c
opw-4580458When a field service task is marked as under warranty, parts tracked by lot now create sales order lines with a zero price. This prevents customers from being billed incorrectly for warranty-covered inventory items.
Original PR description
Steps to reproduce: - Install Stock and Field Service apps. - Create a product that tracks inventory by lot. - Add some on-hand quantity with a created lot. - In Field Service, create a task with `under_warranty` checked. - Add the created product to the task. Issue: - A sale order is generated with order lines at the product's price. - The price should be 0 since the customer should not be charged. Fix: - Ensure the sale order line price is set to 0 when `under_warranty` is checked in the _generate_lot() which is called on adding product tracked by lot. opw-4648542 opw-4646960