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][ADD] account_bank_statement_import_file_hook #595

Conversation

JaumeBforgeFlow
Copy link

No description provided.

@JaumeBforgeFlow JaumeBforgeFlow changed the title [ADD] accounbt_bank_statement_import_file_hook [ADD] account_bank_statement_import_file_hook May 24, 2023
@JaumeBforgeFlow JaumeBforgeFlow force-pushed the 13.0-account_bank_statement_import_file_hook branch from f1c4327 to 42bc964 Compare May 24, 2023 15:34
@JaumeBforgeFlow JaumeBforgeFlow marked this pull request as ready for review May 25, 2023 08:36
@JaumeBforgeFlow JaumeBforgeFlow changed the title [ADD] account_bank_statement_import_file_hook [13.0][ADD] account_bank_statement_import_file_hook May 25, 2023
Copy link

@GuillemCForgeFlow GuillemCForgeFlow left a comment

Choose a reason for hiding this comment

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

LGTM! 👍🏽

Copy link

@mariadforgeflow mariadforgeflow left a comment

Choose a reason for hiding this comment

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

LVGTM!

@AaronHForgeFlow
Copy link

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 13.0-ocabot-merge-pr-595-by-AaronHForgeFlow-bump-nobump, awaiting test results.

OCA-git-bot added a commit that referenced this pull request May 30, 2023
Signed-off-by AaronHForgeFlow
@OCA-git-bot
Copy link
Contributor

@AaronHForgeFlow your merge command was aborted due to failed check(s), which you can inspect on this commit of 13.0-ocabot-merge-pr-595-by-AaronHForgeFlow-bump-nobump.

After fixing the problem, you can re-issue a merge command. Please refrain from merging manually as it will most probably make the target branch red.

Copy link
Member

@pedrobaeza pedrobaeza left a comment

Choose a reason for hiding this comment

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

Wait, aborting. Why do you need to do such hooks? This is a very bad practice. What do you want to get?

@JaumeBforgeFlow
Copy link
Author

@pedrobaeza, Odoo does the processing of the file in such a way that you are not able to tap into the logic, to modify it while having access to the ir.attachment record being processed. None of the functions called inside the for loop in the import_file() function are passed the attachment as a record.

Having this hook might be interesting in cases such as the one we are working with, where we want to link the resulting statement with the attachment.

@pedrobaeza
Copy link
Member

I think you can override _parse_file method, that has as argument the decoded file content, and include in the returned dictionary these contents in a special key. Then override the create method of account.bank.statement, and if you find such key, pop it, call super, and then create the attachment.

@github-actions
Copy link

github-actions bot commented Oct 1, 2023

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 Oct 1, 2023
@github-actions github-actions bot closed this Nov 5, 2023
@AaronHForgeFlow AaronHForgeFlow added no stale Use this label to prevent the automated stale action from closing this PR/Issue. and removed stale PR/Issue without recent activity, it'll be soon closed automatically. labels Nov 6, 2023
@AaronHForgeFlow
Copy link

Hi, just reopening this

@AaronHForgeFlow
Copy link

sorry wrong PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
no stale Use this label to prevent the automated stale action from closing this PR/Issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants