From 7cb635c4610a69226d1de09ef1ea376a728ec984 Mon Sep 17 00:00:00 2001
From: Luis Rodriguez
Date: Tue, 9 Jul 2024 16:07:36 +0200
Subject: [PATCH] [MIG] account_invoice_refund_reinvoice: Migration to 16.0
---
account_invoice_refund_reinvoice/README.rst | 10 +++++-----
.../__manifest__.py | 2 +-
.../models/account_move.py | 14 ++++----------
.../static/description/index.html | 17 +++++++----------
4 files changed, 17 insertions(+), 26 deletions(-)
diff --git a/account_invoice_refund_reinvoice/README.rst b/account_invoice_refund_reinvoice/README.rst
index f0c6fa20aa5..7abab74e9ee 100644
--- a/account_invoice_refund_reinvoice/README.rst
+++ b/account_invoice_refund_reinvoice/README.rst
@@ -17,13 +17,13 @@ Account Invoice Reinvoice Refund
: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_reinvoice
+ :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-15-0/account-invoicing-15-0-account_invoice_refund_reinvoice
+ :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=15.0
+ :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|
@@ -50,7 +50,7 @@ Bug Tracker
Bugs are tracked on `GitHub 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 `_.
+`feedback `_.
Do not contact contributors directly about support or help with technical issues.
@@ -80,6 +80,6 @@ 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 `_ project on GitHub.
+This module is part of the `OCA/account-invoicing `_ project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
diff --git a/account_invoice_refund_reinvoice/__manifest__.py b/account_invoice_refund_reinvoice/__manifest__.py
index f8841dc660a..8eccf21bfa8 100644
--- a/account_invoice_refund_reinvoice/__manifest__.py
+++ b/account_invoice_refund_reinvoice/__manifest__.py
@@ -5,7 +5,7 @@
"name": "Account Invoice Reinvoice Refund",
"summary": """
Allow to Reinvoice a Refund""",
- "version": "15.0.1.0.0",
+ "version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Creu Blanca,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/account-invoicing",
diff --git a/account_invoice_refund_reinvoice/models/account_move.py b/account_invoice_refund_reinvoice/models/account_move.py
index 47442e11e45..0f35bf013b0 100644
--- a/account_invoice_refund_reinvoice/models/account_move.py
+++ b/account_invoice_refund_reinvoice/models/account_move.py
@@ -3,6 +3,10 @@
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):
@@ -16,16 +20,6 @@ def _prepare_reinvoice_reversal(self):
"invoice_user_id": self.invoice_user_id.id,
}
- def _reverse_move_vals(self, default_values, cancel=True):
- if self.env.context.get("reinvoice_refund"):
- if self.move_type == "out_refund":
- default_values["move_type"] = "out_invoice"
- elif self.move_type == "in_refund":
- default_values["move_type"] = "in_invoice"
- return super(AccountMove, self)._reverse_move_vals(
- default_values, cancel=cancel
- )
-
def action_refund_reinvoice(self):
self.ensure_one()
reverse_move = self.with_context(reinvoice_refund=True)._reverse_moves(
diff --git a/account_invoice_refund_reinvoice/static/description/index.html b/account_invoice_refund_reinvoice/static/description/index.html
index 7ffad3ccf37..785e66766cc 100644
--- a/account_invoice_refund_reinvoice/static/description/index.html
+++ b/account_invoice_refund_reinvoice/static/description/index.html
@@ -8,11 +8,10 @@
/*
:Author: David Goodger (goodger@python.org)
-:Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
+:Id: $Id: html4css1.css 8954 2022-01-20 10:10:25Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
-Despite the name, some widely supported CSS2 features are used.
See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
customize this style sheet.
@@ -275,7 +274,7 @@
margin-left: 2em ;
margin-right: 2em }
-pre.code .ln { color: gray; } /* line numbers */
+pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
@@ -301,7 +300,7 @@
span.pre {
white-space: pre }
-span.problematic, pre.problematic {
+span.problematic {
color: red }
span.section-subtitle {
@@ -369,7 +368,7 @@ Account Invoice Reinvoice Refund
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:0679baddee2cc65b210233266f9d307a7ecbcfdc1b03832f64ebfcffd96a17b5
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
-
+
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.
@@ -399,7 +398,7 @@
Bugs are tracked on GitHub 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.
+feedback.
Do not contact contributors directly about support or help with technical issues.
@@ -419,13 +418,11 @@
This module is maintained by the OCA.
-
-
-
+
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 project on GitHub.
+
This module is part of the OCA/account-invoicing project on GitHub.
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.