Skip to content

Commit

Permalink
[14.0][ADD] rma_refund_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrisOForgeFlow authored and AaronHForgeFlow committed Sep 16, 2023
1 parent 3da8341 commit bb66616
Show file tree
Hide file tree
Showing 17 changed files with 602 additions and 0 deletions.
62 changes: 62 additions & 0 deletions rma_refund_reason/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
=============================
RMA Refund Reason Integration
=============================

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:2e403ef31b1be93acf0bed913183ea60c20dc9f6279eee6ae5fab018049bfb44
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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-ForgeFlow%2Fstock--rma-lightgray.png?logo=github
:target: https://github.com/ForgeFlow/stock-rma/tree/14.0/rma_refund_reason
:alt: ForgeFlow/stock-rma

|badge1| |badge2| |badge3|

Add refund reason on rma refund creation process

The default return reason can be configured in the RMA operations

**Table of contents**

.. contents::
:local:

Bug Tracker
===========

Bugs are tracked on `GitHub Issues <https://github.com/ForgeFlow/stock-rma/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/ForgeFlow/stock-rma/issues/new?body=module:%20rma_refund_reason%0Aversion:%2014.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
~~~~~~~

* ForgeFlow S.L.

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

* Christopher Ormaza <[email protected]>

Maintainers
~~~~~~~~~~~

This module is part of the `ForgeFlow/stock-rma <https://github.com/ForgeFlow/stock-rma/tree/14.0/rma_refund_reason>`_ project on GitHub.

You are welcome to contribute.
2 changes: 2 additions & 0 deletions rma_refund_reason/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import models
from . import wizard
19 changes: 19 additions & 0 deletions rma_refund_reason/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (C) 2023 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
"name": "RMA Refund Reason Integration",
"version": "14.0.1.0.0",
"summary": "RMA Refund Reason Integration",
"category": "RMA",
"author": "ForgeFlow S.L.",
"website": "https://github.com/ForgeFlow/stock-rma",
"license": "AGPL-3",
"depends": ["rma_account", "account_invoice_refund_reason"],
"data": [
"views/rma_operation_view.xml",
"views/rma_order_line_view.xml",
],
"installable": True,
"auto_install": True,
}
2 changes: 2 additions & 0 deletions rma_refund_reason/models/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import rma_operation
from . import rma_order_line
14 changes: 14 additions & 0 deletions rma_refund_reason/models/rma_operation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Copyright (C) 2023 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import fields, models


class RmaOperation(models.Model):

_inherit = "rma.operation"

refund_reason_id = fields.Many2one(
comodel_name="account.move.refund.reason",
string="Refund reason",
)
21 changes: 21 additions & 0 deletions rma_refund_reason/models/rma_order_line.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Copyright (C) 2023 ForgeFlow S.L.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from odoo import api, fields, models


class RmaOrderLine(models.Model):

_inherit = "rma.order.line"

refund_reason_id = fields.Many2one(
comodel_name="account.move.refund.reason",
string="Refund reason",
)

@api.onchange("operation_id")
def _onchange_operation_id(self):
result = super(RmaOrderLine, self)._onchange_operation_id()
if self.operation_id:
self.refund_reason_id = self.operation_id.refund_reason_id.id
return result
1 change: 1 addition & 0 deletions rma_refund_reason/readme/CONTRIBUTORS.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* Christopher Ormaza <[email protected]>
3 changes: 3 additions & 0 deletions rma_refund_reason/readme/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Add refund reason on rma refund creation process

The default return reason can be configured in the RMA operations
Loading

0 comments on commit bb66616

Please sign in to comment.