[FIX] hr_expense: add extra case for unit_amount compute with attachment
Reproduction: 1. Install Expense, make sure in the product list of test data, we have Expenses(without cost e.g. 0.00) and Daily Allowance(with cost e.g. 100) 2. Create a new expense with the product Daily Allowance, and attach a file to the attachment, save expense 3. Edit the created expense, change the product to Expenses and save 4. The UI is not changed and can’t edit the total amount of the expense Reason: the recomputation of product_has_cost is based on the unit_amount. However, when there’s an attachment, the recomputation of unit_amount doesn’t consider the case when the product is changed to one without standard_price (unit_amount). Fix: add a condition to make sure when the product is changed from one with standard_price to one without standard_price, the unit_amount of expense is recomputed correctly opw-3051726 Related commit: https://github.com/odoo-dev/odoo/commit/918a5f2cc022994ee08bead25dd79072bf3fba87 closes odoo/odoo#106660 Signed-off-by:Kevin Baptiste <kba@odoo.com>
Loading
Please register or sign in to comment