bank-statement-import
bank-statement-import copied to clipboard
[14.0][ADD] account_statement_import_base and account_statement_import_file_reconciliation_widget
The 2 modules account_statement_import_online and account_statement_import depend on account_statement_import_base (and not on each other) and share common code, in particular a hook to update the statement line. So we can now have reconciliation modules that use this hook and therefore work both on file import and online import. More details on https://github.com/OCA/bank-statement-import/issues/481.
Improve bank statement line form view and journal form view.
I still have to write the migration script for online_raw_data -> raw_data (If we are ok to rename this field and move it to the base module).
Hi @alexey-pelykh, some modules you are maintaining are being modified, check this out!
Travis error seems unrelated.
Sorry, but I don't agree on this refactoring adding more complexity on the module dependency with not too much added value.
@alexis-via you should rebase once https://github.com/OCA/bank-statement-import/pull/483 is merged
@pedrobaeza I implemented what has been discussed in #481, so this refactoring is not a surprise.
IMHO this refactoring fixes the dependency: there was NO reason for account_statement_import_online to depend on account_statement_import. This refactoring fixes this.
The BIG advantage of this refactoring is that we can now have reconciliation modules that work BOTH on file import and online import. It should have been the case long ago, but it was unfortunately not the case until now. I made sure that reconciliation modules that inherited _complete_stmts_vals() from account_statement_import or _get_statement_filtered_lines() from account_statement_import_online will continue to work, because I didn't change the prototype of those methods.
What I can propose to simplify the refactoring: I can avoid the rename of the field online_raw_data to raw_data and the move of the field definition from account_statement_import_online to account_statement_import_base. That would simplify the refactoring while keeping the real advantage for the users (and we'll be able to move+rename this field in v16 for example).
@alexey-pelykh I made the rebase
@alexis-via
account_statement_import (LGPL-3) depends on account_statement_import_base (AGPL-3)
this will have to be sorted out
@alexey-pelykh I fixed the licence issue. account_statement_import_base is now LGPL.
I also added a module account_statement_import_file_reconciliation_widget which is a glue auto-install module between account_statement_import and account_reconciliation_widget. It adds a button "Import and Start to Reconcile" on the wizard that allows to import and jump directly to the reconciliation interface. The associated code was moved from account_statement_import (it was present in this module but never called) to account_statement_import_file_reconciliation_widget.
If you use the version of account_reconciliation_widget from the PR https://github.com/OCA/account-reconcile/pull/487 where I fixed the notifications, when you click on the new button "Import and Start to Reconcile", you will see the warning message when importing an OFX file where some statement lines were already present in Odoo:
Tests are red because "account_statement_import_file_reconciliation_widget (Mature) depends on account_reconciliation_widget (Beta)".
I made a PR to switch account_reconciliation_widget to mature https://github.com/OCA/account-reconcile/pull/491 If the PR is not accepted, I'll flag account_statement_import_file_reconciliation_widget to beta.
Tests are green again (I removed the mature flag from account_statement_import_file_reconciliation_widget).
Statement line form view
Before the PR:
Scary, isnt' it ?
After PR:
- first tab:
- second tab:
I re-organised the form view of account.bank.statement.line because I thought that the form view defined in the "account" module was really too bad and it required a re-organisation.
But, if the reviewers are against the re-organisation of the bank statement form view, I'll leave the ugly view as-is in OCA (and I'll improve it in one of my modules).
But, if the reviewers are against the re-organisation of the bank statement form view, I'll leave the ugly view as-is in OCA (and I'll improve it in one of my modules).
For What It's worth, I like the improved view.
I tested this new proposal and I think this is a good way to go (to keep in sync file on sync import) ! thanks @alexis-via
Note: I prefer the new bank statement line form, simplier to use for non technical user and technical data accessible if needed !
I also like the new view much more. But if it would be blocking to add the notebook, an alternative might be to only show the technical data in debug / technical mode.
@NL66278 Sorry for the delay; the migration script is provided now
I think we are ready to merge now. @pedrobaeza are you ok with the modification of the view ? The other reviewers were positive about the new form view of statement lines.
This PR has the approved
label and has been created more than 5 days ago. It should therefore be ready to merge by a maintainer (or a PSC member if the concerned addon has no declared maintainer). 🤖
/ocabot merge nobump
Hey, thanks for contributing! Proceeding to merge this for you. Prepared branch 14.0-ocabot-merge-pr-482-by-alexis-via-bump-nobump, awaiting test results.
@alexis-via The merge process could not be finalized, because command oca-gen-addon-readme --org-name OCA --repo-name bank-statement-import --branch 14.0 --addons-dir /tmp/tmpeu98gkyc --commit
failed with output:
/tmp/tmpeu98gkyc/account_statement_import_file_reconciliation_widget/README.rst:3: (WARNING/2) Duplicate explicit target name: "oca/bank-statement-import".
Traceback (most recent call last):
File "/usr/local/bin/oca-gen-addon-readme", line 11, in <module>
load_entry_point('oca-maintainers-tools', 'console_scripts', 'oca-gen-addon-readme')()
File "/ocamt-readme/lib/python3.8/site-packages/click/core.py", line 1137, in __call__
return self.main(*args, **kwargs)
File "/ocamt-readme/lib/python3.8/site-packages/click/core.py", line 1062, in main
rv = self.invoke(ctx)
File "/ocamt-readme/lib/python3.8/site-packages/click/core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/ocamt-readme/lib/python3.8/site-packages/click/core.py", line 763, in invoke
return __callback(*args, **kwargs)
File "/ocamt-readme/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 312, in gen_addon_readme
check_rst(readme_filename)
File "/ocamt-readme/src/oca-maintainers-tools/tools/gen_addon_readme.py", line 239, in check_rst
publish_file(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/core.py", line 370, in publish_file
output, pub = publish_programmatically(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/core.py", line 664, in publish_programmatically
output = pub.publish(enable_exit_status=enable_exit_status)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/core.py", line 216, in publish
self.document = self.reader.read(self.source, self.parser,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/readers/__init__.py", line 71, in read
self.parse()
File "/ocamt-readme/lib/python3.8/site-packages/docutils/readers/__init__.py", line 77, in parse
self.parser.parse(self.input, document)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/__init__.py", line 191, in parse
self.statemachine.run(inputlines, document, inliner=self.inliner)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 170, in run
results = StateMachineWS.run(self, input_lines, input_offset,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 238, in run
context, next_state, result = self.check_line(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 3007, in text
self.section(title.lstrip(), source, style, lineno + 1, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
self.new_subsection(title, lineno, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
newabsoffset = self.nested_parse(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 238, in run
context, next_state, result = self.check_line(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2771, in underline
self.section(title, source, style, lineno - 1, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
self.new_subsection(title, lineno, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
newabsoffset = self.nested_parse(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 238, in run
context, next_state, result = self.check_line(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2771, in underline
self.section(title, source, style, lineno - 1, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 327, in section
self.new_subsection(title, lineno, messages)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 393, in new_subsection
newabsoffset = self.nested_parse(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 281, in nested_parse
state_machine.run(block, input_offset, memo=self.memo,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 196, in run
results = StateMachineWS.run(self, input_lines, input_offset)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 238, in run
context, next_state, result = self.check_line(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/statemachine.py", line 460, in check_line
return method(match, context, next_state)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 2705, in blank
paragraph, literalnext = self.paragraph(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 418, in paragraph
textnodes, messages = self.inline_text(text, lineno)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 427, in inline_text
nodes, messages = self.inliner.parse(text, lineno,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 646, in parse
before, inlines, remaining, sysmessages = method(self, match,
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 786, in interpreted_or_phrase_ref
return self.phrase_ref(string[:matchstart], string[textend:],
File "/ocamt-readme/lib/python3.8/site-packages/docutils/parsers/rst/states.py", line 860, in phrase_ref
self.document.note_explicit_target(target, self.parent)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/nodes.py", line 1409, in note_explicit_target
self.set_name_id_map(target, id, msgnode, explicit=True)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/nodes.py", line 1352, in set_name_id_map
self.set_duplicate_name_id(node, id, name, msgnode, explicit)
File "/ocamt-readme/lib/python3.8/site-packages/docutils/nodes.py", line 1375, in set_duplicate_name_id
msg = self.reporter.system_message(
File "/ocamt-readme/lib/python3.8/site-packages/docutils/utils/__init__.py", line 195, in system_message
raise SystemMessage(msg, level)
docutils.utils.SystemMessage: /tmp/tmpeu98gkyc/account_statement_import_file_reconciliation_widget/README.rst:3: (WARNING/2) Duplicate explicit target name: "oca/bank-statement-import".
/ocabot merge nobump
What a great day to merge this nice PR. Let's do it! Prepared branch 14.0-ocabot-merge-pr-482-by-alexis-via-bump-nobump, awaiting test results.
Congratulations, your PR was merged at 80088584bcbeec014f45e01bb645bece4e4d128c. Thanks a lot for contributing to OCA. ❤️