Skip to content

Commit

Permalink
[ADD] add rma_sale_reason
Browse files Browse the repository at this point in the history
  • Loading branch information
sbejaoui committed Jul 18, 2024
1 parent d2c1b50 commit b32941b
Show file tree
Hide file tree
Showing 24 changed files with 934 additions and 2 deletions.
1 change: 1 addition & 0 deletions rma_sale/static/src/js/rma_portal_form.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,4 +132,5 @@ odoo.define("rma_sale.animation", function (require) {
$(ev.currentTarget).addClass("bg-primary").addClass("text-primary");
},
});
return publicWidget;
});
7 changes: 5 additions & 2 deletions rma_sale/views/sale_portal_template.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,10 @@
<th class="text-start">Product</th>
<th class="text-end">Quantity</th>
<th class="text-start">Delivery</th>
<th class="text-start">Requested operation</th>
<th
class="text-start"
name="operation"
>Requested operation</th>
<th name="portal_rma_button_desc" />
</tr>
</thead>
Expand Down Expand Up @@ -147,7 +150,7 @@
t-att-value="data['picking'] and data['picking'].id"
/>
</td>
<td class="text-start">
<td class="text-start" name="operation">
<select
t-attf-name="#{data_index}-operation_id"
class="form-control rma-operation"
Expand Down
101 changes: 101 additions & 0 deletions rma_sale_reason/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
===============
Rma Sale Reason
===============

..
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! source digest: sha256:cbc6042f5078d432134c3bb0f3aa3ca2eaaca763041004ab982997f8f44b9a58
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |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%2Frma-lightgray.png?logo=github
:target: https://github.com/OCA/rma/tree/16.0/rma_sale_reason
:alt: OCA/rma
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/rma-16-0/rma-16-0-rma_sale_reason
: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/rma&target_branch=16.0
:alt: Try me on Runboat

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

Getting the information as soon as possible is crucial for any business.
That's why, when creating an RMA order from a sales order, it's more
efficient to give the salesperson the possibility to record the return
reason instead of waiting for the RMA team to do it when they process
the order. This ensures accurate recording of customer issues and
improves data accuracy.

This addon is an extension of the rma_sale and rma_reason addons. It
allows salespersons to specify the return reason when creating the RMA
order from the sales order.

**Table of contents**

.. contents::
:local:

Usage
=====

When creating an RMA from a sale order select the reason for the return.

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

Bugs are tracked on `GitHub Issues <https://github.com/OCA/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/OCA/rma/issues/new?body=module:%20rma_sale_reason%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
-------

* Raumschmiede GmbH
* BCIM
* ACSONE SA/NV

Contributors
------------

- Jacques-Etienne Baudoux - BCIM je@bcim.be
- Souheil Bejaoui - ACSONE SA/NV souheil.bejaoui@acsone.eu.com

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.

.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
:target: https://github.com/sbejaoui
:alt: sbejaoui

Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:

|maintainer-sbejaoui|

This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/16.0/rma_sale_reason>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
2 changes: 2 additions & 0 deletions rma_sale_reason/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from . import controllers
from . import wizards
27 changes: 27 additions & 0 deletions rma_sale_reason/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Raumschmiede GmbH
# Copyright 2024 BCIM
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

{
"name": "Rma Sale Reason",
"version": "16.0.1.0.0",
"license": "AGPL-3",
"author": "Raumschmiede GmbH,BCIM,ACSONE SA/NV,Odoo Community Association (OCA)",
"website": "https://github.com/OCA/rma",
"depends": ["rma_sale", "rma_reason"],
"maintainers": ["sbejaoui"],
"data": [
"wizards/sale_order_rma_wizard.xml",
"views/rma_portal_templates.xml",
],
"demo": [],
"assets": {
"web.assets_frontend": [
"/rma_sale_reason/static/src/js/rma_portal_form.js",
],
"web.assets_tests": [
"/rma_sale_reason/static/src/tests/*.js",
],
},
}
3 changes: 3 additions & 0 deletions rma_sale_reason/controllers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from . import rma_portal
27 changes: 27 additions & 0 deletions rma_sale_reason/controllers/rma_portal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Copyright 2024 Raumschmiede GmbH
# Copyright 2024 BCIM
# Copyright 2024 ACSONE SA/NV
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).

from odoo import http

from odoo.addons.rma_sale.controllers.sale_portal import CustomerPortal


class RmaPortal(CustomerPortal):
@http.route(
["/my/orders/<int:order_id>/requestrma"],
type="http",
auth="public",
methods=["POST"],
website=True,
)
def request_rma(self, order_id, access_token=None, **post):
"""
We used a hidden input to determine whether the reason is required or not.
Now, we remove it from the post data as the base controller puts all custom
inputs in the description field.
"""
if "is_rma_reason_required" in post:
del post["is_rma_reason_required"]
return super().request_rma(order_id, access_token=access_token, **post)
2 changes: 2 additions & 0 deletions rma_sale_reason/readme/CONTRIBUTORS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
- Jacques-Etienne Baudoux - BCIM <je@bcim.be>
- Souheil Bejaoui - ACSONE SA/NV <souheil.bejaoui@acsone.eu.com>
10 changes: 10 additions & 0 deletions rma_sale_reason/readme/DESCRIPTION.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Getting the information as soon as possible is crucial for any business.
That's why, when creating an RMA order from a sales order,
it's more efficient to give the salesperson the possibility to record the
return reason instead of waiting for the RMA team to do it when they process
the order. This ensures accurate recording of customer issues and improves
data accuracy.

This addon is an extension of the rma_sale and rma_reason addons.
It allows salespersons to specify the return reason when creating the RMA
order from the sales order.
1 change: 1 addition & 0 deletions rma_sale_reason/readme/USAGE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
When creating an RMA from a sale order select the reason for the return.
Binary file added rma_sale_reason/static/description/icon.png
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 b32941b

Please sign in to comment.