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

[13.0][MIG][IMP] adyen statement import #384

Merged
merged 24 commits into from
Sep 25, 2023

Conversation

NL66278
Copy link
Contributor

@NL66278 NL66278 commented Mar 30, 2021

Migration of account_bank_statement_import_adyen, but extended with possibility to import csv files, and with a module to automatically import them form the Adyen website.

This PR also contains some changes to other modules, that were made necessary by the unfortunate logic of the import modules to try the import in turns and then call super when failing. Not all modules where handling this in a proper way.

It would be better if, like the original modules in 7.0, an import was always linked to a certain format, so this dubious try..catch..pass on logic could be avoided.

@StefanRijnhart
Copy link
Member

Looks great, you've solved all the technical debt from the 12.0 version and greatly enhanced the functionality! Are you suggesting we keep all the individual commits or can some of them be squashed?
Just curious: if you don't enable the clearing account mechanism for your adyen imports, what does your accounting setup looks like? In our setup, I think the amounts are transferred by batch so each statement represents one actual bank transaction, corresponding to the outstanding amount on the clearing account. In any case, please let me know what your considerations are not to use the clearing account mechanism.

@NL66278
Copy link
Contributor Author

NL66278 commented Apr 20, 2021

@StefanRijnhart with the customer that needed the migration, it is not yet clear how they want to handle the downloaded statements. The clearing account is still in the migration. I just removed the dependency from the adyen import. But there is no obstacle to use the modules in combination.

I will squash the commits where logical.

@StefanRijnhart
Copy link
Member

Mmm... In our case, we implemented the import module first, then when testing it turned out that the financial logic required this clearing account mechanism. So I'm not sure removing the dependency is a good idea.

@NL66278 NL66278 force-pushed the 13.0-adyen_statement_import branch from 1b28ba1 to 78cd582 Compare April 20, 2021 16:22
@NL66278
Copy link
Contributor Author

NL66278 commented Apr 21, 2021

@StefanRijnhart Zou je kunnen leven met een dringend advies in de README om ook de clearing_account module te installeren ipv een technische dependency?

@StefanRijnhart
Copy link
Member

I'm curious if the Adyen module is useful without the clearing account mechanism, and if we don't know, then what is the reason that you decoupled those?

@NL66278
Copy link
Contributor Author

NL66278 commented Apr 21, 2021

@StefanRijnhart I discussed it and will put back the clearing_account dependency. I will also go through all the commits once more to minimize them even more and rectify a few oversights.

@NL66278 NL66278 force-pushed the 13.0-adyen_statement_import branch 2 times, most recently from ff35e7e to 28be6f9 Compare April 21, 2021 10:55
@NL66278 NL66278 force-pushed the 13.0-adyen_statement_import branch 2 times, most recently from d183517 to caafca9 Compare July 28, 2021 14:30
@lfreeke
Copy link

lfreeke commented Dec 13, 2021

@NL66278 I think this should be an OCA icon -> account_bank_statement_import_online_adyen/static/description/icon.png

@NL66278
Copy link
Contributor Author

NL66278 commented Dec 14, 2021

@lfreeke I did not change the icon, do you expect problems with this?

@lfreeke
Copy link

lfreeke commented Dec 15, 2021

@NL66278 It has the Ponto icon now.

@NL66278
Copy link
Contributor Author

NL66278 commented Dec 16, 2021

@lfreeke I replaced the Ponto logo with the Adyen logo

@NL66278
Copy link
Contributor Author

NL66278 commented Mar 2, 2022

