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

[17.0][MIG] account_invoice_refund_link: Migration to 17.0 #1670

Merged
merged 45 commits into from
May 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
067c31b
account_refund_original
antespi Jul 25, 2016
218a77e
remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
06117bd
Make modules uninstallable
pedrobaeza Oct 6, 2016
246b152
Rename manifest files
pedrobaeza Oct 6, 2016
03d9a43
account_invoice_refund_link: Improvements + cleaning
pedrobaeza Dec 11, 2016
ad9cd90
account_invoice_refund_link: Migrated to 10.0
luismontalba Apr 10, 2017
24ed5d1
fix init hook by matching invoices and refunds only if in same company
Jul 6, 2017
e2e0eb1
account_invoice_refund_link: Don't copy m2m fields (#339)
pedrobaeza Nov 30, 2017
2e301ec
account_invoice_refund_link: Migration to 11.0
oihane Oct 25, 2017
1b286b8
account_invoice_refund_link: Don't choke with standard fields
pedrobaeza Mar 29, 2018
9101b66
account_invoice_refund_link: Pylint
pedrobaeza Mar 29, 2018
9952ff1
[MIG] account_invoice_refund_link v11 to v12
Nikul-Chaudhary Jan 27, 2019
0d40159
Translated using Weblate (German)
marylla Jul 17, 2019
45716b4
Translated using Weblate (Portuguese (Brazil))
Sep 23, 2019
429bff6
[IMP] account_invoice_refund_link: black, isort
ernestotejeda Jan 20, 2020
5cd0749
[MIG] account_invoice_refund_link: Migration to 13.0
ernestotejeda Jan 21, 2020
99ae01d
Translated using Weblate (Portuguese (Brazil))
Jul 1, 2020
2b9ecec
[FIX] account_invoice_refund_link: Fix foreignkey exception when a cr…
sergio-teruel Jul 14, 2020
8c7ae8d
Translated using Weblate (Portuguese (Brazil))
Aug 12, 2020
52e99f9
[OU] account_invoice_refund_link: Migration scripts
pedrobaeza Dec 4, 2020
bff34b3
[MIG] account_invoice_refund_link: Migration to 14.0
joao-p-marques Feb 1, 2021
b9cdf11
Translated using Weblate (Spanish)
anasuarez1 Mar 10, 2021
833a960
Translated using Weblate (French)
Yvesldff Mar 22, 2021
84ace3a
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 31, 2021
05e0954
Translated using Weblate (French (France))
Yvesldff Apr 6, 2021
e34353d
Translated using Weblate (Portuguese (Portugal))
pedrocs-exo Sep 4, 2021
66df5b4
[UPD] README.rst
OCA-git-bot Nov 11, 2021
743fc11
[14.0][IMP] acount_invoice_refund_link: add index
acsonefho Nov 16, 2021
0fa7c9f
[MIG] account_invoice_refund_link: Migration to 15.0
koenloodts Dec 17, 2021
d4d8b7f
[FIX] account_invoice_refund_link: Fix development_status
ValentinVinagre Dec 28, 2021
948d83f
[15.0][MIG] account_invoice_tree_currency: Migration to 15.0
OriolVForgeFlow Nov 24, 2021
754696d
Translated using Weblate (Catalan)
pablontura Apr 27, 2022
ff763fa
[FIX] account_invoice_refund_link: Don't link incorrect lines
pedrobaeza Aug 23, 2022
96b2617
[MIG] account_invoice_refund_link: Migration to 16.0
ljsalvatierra-factorlibre Oct 14, 2022
e196473
Translated using Weblate (Croatian)
badbole Jan 30, 2023
a20ef81
Translated using Weblate (Portuguese)
pedrocs-exo Feb 27, 2023
e3d53c5
[FIX] account_invoice_refund_link: Exclude section/notes origin lines
Feb 27, 2023
e7f1b01
[16.0][IMP] added tree with refunded lines
andrel-exo Jul 24, 2023
10cb7da
[IMP] account_invoice_refund_link: Make more reliable the linking
pedrobaeza Aug 7, 2023
66bb851
Translated using Weblate (Spanish)
Ivorra78 Oct 10, 2023
a552450
[IMP] account_invoice_refund_link: test performance improvement
josep-tecnativa Oct 13, 2023
00f77fe
Translated using Weblate (Portuguese (Brazil))
adrianojprado Oct 30, 2023
298bde3
Translated using Weblate (Italian)
mymage Feb 21, 2024
de586d6
[IMP] account_invoice_refund_link: pre-commit auto fixes
andrel-exo Mar 26, 2024
676f4d8
[MIG] account_invoice_refund_link: Migration to 17.0
andrel-exo Mar 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
108 changes: 108 additions & 0 deletions account_invoice_refund_link/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
=========================================================
Show links between refunds and their originator invoices.
=========================================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:286526503a580a6b353644a86704c9f0fe3417cdb42ef540b659c2e9ea00f119
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |badge1| image:: https://img.shields.io/badge/maturity-Mature-brightgreen.png
:target: https://odoo-community.org/page/development-status
:alt: Mature
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Faccount--invoicing-lightgray.png?logo=github
:target: https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_refund_link
:alt: OCA/account-invoicing
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/account-invoicing-17-0/account-invoicing-17-0-account_invoice_refund_link
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
:target: https://runboat.odoo-community.org/builds?repo=OCA/account-invoicing&target_branch=17.0
:alt: Try me on Runboat

