Daily updates from Odoo
Sunday, September 21, 2025
1 change · 19.0
Resolved issues and error corrections
A bug prevented extra fees from being added when rented items were returned late. The fix ensures late return charges are calculated correctly, helping businesses recover agreed delay fees and keep rental invoicing accurate.
Original PR description
In [^1], during a small refactor of the `sale.order.is_late` method to only account for logistic delays rather than rental delays, the rental extra delay margin computation was moved to the `sale.order.line._generate_delay_line` method. However, the computation used the utility class `relativedelta` instead of `timedelta`, which transformed the final rental duration into a `relativedelta` object. This object internally stores second durations differently than a `timedelta`. While `timedelta` stores durations as `days` and remaining `seconds`, `relativedelta` splits the information into `days`, `hours`, `minutes`, etc. Since rental orders only account for hours, the `seconds` field was null, resulting in no extra delay fee being added to the order upon return. This commit fixes the issue by using `timedelta` as expected. [^1]: https://github.com/odoo/enterprise/pull/88689