Runboat sunk?

  • bash /runboat/runboat-clone-and-install.sh
  • rm -fr /mnt/data/initialized
  • rm -fr /mnt/data/odoo-addons-dir
  • mkdir -p /mnt/data/odoo-addons-dir
  • cd /mnt/data/odoo-addons-dir
  • curl -sSL https://github.com/oca/bank-statement-import/tarball/5885781ce65e877ce51e8bb83f095d73b517abd8
  • tar zxf - --strip-components=1
  • INSTALL_METHOD=oca_install_addons
  • [[ oca_install_addons == \o\c\a_\i\n\s\t\a\l\l_\a\d\d\o\n\s ]]
  • oca_install_addons
  • setuptools-odoo-get-requirements --include-addons --addons-dir /mnt/data/odoo-addons-dir
    /root/.local/pipx/shared/lib/python3.8/site-packages/_distutils_hack/init.py:17: UserWarning: Distutils was imported before Setuptools, but importing Setuptools also replaces the distutils module in sys.modules. This may lead to undesirable behaviors or errors. To avoid these issues, avoid using distutils directly, ensure that setuptools is installed in the traditional way (e.g. not an editable install), and/or make sure that setuptools is always imported before distutils.
    warnings.warn(
    /root/.local/pipx/shared/lib/python3.8/site-packages/_distutils_hack/init.py:30: UserWarning: Setuptools is replacing distutils.
    warnings.warn("Setuptools is replacing distutils.")
  • cat test-requirements.txt
    csv
    odoo13-addon-multi_step_wizard
    odoo13-addon-web_widget_dropdown_dynamic
    odoo>=13.0a,<13.1dev
    xlrd
  • pip install -r test-requirements.txt
    Looking in indexes: https://wheelhouse.odoo-community.org/oca-simple-and-pypi
    ERROR: Could not find a version that satisfies the requirement csv (from versions: none)
    ERROR: No matching distribution found for csv

@NL66278 NL66278 force-pushed the 13.0-adyen_statement_import branch from d4c9715 to 1ef50a7 Compare March 18, 2022 16:24
@NL66278 NL66278 force-pushed the 13.0-adyen_statement_import branch from e44ec2e to 943d783 Compare March 29, 2022 07:51
@github-actions
Copy link

There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days.
If you want this PR to never become stale, please ask a PSC member to apply the "no stale" label.

@github-actions github-actions bot added the stale PR/Issue without recent activity, it'll be soon closed automatically. label Jul 31, 2022
@github-actions github-actions bot closed this Sep 4, 2022
Copy link

@lfreeke lfreeke left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Functional test, works well for our customer.

@NL66278
Copy link
Contributor Author

NL66278 commented Sep 15, 2023

@StefanRijnhart Could you re-open, and possibly merge this one? Working very well for our customer for a long time now. And I will be migrating it to 16.0.

Copy link
Member

@StefanRijnhart StefanRijnhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work, thanks!

@StefanRijnhart
Copy link
Member

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 13.0-ocabot-merge-pr-384-by-StefanRijnhart-bump-nobump, awaiting test results.

MPishpecki and others added 21 commits September 25, 2023 09:56
If passed any csv file, paypal module would try to use it, even if clearly not
a paypal file.
Prevent other statement import modules from processing the file. Without this for instance the
Enterprise account_bank_statement_import_csv module will process a retrieved cv file. In addition this
is more efficient as it saves a decoding step.
csv is part of the standard library. Defining this as an external dependency
crashes runboat
Put more information in the generated statement line. Also put the for users
more recognizable merchant ref in the name (Label) field, and put the psp reference in
ref.

With a small refactoring the information retrieved can also more easily be customized.
Move parsing code to separate class;
Break up large and unwieldy parsing method in separate methods.
@NL66278
Copy link
Contributor Author

NL66278 commented Sep 25, 2023

@StefanRijnhart Thanks for your actions and comments. I did the rebase and the linting problems should be fixed now.

@StefanRijnhart
Copy link
Member

Alright!

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

What a great day to merge this nice PR. Let's do it!
Prepared branch 13.0-ocabot-merge-pr-384-by-StefanRijnhart-bump-nobump, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 204a0e4 into OCA:13.0 Sep 25, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at f8c9430. Thanks a lot for contributing to OCA. ❤️

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merged 🎉 stale PR/Issue without recent activity, it'll be soon closed automatically.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants