As per the title says. When user wants to pay back to the employe the payment he has made to the vendor there is a message popping up stating that he can't register payments when the outstanding value is zero (this is the field amount_residual). All the account moves have been well posted but this variable goes to zero when it shouldn't. The circuit/process goes without hiccups when this module is not involved ie. when the expense is created without linking a vendor invoice.
To Reproduce
This has been triggered on Dockered Odoo version 16.20240730 with latest git pull of OCA/hr-expense.
Create Vendor Invoice with one product line, check account moves OK pror to confirmation.
Confirm Invoice. Check moves and pay status: moves OK and invoice not paid.
Create new employee expense with Vendor Bill field chosing the invoice from step 2 and entering the full amount of the invoice as Total. Expenses form view shows this Total as value to report.
View Expense Sheet Report, Check all is OK.
Submit for aproval.
Aprove. No moves posted so far.
Post Journal Entries and checked that everything is OK. All the corresponding moves are posted as they should (see below). The only thing that's wrong is the Amount Due (amount_residual) that shows 0 when it shouldn't.
When user presses the Register Payment button message pops up as in image below.
Expected behavior
The Amount Due should be the residual amount left out to pay back the employee.
Additional context
This has been checked in various different Odoo 16.x installations with the same behaviour.
Module
hr_expense_invoice
Describe the bug
As per the title says. When user wants to pay back to the employe the payment he has made to the vendor there is a message popping up stating that he can't register payments when the outstanding value is zero (this is the field amount_residual). All the account moves have been well posted but this variable goes to zero when it shouldn't. The circuit/process goes without hiccups when this module is not involved ie. when the expense is created without linking a vendor invoice.
To Reproduce
This has been triggered on Dockered Odoo version 16.20240730 with latest git pull of OCA/hr-expense.
Expected behavior The Amount Due should be the residual amount left out to pay back the employee.
Additional context This has been checked in various different Odoo 16.x installations with the same behaviour.