Initial commit: Odoo 18.0-20251222 extra-addons
This commit is contained in:
1
sale_credit_note_reversal/models/__init__.py
Normal file
1
sale_credit_note_reversal/models/__init__.py
Normal file
@@ -0,0 +1 @@
|
||||
from . import account_move
|
||||
17
sale_credit_note_reversal/models/account_move.py
Normal file
17
sale_credit_note_reversal/models/account_move.py
Normal file
@@ -0,0 +1,17 @@
|
||||
# Copyright 2024 ForgeFlow (http://www.forgeflow.com)
|
||||
# License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html).
|
||||
from odoo import models
|
||||
|
||||
|
||||
class AccountMove(models.Model):
|
||||
_inherit = "account.move"
|
||||
|
||||
def _reverse_moves(self, default_values_list=None, cancel=False):
|
||||
reversed_moves = super()._reverse_moves(
|
||||
default_values_list=default_values_list, cancel=cancel
|
||||
)
|
||||
for move in reversed_moves:
|
||||
if move.reversed_entry_id.move_type == "out_refund":
|
||||
# convert from entry to out_invoice
|
||||
move.move_type = "out_invoice"
|
||||
return reversed_moves
|
||||
Reference in New Issue
Block a user