Skip to content

Commit

Permalink
Merge PR #1755 into 16.0
Browse files Browse the repository at this point in the history
Signed-off-by etobella
  • Loading branch information
OCA-git-bot committed Dec 24, 2024
2 parents 331c542 + 7cb635c commit 7d9c948
Show file tree
Hide file tree
Showing 16 changed files with 664 additions and 0 deletions.
85 changes: 85 additions & 0 deletions account_invoice_refund_reinvoice/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
================================
Account Invoice Reinvoice Refund
================================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0679baddee2cc65b210233266f9d307a7ecbcfdc1b03832f64ebfcffd96a17b5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |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/16.0/account_invoice_refund_reinvoice
: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-16-0/account-invoicing-16-0-account_invoice_refund_reinvoice
: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=16.0
:alt: Try me on Runboat

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

This addon allows to restore a refund keeping all it's data.
It is useful when the invoice is linked to a Sale Order or Purchase Order,
this way no information is lost.

**Table of contents**

.. contents::
:local:

Usage
=====

* Access a refund
* Press on `Restore Credit Note`
* A new invoice is created using the same information

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_reinvoice%0Aversion:%2016.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
~~~~~~~

* Creu Blanca

Contributors
~~~~~~~~~~~~

* Enric Tobella

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/16.0/account_invoice_refund_reinvoice>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
1 change: 1 addition & 0 deletions account_invoice_refund_reinvoice/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import models
14 changes: 14 additions & 0 deletions account_invoice_refund_reinvoice/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright 2021 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "Account Invoice Reinvoice Refund",
"summary": """
Allow to Reinvoice a Refund""",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
"depends": ["account"],
"data": ["views/account_move.xml"],
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# Translation of Odoo Server.
# This file contains the translation of the following modules:
# * account_invoice_refund_reinvoice
#
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_reinvoice
#: model:ir.model,name:account_invoice_refund_reinvoice.model_account_move
msgid "Journal Entry"
msgstr ""

#. module: account_invoice_refund_reinvoice
#: model_terms:ir.ui.view,arch_db:account_invoice_refund_reinvoice.account_move_form_view
msgid "Restore Credit Note"
msgstr ""

#. module: account_invoice_refund_reinvoice
#: code:addons/account_invoice_refund_reinvoice/models/account_move.py:0
#, python-format
msgid "Reversal of: %s"
msgstr ""
1 change: 1 addition & 0 deletions account_invoice_refund_reinvoice/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from . import account_move
28 changes: 28 additions & 0 deletions account_invoice_refund_reinvoice/models/account_move.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Copyright 2021 Creu Blanca
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import _, models

from odoo.addons.account.models.account_move import TYPE_REVERSE_MAP

TYPE_REVERSE_MAP.update({"out_refund": "out_invoice", "in_refund": "in_invoice"})


class AccountMove(models.Model):

_inherit = "account.move"

def _prepare_reinvoice_reversal(self):
return {
"ref": _("Reversal of: %s") % (self.name),
"journal_id": self.journal_id.id,
"invoice_payment_term_id": None,
"invoice_user_id": self.invoice_user_id.id,
}

def action_refund_reinvoice(self):
self.ensure_one()
reverse_move = self.with_context(reinvoice_refund=True)._reverse_moves(
[self._prepare_reinvoice_reversal()], False
)
return reverse_move.get_formview_action()
1 change: 1 addition & 0 deletions account_invoice_refund_reinvoice/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Enric Tobella
3 changes: 3 additions & 0 deletions account_invoice_refund_reinvoice/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This addon allows to restore a refund keeping all it's data.
It is useful when the invoice is linked to a Sale Order or Purchase Order,
this way no information is lost.
3 changes: 3 additions & 0 deletions account_invoice_refund_reinvoice/readme/USAGE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
* Access a refund
* Press on `Restore Credit Note`
* A new invoice is created using the same information
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 7d9c948

Please sign in to comment.