summaryrefslogtreecommitdiff
path: root/addons/web_editor
diff options
context:
space:
mode:
authoroco-odoo <oco@odoo.com>2018-05-22 10:20:49 +0200
committerGitHub <noreply@github.com>2018-05-22 10:20:49 +0200
commit943075fd94eec2bc61b751e8828e3bd69054b2f8 (patch)
tree09f761b85be924ab5ed15e26ca0c89c01ec6dab1 /addons/web_editor
parent799b10eca5d102a052758ae03611bef0781a9226 (diff)
[FIX] purchase: anglosaxon stock valuation: use correct currency rates to determine whether or not to create a price difference line for invoices. (#24815)
Before that, the following scenario (tested in purchase/tests/test_anglosaxon_valuation_reconciliation.py) failed: - create a PO - change of currency rate - create and validate vendor bill in foreign currency - receive goods - change of currency rate - return the goods - change of currency rate - refund the bill At the end of it, both invoices (bill and refund) were not in 'paid' state, but they should have been! The anglosaxon stock valuation code had some issues in the way it managed currency rates. The main one was that we converted the computed valuation_price_unit variable in company currency using the date of the invoice as a reference, which was wrong in case the invoice was a refund, as it should then use the date of the valuation for this. This problem caused the code to detect an exchange rate difference between refund and valuation as a price difference, hence generating a line in the price difference account, which caused the debtor account line of the associated account.move to be wrong, and hence impacted the residual field of the invoice ("amount due", in GUI). Finally, as this field contained an inconsistent value, the refund invoice was not marked as paid after reconciling it with the original one. Solving this needed to refactor the code quite a bit, so that we don't convert everything in invoice currency in the end, but rather do it directly everytime we compute a part of valuation_price_unit. The test had also to be partly re-written as it was too naive in the way it used currency rates, we needed something closer to a real utilisation of the program.
Diffstat (limited to 'addons/web_editor')
0 files changed, 0 insertions, 0 deletions