-
- Downloads
[FIX] purchase: auto-complete bill with multi-currency
When adding several PO to a bill, if they don't have the same currency,
it will lead to incorrect amounts
To reproduce the error:
1. In Settings, enable "Multi-Currencies"
2. Invoicing > Configuration > Currencies:
- EUR: Active, Current Rate = 2
- USD: Active, Current Rate = 1
3. Create a PO:
- Currency: USD
- Products:
- One product, no taxes, unit price 1000
4. Confirm PO
5. Edit PO:
- Qty Received: 1
6. Repeat 3 -> 5 with EUR instead of USD
7. Open a new Bill
8. Add the first PO to the field "Auto-Complete"
9. Add the second PO to the field "Auto-Complete"
Error: Both invoice lines are now expressed in EUR and both subtotals
are equal to 1000 even though the exchange rate isn't 1
This commit suggests not to change the currency of the account move if
the latter already has some AML. Moreover, the amounts must be converted
if they come from a PO that uses another currency
OPW-2573748
closes odoo/odoo#73247
Signed-off-by:
Steve Van Essche <svs-odoo@users.noreply.github.com>
Showing
- addons/purchase/models/account_invoice.py 1 addition, 0 deletionsaddons/purchase/models/account_invoice.py
- addons/purchase/models/purchase.py 3 additions, 1 deletionaddons/purchase/models/purchase.py
- addons/purchase/tests/test_purchase_invoice.py 46 additions, 0 deletionsaddons/purchase/tests/test_purchase_invoice.py
Loading
Please register or sign in to comment