-
-
Notifications
You must be signed in to change notification settings - Fork 386
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
[16.0][IMP] account_reconcile_oca: Improve multicurrency management #694
base: 16.0
Are you sure you want to change the base?
Conversation
3db40d1
to
0e1b9bb
Compare
0e1b9bb
to
1be98ea
Compare
@florian-dacosta Round 2 |
@etobella I still don't get why there is a rounding to find an amount that is written in the Anyway, I've tested the later version Reconciled invoice after validation - Not OK The bank accounting entry is missing the currency on the 121000 line |
We have a rounding issue because the reconcile is done on the currency of the company. Also we cannot use that amount, because we might have previous lines. The only option I can see is to do the reconcile in the amount of the statement line. This is more work to do and I just wanted to add a patch, but seems we need to do a real refactoring (it is good to have so many tests) |
Thank you for your help with these issues, @etobella. |
1be98ea
to
7018d67
Compare
@PaulGoubert @florian-dacosta Round 3 I have changed the flow in order to compare using the currency of the line. It has no sense to move from EUR to USD to EUR, so it should remove some of this errors. |
7018d67
to
d7fd2bb
Compare
I applied a fix for this. I am not sure if it gets all the possible cases, but at least it is an approach |
@etobella Thanks for your work, it is really helpull ! If I choose the counter part, all is fine, then when I reconcile, as you saif, all is fine, the invoice is reconciled correctly, the accounting entries are correct.
For now the most annoying for me is the display in 1. Even if all goes fine after, it is very confusing for the user.
I am not sure what you refer to ? |
1st point should be solved now. |
It is, thanks |
@etobella Could you rebase please ? |
43080b7
to
7be86a9
Compare
cc242ac
to
0553397
Compare
self.manual_partner_id and self.manual_partner_id.name_get()[0] or False | ||
self.manual_partner_id | ||
and self.manual_partner_id.name_get()[0] | ||
or [False, False] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
bool([False, False])
=> True
Are you sure you want this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry for the noise here.
I'll make it short here. When there are not partner at all, in the data, the value [False, False]
is set here :
https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_bank_statement_line.py#L405
and here :
https://github.com/OCA/account-reconcile/blob/16.0/account_reconcile_oca/models/account_bank_statement_line.py#L896
So when checking if the line has changed, and there is no partner at all, comparing the reconcile_data partner part ([False, False]
)with False
will always be considered different while no changed occured (no partner was set).
So I think we could leave this as is. (meaning comparing [False, False]
with line.get("partner_id")
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested the PR on runboat and it resolves the problems in the issues:
- For the test, I created a company in EUR and created a Bank in EUR.
- The currency rate are the following:
The suspended balance apears correct and when you select the invoices that fully match with the statement, it doesnt correct the invoice amount.
Also, in the account move, the amount in currency is displayed correcly
https://www.awesomescreenshot.com/video/32216430?key=6538e7535b46717a2905cfcb08d9a052
We will use currency of the line in order to get the suspense and max line value
Fix the case of payment with a foreign currency set on bank statement line improve tests around multi-currency
…rrency rate It is possible that the statement line in foreign currency is created before the rate of the day is updated in Odoo. In this case we need to take the real rate of the statement line to comput the exchange rate
…wanted currency conversion
…ount If currency amount is not 0, the suspense line will have wrong amount
32421da
to
2edf543
Compare
== self.company_id.currency_exchange_journal_id | ||
): | ||
reconcile_auxiliary_id, lines = self._get_reconcile_line( | ||
reconciled_line.move_id.line_ids - reconciled_line, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected singleton.
>>> reconcile_auxiliary_id, lines = self._get_reconcile_line(
>>> new_vals = super()._get_reconcile_line(
>>> original_amount = amount = net_amount = line.debit - line.credit
>>> record.ensure_one()
Tries to fix #692 #693
@florian-dacosta Can you check it please?