|badge1| |badge2| |badge3| |badge4| |badge5|

This module shows the links between refunds and their original invoices
in the invoice form and also keep track of refund lines and their
original invoice lines.

**Table of contents**

.. contents::
:local:

Usage
=====

To use this module, you need to:

1. Go to "Invoicing -> customers -> Invoices", create an Invoice and
validate it by clicking on the 'Confirm' button.
2. Create a Credit Note by clicking on the 'Add Credit Note' button.
3. In the form view of that Credit Note you can see the new field
'Invoice reference' that is a link to the Original Invoice (the one
you created in step 1)
4. Come back to the original Invoice created in step 1 and you will see
a new page in the notebook called 'Refunds'. There will be the Credit
Note that you created in the previous step.

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/OCA/account-invoicing/issues>`_.
In case of trouble, please check there if your issue has already been reported.
If you spotted it first, help us to smash it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_refund_link%0Aversion:%2017.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
-------

* Pexego
* Tecnativa

Contributors
------------

- Pexego Sistemas Informáticos. (http://pexego.es)

- Nikul Chaudhary <[email protected]>

- `Tecnativa <https://www.tecnativa.com>`__:

- Pedro M. Baeza
- Antonio Espinosa
- Luis M. Ontalba
- Ernesto Tejeda
- João Marques

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

- Luis J. Salvatierra <[email protected]>

Maintainers
-----------

This module is maintained by the OCA.

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

