Skip to content

Commit 7886fb6

Browse files
committed
[ADD] add rma_sale_reason
1 parent d2c1b50 commit 7886fb6

24 files changed

+937
-2
lines changed

rma_sale/static/src/js/rma_portal_form.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,4 +132,5 @@ odoo.define("rma_sale.animation", function (require) {
132132
$(ev.currentTarget).addClass("bg-primary").addClass("text-primary");
133133
},
134134
});
135+
return publicWidget;
135136
});

rma_sale/views/sale_portal_template.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,10 @@
9292
<th class="text-start">Product</th>
9393
<th class="text-end">Quantity</th>
9494
<th class="text-start">Delivery</th>
95-
<th class="text-start">Requested operation</th>
95+
<th
96+
class="text-start"
97+
name="operation"
98+
>Requested operation</th>
9699
<th name="portal_rma_button_desc" />
97100
</tr>
98101
</thead>
@@ -147,7 +150,7 @@
147150
t-att-value="data['picking'] and data['picking'].id"
148151
/>
149152
</td>
150-
<td class="text-start">
153+
<td class="text-start" name="operation">
151154
<select
152155
t-attf-name="#{data_index}-operation_id"
153156
class="form-control rma-operation"

rma_sale_reason/README.rst

Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
===============
2+
Rma Sale Reason
3+
===============
4+
5+
..
6+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
7+
!! This file is generated by oca-gen-addon-readme !!
8+
!! changes will be overwritten. !!
9+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
10+
!! source digest: sha256:cbc6042f5078d432134c3bb0f3aa3ca2eaaca763041004ab982997f8f44b9a58
11+
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
12+
13+
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
14+
:target: https://odoo-community.org/page/development-status
15+
:alt: Beta
16+
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
17+
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
18+
:alt: License: AGPL-3
19+
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Frma-lightgray.png?logo=github
20+
:target: https://github.com/OCA/rma/tree/16.0/rma_sale_reason
21+
:alt: OCA/rma
22+
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
23+
:target: https://translation.odoo-community.org/projects/rma-16-0/rma-16-0-rma_sale_reason
24+
:alt: Translate me on Weblate
25+
.. |badge5| image:: https://img.shields.io/badge/runboat-Try%20me-875A7B.png
26+
:target: https://runboat.odoo-community.org/builds?repo=OCA/rma&target_branch=16.0
27+
:alt: Try me on Runboat
28+
29+
|badge1| |badge2| |badge3| |badge4| |badge5|
30+
31+
Getting the information as soon as possible is crucial for any business.
32+
That's why, when creating an RMA order from a sales order, it's more
33+
efficient to give the salesperson the possibility to record the return
34+
reason instead of waiting for the RMA team to do it when they process
35+
the order. This ensures accurate recording of customer issues and
36+
improves data accuracy.
37+
38+
This addon is an extension of the rma_sale and rma_reason addons. It
39+
allows salespersons to specify the return reason when creating the RMA
40+
order from the sales order.
41+
42+
**Table of contents**
43+
44+
.. contents::
45+
:local:
46+
47+
Usage
48+
=====
49+
50+
When creating an RMA from a sale order select the reason for the return.
51+
52+
Bug Tracker
53+
===========
54+
55+
Bugs are tracked on `GitHub Issues <https://github.com/OCA/rma/issues>`_.
56+
In case of trouble, please check there if your issue has already been reported.
57+
If you spotted it first, help us to smash it by providing a detailed and welcomed
58+
`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**>`_.
59+
60+
Do not contact contributors directly about support or help with technical issues.
61+
62+
Credits
63+
=======
64+
65+
Authors
66+
-------
67+
68+
* Raumschmiede GmbH
69+
* BCIM
70+
* ACSONE SA/NV
71+
72+
Contributors
73+
------------
74+
75+
- Jacques-Etienne Baudoux - BCIM [email protected]
76+
- Souheil Bejaoui - ACSONE SA/NV [email protected]
77+
78+
Maintainers
79+
-----------
80+
81+
This module is maintained by the OCA.
82+
83+
.. image:: https://odoo-community.org/logo.png
84+
:alt: Odoo Community Association
85+
:target: https://odoo-community.org
86+
87+
OCA, or the Odoo Community Association, is a nonprofit organization whose
88+
mission is to support the collaborative development of Odoo features and
89+
promote its widespread use.
90+
91+
.. |maintainer-sbejaoui| image:: https://github.com/sbejaoui.png?size=40px
92+
:target: https://github.com/sbejaoui
93+
:alt: sbejaoui
94+
95+
Current `maintainer <https://odoo-community.org/page/maintainer-role>`__:
96+
97+
|maintainer-sbejaoui|
98+
99+
This module is part of the `OCA/rma <https://github.com/OCA/rma/tree/16.0/rma_sale_reason>`_ project on GitHub.
100+
101+
You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.

