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

[16.0][IMP] account_invoice_refund_link: Make more reliable the linking #1526

Conversation

pedrobaeza
Copy link
Member

@pedrobaeza pedrobaeza commented Aug 7, 2023

Forward-port of #1523

Hooking on a high level method like _reverse_moves (although still being private), makes that other modules hooking into it may alter the number of returned lines (like for example, account_invoice_refund_line_selection).

We choose the low-level copy_data method that is used in such method for linking the refund lines with their origin ones, avoiding the problem.

@Tecnativa

@pedrobaeza pedrobaeza added this to the 16.0 milestone Aug 7, 2023
@pedrobaeza pedrobaeza force-pushed the 16.0-imp-account_invoice_refund_link-solid_linking branch from 9959c57 to 289f17e Compare August 7, 2023 15:01
Hooking on a high level method like `_reverse_moves` (although still
being private), makes that other modules hooking into it may alter the
number of returned lines (like for example,
account_invoice_refund_line_selection).

We choose the low-level `copy_data` method that is used in such method
for linking the refund lines with their origin ones, avoiding the
problem.
@pedrobaeza
Copy link
Member Author

@pedrocasi @ljsalvatierra-factorlibre here I refactor the linking code, and I see no reason for excluding of the link of other lines like sections, notes, and so on. Do you see any problem?

@pedrocs-exo
Copy link
Contributor

Hi,

A can't think of any inconvenient of linking also the sections and notes. Except for the fact that it's probably useless but we can live with that.

@pedrobaeza
Copy link
Member Author

OK, I don't think it's totally useless, as this still keeps trace that a section in the origin invoice generates a section in the refund, on contrary of a manually created section. Let's keep this way and see if there's any cons:

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 16.0-ocabot-merge-pr-1526-by-pedrobaeza-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit ad617d2 into OCA:16.0 Aug 8, 2023
6 checks passed
@OCA-git-bot
Copy link
Contributor

Congratulations, your PR was merged at 4ee90b3. 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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants