Skip to content

Commit

Permalink
Merge PR #1264 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by rafaelbn
  • Loading branch information
OCA-git-bot committed Jan 26, 2023
2 parents f6d904d + e11f429 commit 52e92a5
Show file tree
Hide file tree
Showing 88 changed files with 6,833 additions and 0 deletions.
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

0 comments on commit 52e92a5

Please sign in to comment.