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
[10.0] mig bank statement import coda from 8.0 #54
Conversation
The module is a rewrite of l10n_be_coda using the pycoda parser.
Use the Structured Communication as name else use the communication if it's provided else use '/'. If the line is a details line use the communication from the related globalisation as name. The module now depends of l10n_be_coda since the first one is automatically installed when installing l10n_be. The menuitem 'Import Coda File' from l10n_be_coda is however removed to avoid confusion and force the use of the current module
…ote of statement line with the same transaction_ref
The declaration prevents the install of the module if the dependency is not met
…ty constraint with the demo data of l10n_be_coda.
this makes the test more robust (the previous version did not work in presence of account_constraints, and could not be run twice in a row on the same database)
d92bd46
to
33d9dd3
Compare
33d9dd3
to
22d285d
Compare
@Olivier-LAURENT have you had a chance to test 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.
Reviewed and tested, thx for the migration. 👍
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.
@sbidoul I've just two small remarks which will be great for us to be adressed. Otherwise it could be merged.
if statements: | ||
acc_number = statements[0].acc_number | ||
currency = statement.currency | ||
return currency, acc_number, vals_bank_statements |
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.
in our version we return return currency, self._get_acc_number(account_number), vals_bank_statements
this _get_acc_number function ensure that we have a defined journal for this account number.
def _get_acc_number(self, acc_number):
#Check if we match the exact acc_number or the end of an acc number
journal = self.env['account.journal'].search([('bank_acc_number', '=like', '%' + acc_number)])
if not journal or len(journal) > 1: #if not found or ambiguious
return acc_number
return journal.bank_acc_number
if statement.new_balance_amount_sign == AmountSign.DEBIT: | ||
balance_end_real = - balance_end_real | ||
transactions = [] | ||
statement_date = statement.new_balance_date |
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.
why not using statement.creation_date?
'partner_name': line.counterparty_name or None, | ||
'account_number': line.counterparty_number or None, | ||
'note': self.get_st_line_note(line, information_dict), | ||
'unique_import_id': line.ref + line.transaction_ref, |
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.
we get a problem here testing it with Triodos Coda.
the uniqe_import_id is too weak and led to ignore statement and or statement line import.
in our implementation we build the uniqe_import_id like this statement.coda_seq_number + '-' + statement.old_balance_date + '-' + statement.new_balance_date + '-' + move.ref
we also found that trasanction_ref returned from pycoda is in fact the bank reference from which the payment as been made. This reference is not mandatory and can be empty(N° de référence de la banque. Cette information est strictement informative)
@sbidoul Hello Stéphane. Is there any news regarding our test results on this PR? |
@sbidoul Hi Stéphane, |
@vdewulf I've backported the most changes from v11. Let's see if it's green. /ocabot merge |
What a great day to merge this nice PR. Let's do it! |
Congratulations, your PR was merged at 655de5c. Thanks a lot for contributing to OCA. ❤️ PS: Don't worry if GitHub says there are unmerged commits: it is due to a rebase before merge. All commits of this PR have been merged into |
thanks @sbidoul |
No description provided.