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

[18.0][MIG] account_invoice_refund_link: Migration to 18.0 #1850

Merged
merged 55 commits into from
Nov 26, 2024

Conversation

peluko00
Copy link

@peluko00 peluko00 commented Nov 20, 2024

antespi and others added 30 commits November 20, 2024 17:50
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/
Currently translated at 100.0% (12 of 12 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/
Currently translated at 100.0% (12 of 12 strings)

Translation: account-invoicing-14.0/account-invoicing-14.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_invoice_refund_link/es/
Currently translated at 83.3% (10 of 12 strings)

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

Translation: account-invoicing-14.0/account-invoicing-14.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_invoice_refund_link/es_AR/
Currently translated at 91.6% (11 of 12 strings)

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

Translation: account-invoicing-14.0/account-invoicing-14.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-14-0/account-invoicing-14-0-account_invoice_refund_link/pt_PT/
oca-ci and others added 10 commits November 20, 2024 17:50
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

Translation: account-invoicing-17.0/account-invoicing-17.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_invoice_refund_link/
Updated by "Update PO files to match POT (msgmerge)" hook in Weblate.

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

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

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

Translation: account-invoicing-17.0/account-invoicing-17.0-account_invoice_refund_link
Translate-URL: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_invoice_refund_link/pt/
@peluko00 peluko00 mentioned this pull request Nov 20, 2024
13 tasks
Copy link

@mpascuall mpascuall left a comment

Choose a reason for hiding this comment

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

LGTM, tested in runboat

@pedrobaeza
Copy link
Member

/ocabot migration account_invoice_refund_link

@OCA-git-bot OCA-git-bot added this to the 18.0 milestone Nov 21, 2024
Copy link

@ppyczko ppyczko 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

@BernatObrador BernatObrador left a comment

Choose a reason for hiding this comment

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

LGTM

@OCA-git-bot
Copy link
Contributor

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). 🤖

@@ -90,6 +90,10 @@ Contributors

- Luis J. Salvatierra <[email protected]>

- `Factor Libre <https://factorlibre.com>`__:

- Luis J. Salvatierra <[email protected]>
Copy link
Member

Choose a reason for hiding this comment

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

This contributor is being added at 18.0 migration commit, which doesn't sound correct.

Copy link
Author

Choose a reason for hiding this comment

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

Fixed!

@peluko00 peluko00 force-pushed the 18.0-mig-account_invoice_refund_link branch from 803fe04 to 2247877 Compare November 26, 2024 11:15
@peluko00 peluko00 force-pushed the 18.0-mig-account_invoice_refund_link branch from 2247877 to e28fc73 Compare November 26, 2024 11:30
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.

/ocabot merge nobump

@OCA-git-bot
Copy link
Contributor

On my way to merge this fine PR!
Prepared branch 18.0-ocabot-merge-pr-1850-by-pedrobaeza-bump-nobump, awaiting test results.

@OCA-git-bot
Copy link
Contributor

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

@OCA-git-bot OCA-git-bot merged commit c129520 into OCA:18.0 Nov 26, 2024
7 checks passed
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.