luc-demeyer / noviat-apps

Noviat apps.odoo.com repository
20 stars 53 forks source link

[8.0][FIX] Wrong currency amount used. #6

Closed rven closed 9 years ago

rven commented 9 years ago

When creating a payment order, from imported invoices in another currency then the company invoice, the incorrect amount is taken to create the payment order.

luc-demeyer commented 9 years ago

@rven your fix doesn't make sense. If you look to the code of the amount_to_pay method than you'll see that the amount_residual_currency is taken. But there is extra logic in this function that would be lost with your PR: the amount_to_pay method also takes into account unreconciled payment lines to avoid paying twice the same amount.

I have tested the import of an invoice made in USD and the correct amount was imported. Can you give me an EXACT use case where the amount_to_pay function does the wrong calculation so that I can reproduce and fix the issue ? Tx, Luc

rven commented 9 years ago

@luc-demeyer

I did not have the latest version of the module. I'll test it again with the latest version.