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
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
64ab342
account_refund_original
antespi Jul 25, 2016
8717093
remove en.po that was erroneously created by transbot
sbidoul Aug 15, 2016
4d3898a
Make modules uninstallable
pedrobaeza Oct 6, 2016
ebaf0a9
Rename manifest files
pedrobaeza Oct 6, 2016
41f2035
account_invoice_refund_link: Improvements + cleaning
pedrobaeza Dec 11, 2016
1063b86
account_invoice_refund_link: Migrated to 10.0
luismontalba Apr 10, 2017
7d5a97c
fix init hook by matching invoices and refunds only if in same company
Jul 6, 2017
14ae19b
account_invoice_refund_link: Don't copy m2m fields (#339)
pedrobaeza Nov 30, 2017
77caabd
account_invoice_refund_link: Migration to 11.0
oihane Oct 25, 2017
46d78d6
account_invoice_refund_link: Don't choke with standard fields
pedrobaeza Mar 29, 2018
287865f
account_invoice_refund_link: Pylint
pedrobaeza Mar 29, 2018
70376dc
[MIG] account_invoice_refund_link v11 to v12
Nikul-Chaudhary Jan 27, 2019
781da69
Translated using Weblate (German)
marylla Jul 17, 2019
7f81713
Translated using Weblate (Portuguese (Brazil))
Sep 23, 2019
612ddb6
[IMP] account_invoice_refund_link: black, isort
ernestotejeda Jan 20, 2020
41fde0d
[MIG] account_invoice_refund_link: Migration to 13.0
ernestotejeda Jan 21, 2020
efa2824
Translated using Weblate (Portuguese (Brazil))
Jul 1, 2020
b347204
[FIX] account_invoice_refund_link: Fix foreignkey exception when a cr…
sergio-teruel Jul 14, 2020
9ef2259
Translated using Weblate (Portuguese (Brazil))
Aug 12, 2020
2ec62e7
[OU] account_invoice_refund_link: Migration scripts
pedrobaeza Dec 4, 2020
268290d
[MIG] account_invoice_refund_link: Migration to 14.0
joao-p-marques Feb 1, 2021
023204d
[UPD] Update account_invoice_refund_link.pot
oca-travis Feb 2, 2021
526c869
[UPD] README.rst
OCA-git-bot Feb 2, 2021
5a68cef
Translated using Weblate (Spanish)
anasuarez1 Mar 10, 2021
147f0b5
Translated using Weblate (French)
Yvesldff Mar 22, 2021
1583a8c
Translated using Weblate (French)
Yvesldff Mar 25, 2021
6b3438a
Translated using Weblate (Spanish (Argentina))
ibuioli Mar 31, 2021
90b03e7
Translated using Weblate (French)
Yvesldff Apr 6, 2021
fefafbb
Translated using Weblate (French (France))
Yvesldff Apr 10, 2021
b0404be
Translated using Weblate (Portuguese (Portugal))
pedrocs-exo Sep 4, 2021
49ba4ec
Translated using Weblate (Portuguese (Portugal))
pedrocs-exo Sep 6, 2021
c9d7d1f
[UPD] README.rst
OCA-git-bot Nov 11, 2021
d48cf80
[UPD] README.rst
OCA-git-bot Nov 11, 2021
f23fa44
[14.0][IMP] acount_invoice_refund_link: add index
acsonefho Nov 16, 2021
18e354f
account_invoice_refund_link 14.0.1.0.1
OCA-git-bot Nov 23, 2021
98a728e
[MIG] account_invoice_refund_link: Migration to 15.0
koenloodts Dec 17, 2021
e6796bd
[UPD] Update account_invoice_refund_link.pot
Dec 23, 2021
4202685
[UPD] README.rst
OCA-git-bot Dec 23, 2021
ac5fd1e
[FIX] account_invoice_refund_link: Fix development_status
ValentinVinagre Dec 28, 2021
5168d88
[UPD] README.rst
OCA-git-bot Dec 28, 2021
3b2d3e8
[15.0][MIG] account_invoice_tree_currency: Migration to 15.0
OriolVForgeFlow Nov 24, 2021
467c6da
[UPD] README.rst
OCA-git-bot Feb 21, 2022
2ef13b6
Translated using Weblate (Catalan)
pablontura Apr 27, 2022
4e08024
[FIX] account_invoice_refund_link: Don't link incorrect lines
pedrobaeza Aug 23, 2022
fe4a990
account_invoice_refund_link 15.0.1.0.1
OCA-git-bot Aug 24, 2022
e11f429
[MIG] account_invoice_refund_link: Migration to 16.0
ljsalvatierra-factorlibre Oct 14, 2022
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
99 changes: 99 additions & 0 deletions account_invoice_refund_link/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
=========================================================
Show links between refunds and their originator invoices.
=========================================================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

.. |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/15.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-15-0/account-invoicing-15-0-account_invoice_refund_link
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/95/15.0
:alt: Try me on Runbot

|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:

#. Go to "Invoicing -> customers -> Invoices", create an Invoice
and validate it by clicking on the 'Confirm' button.
#. Create a Credit Note by clicking on the 'Add Credit Note' button.
#. 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)
#. 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 smashing it by providing a detailed and welcomed
`feedback <https://github.com/OCA/account-invoicing/issues/new?body=module:%20account_invoice_refund_link%0Aversion:%2015.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

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/15.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 2014-2017 Pedro M. Baeza <[email protected]>
# Copyright 2021 Tecnativa - João Marques
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Show links between refunds and their originator invoices.",
"version": "16.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"],
}
37 changes: 37 additions & 0 deletions account_invoice_refund_link/hooks.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# 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).

from odoo import SUPERUSER_ID, api


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(cr, registry):
env = api.Environment(cr, SUPERUSER_ID, {})
# 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 15.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 ""
83 changes: 83 additions & 0 deletions account_invoice_refund_link/i18n/ar.po
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
# 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 Entries"
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_move__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