rma_sale_reason/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
from . import controllers
2+
from . import wizards

rma_sale_reason/__manifest__.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2024 Raumschmiede GmbH
2+
# Copyright 2024 BCIM
3+
# Copyright 2024 ACSONE SA/NV
4+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
5+
6+
{
7+
"name": "Rma Sale Reason",
8+
"version": "16.0.1.0.0",
9+
"license": "AGPL-3",
10+
"author": "Raumschmiede GmbH,BCIM,ACSONE SA/NV,Odoo Community Association (OCA)",
11+
"website": "https://github.com/OCA/rma",
12+
"depends": ["rma_sale", "rma_reason"],
13+
"maintainers": ["sbejaoui"],
14+
"data": [
15+
"wizards/sale_order_rma_wizard.xml",
16+
"views/rma_portal_templates.xml",
17+
],
18+
"demo": [],
19+
"assets": {
20+
"web.assets_frontend": [
21+
"/rma_sale_reason/static/src/js/rma_portal_form.js",
22+
],
23+
"web.assets_tests": [
24+
"/rma_sale_reason/static/src/tests/*.js",
25+
],
26+
},
27+
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
2+
3+
from . import rma_portal
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
# Copyright 2024 Raumschmiede GmbH
2+
# Copyright 2024 BCIM
3+
# Copyright 2024 ACSONE SA/NV
4+
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl).
5+
6+
from odoo import http
7+
8+
from odoo.addons.rma_sale.controllers.sale_portal import CustomerPortal
9+
10+
11+
class RmaPortal(CustomerPortal):
12+
@http.route(
13+
["/my/orders/<int:order_id>/requestrma"],
14+
type="http",
15+
auth="public",
16+
methods=["POST"],
17+
website=True,
18+
)
19+
def request_rma(self, order_id, access_token=None, **post):
20+
"""
21+
We used a hidden input to determine whether the reason is required or not.
22+
Now, we remove it from the post data as the base controller puts all custom
23+
inputs in the description field.
24+
"""
25+
if "is_rma_reason_required" in post:
26+
del post["is_rma_reason_required"]
27+
return super().request_rma(order_id, access_token=access_token, **post)
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
- Jacques-Etienne Baudoux - BCIM <[email protected]>
2+
- Souheil Bejaoui - ACSONE SA/NV <[email protected]>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Getting the information as soon as possible is crucial for any business.
2+
That's why, when creating an RMA order from a sales order,
3+
it's more efficient to give the salesperson the possibility to record the
4+
return reason instead of waiting for the RMA team to do it when they process
5+
the order. This ensures accurate recording of customer issues and improves
6+
data accuracy.
7+
8+
This addon is an extension of the rma_sale and rma_reason addons.
9+
It allows salespersons to specify the return reason when creating the RMA
10+
order from the sales order.

rma_sale_reason/readme/USAGE.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
When creating an RMA from a sale order select the reason for the return.

0 commit comments

Comments
 (0)