Wednesday, June 5, 2024
2 changes · saas-17.1
Resolved issues and error corrections
Project updates now avoid tiny currency rounding differences when calculating expenses to bill. This prevents occasional incorrect margin percentages, helping users see more reliable profitability figures for reinvoiced expenses.
Original PR description
Steps to reproduce: ------------- - Install project_sale_expenses and timesheet_grid - Create a new product - Can be Expensed. - Re-Invoice Expenses set to Sales price - Set sales price and cost to…
Steps to reproduce:
-------------
- Install project_sale_expenses and timesheet_grid
- Create a new product
- Can be Expensed.
- Re-Invoice Expenses set to Sales price
- Set sales price and cost to 957
- Create a project(service type)
- Create a sale order with the service type product
and confirm
- Go to the expense App
- Create a expense:
- Choose a category (the product with Expensed).
- Customer to Reinvoice: Select the above sale order.
- Expense posted and approved
- Go to project and open project update
- Check the margin percentage to bill.
Issue:
-------------
Sometimes, the margin percentage of the 'to bill' item becomes unexpectedly
incorrect.
Cause:
-------------
In the _get_expenses_profitability_items function of project_sale_expense,
rounding during currency conversion may lead to minor variations
(e.g., 832.17 to 832.1700000000001)for some values, not all. These differences
accumulate when subtracting untaxed amounts from amount_to_bill, resulting
in a residual value (e.g., 1.1368683772161603e-13) instead of zero, causing
unexpected margin percentages.
Solution :
----------------
The _convert method will not round the value since we passed the round=False in the _convert method.
task-3706741This change adds test coverage to ensure appointment resource time off keeps the end time selected by the user instead of automatically changing it to the end of the day. It supports a related fix that limits that automatic end-of-day behavior to public holidays, reducing scheduling errors in appointments.
Original PR description
# BEWARE: This PR depends on another PR! This is a test that will pass only after https://github.com/odoo/odoo/pull/160665 is merged **In effect this test will fail until the other PR is merged** ##…
# BEWARE: This PR depends on another PR! This is a test that will pass only after https://github.com/odoo/odoo/pull/160665 is merged **In effect this test will fail until the other PR is merged** ## Description [FIX] appointment_hr: TEST Narrow date_to end-time behavior to public holidays This is a test to the related a fix in the community branch. [Preserving original commit message from the fix] Previously, the end-time of 'date_to' for leave requests was consistently set to the end of the day (i.e., 23:59), which was only desirable for public holidays (ref.1). However, this caused undesired behavior in other modules, such as the appointment module. The fix restricts the setting of the end-time of 'date_to' to public holidays, ensuring compatibility and consistency across modules. [ref.1] [IMP] resource: compute date_to for better ux e0f3dd9e01d91896f1c00fb5cb3ce5c821912d03 https://github.com/odoo/odoo/pull/115688 [Reproduce] - Install appointment - Create New Resource Time Off (Appointments/ Configuration/ Resource Leaves) - change time of "End Date" - BUG: time sets itself to 23:59 opw-3841275a