Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REF] account: Add test for issue#30972 - Cash Basis Foreign Currency Reconcile error using low values like 0.01 #31168

Open
wants to merge 1 commit into
base: 12.0
from

Conversation

Projects
None yet
3 participants
@moylop260
Copy link
Contributor

moylop260 commented Feb 16, 2019

I have reproduced the following issue #30972 with unittest

Cash Basis Foreign Currency Reconcile error using low values like 0.01

OPW#1953027

@robodoo robodoo added the seen 🙂 label Feb 16, 2019

@moylop260 moylop260 force-pushed the vauxoo-dev:12.0-odoo-test_issue_30972-moy branch Feb 16, 2019

@moylop260

This comment has been minimized.

Copy link
Contributor Author

moylop260 commented Feb 16, 2019

FYI I just apply the following change for the tests:

diff --git a/addons/account/tests/test_reconciliation.py b/addons/account/tests/test_reconciliation.py
index d19a1be6991..854c28272ee 100644
--- a/addons/account/tests/test_reconciliation.py
+++ b/addons/account/tests/test_reconciliation.py
@@ -1822,6 +1822,7 @@ class TestReconciliation(AccountingTestCase):
             'currency_id': self.currency_usd_id,
         })
         usd = self.env['res.currency'].browse(self.currency_usd_id)
+        usd.rounding = 0.0001
         usd.rate_ids.unlink()
         self.env['res.currency.rate'].create({
             'name': time.strftime('%Y-01-01'),

And the error is not reproduced anymore.
However, our customer doesn't like to increase number of decimals for him currencies.

@moylop260

This comment has been minimized.

Copy link
Contributor Author

moylop260 commented Feb 19, 2019

@nim-odoo
May I can ask you about this matter and let us know your opinion, please?

@moylop260 moylop260 force-pushed the vauxoo-dev:12.0-odoo-test_issue_30972-moy branch to bf42db9 Feb 20, 2019

@moylop260 moylop260 changed the title [REF] account: Add test for issue#30972 [REF] account: Add test for issue#30972 - Cash Basis Foreign Currency Reconcile error using low values like 0.01 Mar 14, 2019

@kebeclibre

This comment has been minimized.

Copy link
Contributor

kebeclibre commented Mar 22, 2019

@moylop260
I'm sure this has nothing to do with reverting cash basis entries. There is no revert at all in your test

Also, your test does fail, and it is not surprising at all that changing the rounding on the currency solves the problem.
But, I tried to do it manually by (all with the same values for currencies and rates)

  • issuing and validating an invoice
  • creating the first bank statement and statement line
  • reconciling partially the invoice, letting it open with a residual of 0.01 in invoice currency
  • doing a second statement and line
  • reconciling fully with the first two.

That way I'm not able to reproduce.

Maybe you have another practical use case ?

@moylop260

This comment has been minimized.

Copy link
Contributor Author

moylop260 commented Mar 22, 2019

@kebeclibre
Also, your test does fail

Hi Lucas,
Yes, it test does fail because of this is the unittest to reproduce the issue where a fail is raised.

You can see the following video (from issue) where the same unittest is reproduced manually using runbot:

@moylop260

This comment has been minimized.

Copy link
Contributor Author

moylop260 commented Mar 22, 2019

Another way to reproduce it is adding a self.env.cr.commit() from the unittest method that makes the case.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.