Initial commit: Odoo 18.0-20251222 extra-addons
Some checks failed
pre-commit / pre-commit (push) Has been cancelled
tests / Detect unreleased dependencies (push) Has been cancelled
tests / test with OCB (push) Has been cancelled
tests / test with Odoo (push) Has been cancelled

This commit is contained in:
tocmo0nlord
2026-03-13 20:43:25 +00:00
parent 36e847a7df
commit adbe430761
9472 changed files with 1265727 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from . import account_move_reversal

View File

@@ -0,0 +1,27 @@
# Copyright (C) 2019 Open Source Integrators
# Copyright (C) 2019 Serpent Consulting Services Pvt. Ltd.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
from odoo import api, fields, models
class AccountMoveReversal(models.TransientModel):
_inherit = "account.move.reversal"
reason_id = fields.Many2one("account.move.refund.reason", string="Refund Reason")
reason = fields.Char(
compute="_compute_reason", precompute=True, store=True, readonly=False
)
@api.depends("reason_id")
def _compute_reason(self):
for record in self:
if record.reason_id:
record.reason = record.reason_id.name
def reverse_moves(self, is_modify=False):
"""Overriden to set the reason_id fields in the new created refunds"""
res = super().reverse_moves(is_modify=is_modify)
self.move_ids.reversal_move_ids.filtered(lambda x: not x.reason_id).write(
{"reason_id": self.reason_id.id}
)
return res

View File

@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8" ?>
<odoo>
<record id="view_account_move_reversal" model="ir.ui.view">
<field name="name">view.account.move.reversal.form</field>
<field name="model">account.move.reversal</field>
<field name="inherit_id" ref="account.view_account_move_reversal" />
<field name="arch" type="xml">
<xpath expr="//field[@name='reason']" position="attributes">
<attribute name="invisible">1</attribute>
<attribute name="required">0</attribute>
</xpath>
<xpath expr="//field[@name='date']" position="before">
<field name="reason_id" required="1" />
</xpath>
</field>
</record>
</odoo>