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][MIG] account_invoice_refund_link #1264

Merged
merged 46 commits into from
Jan 26, 2023

Conversation

ljsalvatierra-factorlibre

@oca-clabot
Copy link

Hey @ljsalvatierra-factorlibre, thank you for your Pull Request.

It looks like some users haven't signed our Contributor License Agreement, yet.
You can read and sign our full Contributor License Agreement here: https://odoo-community.org/page/cla
Here is a list of the users:

Appreciation of efforts,
OCA CLAbot

@RodrigoBM RodrigoBM force-pushed the 16.0-mig-account_invoice_refund_link branch from 350aef8 to 3610b9b Compare October 17, 2022 08:37
@AntoniRomera
Copy link

@OCA/community-maintainers
Could you merge this PR?

@rafaelbn
Copy link
Member

/ocabot migration account_invoice_refund_link

@OCA-git-bot OCA-git-bot added this to the 16.0 milestone Dec 22, 2022
@OCA-git-bot OCA-git-bot mentioned this pull request Dec 22, 2022
64 tasks
@rafaelbn
Copy link
Member

/ocabot rebase

@OCA-git-bot
Copy link
Contributor

@rafaelbn The rebase process failed, because command git push --force factorlibre tmp-pr-1264:16.0-mig-account_invoice_refund_link failed with output:

remote: Permission to factorlibre/account-invoicing.git denied to OCA-git-bot.
fatal: unable to access 'https://github.com/factorlibre/account-invoicing/': The requested URL returned error: 403

antespi and others added 18 commits December 22, 2022 09:34
Enhancements:

* Reverse link from invoice to refunds also available.
* Link at invoice line level, not only at invoice level.
* When installing the module after some refunds have been made, the module tries to find the link to the original invoice for them.
* OCA Guidelines compliance.
* Compatibility in OpenUpgrade for migrating from 8.0 module account_refund_original.
* Tests with 100% coverage.

Technical changes:

* Rename field origin_invoices_ids to origin_invoice_ids
* Rename field refund_invoices_description to refund_reason
* Rename addon to account_invoice_refund_link
Odoo already includes a method for preparing the refund, so using it
we don't have to make any guess about the returned domain and the
method also serves for refunds created directly by code.

Initial line match has also been improved comparing product or
description.
* [FIX] account_invoice_refund_link: Don't copy m2m fields

Many2many fields have copy=True property by default, having
an incorrect duplication of origin or refund invoices.

Steps to reproduce:

* Create an invoice
* Refund it
* Duplicate the original invoice
* The refund will be link to 2 original invoices

Included tests covering the use cases for avoiding future regressions.
Since v11, Odoo counts with a field called `refund_invoice_ids` of type
one2many, which conflicts with the m2m field defined in this module.
Moreover, these fields are not needed anymore.

There is only 2 OCA modules using this module right now, and they
don't need significant changes for this adaptation, but I will do it
when this get merged.
Currently translated at 100.0% (17 of 17 strings)

Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_refund_link/de/
Currently translated at 100.0% (17 of 17 strings)

Translation: account-invoicing-12.0/account-invoicing-12.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-12-0/account-invoicing-12-0-account_invoice_refund_link/pt_BR/
Currently translated at 100.0% (11 of 11 strings)

Translation: account-invoicing-13.0/account-invoicing-13.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-13-0/account-invoicing-13-0-account_invoice_refund_link/pt_BR/
OCA-git-bot and others added 11 commits December 22, 2022 09:34
Currently translated at 91.6% (11 of 12 strings)

Translation: account-invoicing-15.0/account-invoicing-15.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-15-0/account-invoicing-15-0-account_invoice_refund_link/ca/
With the previous algorithm, if something modifies the order of the
returned lines, there are chances of linking invoice lines with non
refund lines (but other journal items).

We assure at least that only refund lines are linked restricting the
iteration on them.

TT38633
@fcvalgar
Copy link

Hi @ljsalvatierra-factorlibre , can you rebase? Please

@ljsalvatierra-factorlibre
Copy link
Author

Hi @ljsalvatierra-factorlibre , can you rebase? Please

Yes, done!

@fcvalgar
Copy link

@ljsalvatierra-factorlibre

I get some errors when I try to access the credit notes from the "Refunds" tab.

https://www.loom.com/share/5e13258bd407463496bd49aaf1d5a379

Thank you.

Internal MT-1861 @moduon

@ljsalvatierra-factorlibre
Copy link
Author

ljsalvatierra-factorlibre commented Dec 22, 2022

@ljsalvatierra-factorlibre

I get some errors when I try to access the credit notes from the "Refunds" tab.

https://www.loom.com/share/5e13258bd407463496bd49aaf1d5a379

Thank you.

Internal MT-1861 @moduon

Thank you for the review, i'll check it.


Edit:

Related to odoo/odoo#106295


Edit:

I've added a form view inside the field and works fine.

imagen

imagen

@ljsalvatierra-factorlibre
Copy link
Author

Hi, is it ok to merge? Can anyone please take a look?

Copy link

@fcvalgar fcvalgar left a comment

Choose a reason for hiding this comment

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

LGTM, 👍

Thank you @ljsalvatierra-factorlibre

Copy link
Member

@rafaelbn rafaelbn left a comment

Choose a reason for hiding this comment

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

Thank you! 👍

/ocabot merge patch

@OCA-git-bot
Copy link
Contributor

Hey, thanks for contributing! Proceeding to merge this for you.
Prepared branch 16.0-ocabot-merge-pr-1264-by-rafaelbn-bump-patch, awaiting test results.

@OCA-git-bot OCA-git-bot merged commit 52e92a5 into OCA:16.0 Jan 26, 2023
@OCA-git-bot
Copy link
Contributor

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

@ljsalvatierra-factorlibre
Copy link
Author

LGTM, +1

Thank you @ljsalvatierra-factorlibre

Thank you for your time!

@ljsalvatierra-factorlibre
Copy link
Author

Thank you! +1

/ocabot merge patch

Thank you :)

@ljsalvatierra-factorlibre ljsalvatierra-factorlibre deleted the 16.0-mig-account_invoice_refund_link branch January 26, 2023 14:35
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.