This module is part of the `OCA/account-invoicing <https://github.com/OCA/account-invoicing/tree/17.0/account_invoice_refund_link>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
5 changes: 5 additions & 0 deletions account_invoice_refund_link/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
from .hooks import post_init_hook
19 changes: 19 additions & 0 deletions account_invoice_refund_link/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright 2004-2011 Pexego Sistemas Informáticos. (http://pexego.es)
# Copyright 2016 Antonio Espinosa <[email protected]>
# Copyright 2021 Tecnativa - João Marques
# Copyright 2014-2023 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Show links between refunds and their originator invoices.",
"version": "17.0.1.0.0",
"development_status": "Mature",
"category": "Accounting & Finance",
"website": "https://github.com/OCA/account-invoicing",
"author": "Pexego, Tecnativa, Odoo Community Association (OCA)",
"installable": True,
"post_init_hook": "post_init_hook",
"depends": ["account"],
"license": "AGPL-3",
"data": ["views/account_invoice_view.xml"],
}
34 changes: 34 additions & 0 deletions account_invoice_refund_link/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright 2016 Antonio Espinosa <[email protected]>
# Copyright 2017-2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).


def match_origin_lines(refund):
"""Try to match lines by product or by description."""
invoice = refund.reversed_entry_id
invoice_lines = invoice.invoice_line_ids
for refund_line in refund.invoice_line_ids:
for invoice_line in invoice_lines:
match = (
refund_line.product_id
and refund_line.product_id == invoice_line.product_id
or refund_line.name == invoice_line.name
)
if match:
invoice_lines -= invoice_line
refund_line.origin_line_id = invoice_line.id
break
if not invoice_lines:
break


def post_init_hook(env):
# Linking all refund invoices to its original invoices
refunds = env["account.move"].search(
[
("move_type", "in", ("out_refund", "in_refund")),
("reversed_entry_id", "!=", False),
]
)
for refund in refunds:
match_origin_lines(refund)
76 changes: 76 additions & 0 deletions account_invoice_refund_link/i18n/account_invoice_refund_link.pot
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_refund_link
#
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 16.0\n"
"Report-Msgid-Bugs-To: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: \n"

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move_reversal
msgid "Account Move Reversal"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Invoice reference"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move_line__origin_line_id
msgid "Original invoice line"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,help:account_invoice_refund_link.field_account_move_line__origin_line_id
msgid "Original invoice line to which this refund invoice line is referred to"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_bank_statement_line__refund_invoice_ids
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move__refund_invoice_ids
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_payment__refund_invoice_ids
msgid "Refund Invoices"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move_line__refund_line_ids
msgid "Refund invoice lines"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,help:account_invoice_refund_link.field_account_move_line__refund_line_ids
msgid "Refund invoice lines created from this invoice line"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Refunds"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Status"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Total"
msgstr ""
85 changes: 85 additions & 0 deletions account_invoice_refund_link/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_refund_link
#
# Translators:
# OCA Transbot <[email protected]>, 2017
msgid ""
msgstr ""
"Project-Id-Version: Odoo Server 11.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-04-11 02:41+0000\n"
"PO-Revision-Date: 2018-04-11 02:41+0000\n"
"Last-Translator: OCA Transbot <[email protected]>, 2017\n"
"Language-Team: Arabic (https://www.transifex.com/oca/teams/23907/ar/)\n"
"Language: ar\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: \n"
"Plural-Forms: nplurals=6; plural=n==0 ? 0 : n==1 ? 1 : n==2 ? 2 : n%100>=3 "
"&& n%100<=10 ? 3 : n%100>=11 && n%100<=99 ? 4 : 5;\n"

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move_reversal
msgid "Account Move Reversal"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
#, fuzzy
msgid "Invoice reference"
msgstr "خط الفاتورة"

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model,name:account_invoice_refund_link.model_account_move_line
msgid "Journal Item"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move_line__origin_line_id
msgid "Original invoice line"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,help:account_invoice_refund_link.field_account_move_line__origin_line_id
msgid "Original invoice line to which this refund invoice line is referred to"
msgstr ""

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_bank_statement_line__refund_invoice_ids
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move__refund_invoice_ids
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_payment__refund_invoice_ids
#, fuzzy
msgid "Refund Invoices"
msgstr "فاتورة"

#. module: account_invoice_refund_link
#: model:ir.model.fields,field_description:account_invoice_refund_link.field_account_move_line__refund_line_ids
#, fuzzy
msgid "Refund invoice lines"
msgstr "خط الفاتورة"

#. module: account_invoice_refund_link
#: model:ir.model.fields,help:account_invoice_refund_link.field_account_move_line__refund_line_ids
msgid "Refund invoice lines created from this invoice line"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Refunds"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Status"
msgstr ""

#. module: account_invoice_refund_link
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_link.view_customer_account_invoice_add_refunds_details_form
msgid "Total"
msgstr "الإجمالي"
Loading
Loading