From c141fd0660b9520b24e6be276d184673177f46e0 Mon Sep 17 00:00:00 2001 From: hveficent Date: Mon, 20 Jan 2020 08:10:19 +0100 Subject: [PATCH] RMA as an APP --- rma/README.rst | 55 +++++++------ rma/__init__.py | 2 +- rma/__manifest__.py | 6 +- rma/data/rma_sequence.xml | 3 + rma/models/__init__.py | 1 + rma/models/procurement.py | 2 +- rma/models/product.py | 2 +- .../res_config_settings.py} | 4 +- rma/models/rma_order.py | 2 +- rma/models/rma_order_line.py | 2 +- rma/models/stock.py | 2 +- rma/models/stock_warehouse.py | 6 +- rma/readme/CONFIGURE.rst | 41 ++++++++++ rma/readme/CONTRIBUTORS.rst | 8 ++ rma/readme/DESCRIPTION.rst | 18 +++++ rma/readme/ROADMAP.rst | 6 ++ rma/readme/USAGE.rst | 12 +++ rma/tests/__init__.py | 2 +- rma/views/res_config_settings_views.xml | 52 +++++++++++++ rma/views/rma_menu.xml | 78 +++++++++++++++++++ rma/views/rma_operation_view.xml | 14 ---- rma/views/rma_order_line_view.xml | 25 ++---- rma/views/rma_order_view.xml | 32 -------- rma/wizards/__init__.py | 3 +- rma/wizards/rma_add_stock_move.py | 2 +- rma/wizards/rma_make_picking.py | 2 +- rma/wizards/stock_config_settings.xml | 37 --------- 27 files changed, 278 insertions(+), 141 deletions(-) rename rma/{wizards/stock_config_settings.py => models/res_config_settings.py} (85%) create mode 100644 rma/readme/CONFIGURE.rst create mode 100644 rma/readme/CONTRIBUTORS.rst create mode 100644 rma/readme/DESCRIPTION.rst create mode 100644 rma/readme/ROADMAP.rst create mode 100644 rma/readme/USAGE.rst create mode 100644 rma/views/res_config_settings_views.xml create mode 100644 rma/views/rma_menu.xml delete mode 100644 rma/wizards/stock_config_settings.xml diff --git a/rma/README.rst b/rma/README.rst index bc583e48..4cf46b44 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -1,6 +1,3 @@ -.. image:: https://img.shields.io/badge/licence-LGPL--3-blue.svg - :alt: License LGPL-3 - ====================================== RMA (Return Merchandise Authorization) ====================================== @@ -24,12 +21,16 @@ of the product to the manufacturer, commonly referred to as a return. As returns are costly for the vendor and inconvenient for the customer, any return that can be prevented benefits both parties. +**Table of contents** + +.. contents:: + :local: Configuration ============= Security --------- +~~~~~~~~ Go to Settings > Users and assign the appropiate permissions to users. Different security groups grant distinct levels of access to the RMA features. @@ -41,7 +42,7 @@ Different security groups grant distinct levels of access to the RMA features. associated to both customers and suppliers. RMA Approval Policy -------------------- +~~~~~~~~~~~~~~~~~~~ There are two RMA approval policies in product catogories: @@ -57,12 +58,12 @@ steps: #. Select one and change the field *RMA Approval Policy* to your convenience. Other Settings --------------- +~~~~~~~~~~~~~~ -#. Go to Inventory > Configuration > Settings > Return Merchandising +#. Go to RMA > Configuration > Settings > Return Merchandising Authorization and select the option "Display 3 fields on rma: partner, invoice address, delivery address" if needed. -#. Go to Inventory > Configuration > Warehouse management > Warehouses and add +#. Go to RMA > Configuration > Warehouse management > Warehouses and add a default RMA location and RMA picking type for customers and suppliers RMA picking type. In case the warehouse is configured to use routes, you need to create at least one route per rma type with at least two push rules (one for @@ -86,8 +87,8 @@ Create an RMA: Order". #. Go back to the RMA. Set the RMA to done if not further action is required. -Known issues and Roadmap -======================== +Known issues / Roadmap +====================== * Picking operations report in customer RMA dropshipping case is showing "Vendor Address" while it should be "Customer Address". @@ -99,27 +100,37 @@ Known issues and Roadmap Bug Tracker =========== -Bugs are tracked on `GitHub Issues -`_. In case of trouble, please -check there if your issue has already been reported. If you spotted it first, -help us smashing it by providing a detailed and welcomed feedback. +Bugs are tracked on `GitHub Issues `_. +In case of trouble, please check there if your issue has already been reported. +If you spotted it first, help us smashing it by providing a detailed and welcomed +`feedback `_. +Do not contact contributors directly about support or help with technical issues. Credits ======= -Contributors ------------- +Authors +~~~~~~~ -* Jordi Ballester Alomar -* Aaron Henriquez -* Lois Rilo +* ForgeFlow S.L. + +Contributors +~~~~~~~~~~~~ + +* Jordi Ballester Alomar +* Aaron Henriquez +* Lois Rilo * Bhavesh Odedra * Akim Juillerat * Alexandre Fayolle * Chafique Delli +* Héctor Villarreal -Maintainer ----------- +Maintainers +~~~~~~~~~~~ + +This module is maintained by the ForgeFlow. + +This module is part of the `ForgeFlow/stock-rma `_ project on GitHub. -This module is maintained by ForgeFlow. diff --git a/rma/__init__.py b/rma/__init__.py index 4d1a3fe7..79030e0e 100644 --- a/rma/__init__.py +++ b/rma/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from . import models diff --git a/rma/__manifest__.py b/rma/__manifest__.py index 0f15dd07..873c7b36 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) { @@ -27,10 +27,12 @@ "views/stock_warehouse.xml", "views/product_view.xml", "views/res_partner_view.xml", + "views/res_config_settings_views.xml", + "views/rma_menu.xml", "wizards/rma_make_picking_view.xml", "wizards/rma_add_stock_move_view.xml", - "wizards/stock_config_settings.xml", "wizards/rma_order_line_make_supplier_rma_view.xml", ], "installable": True, + "application": True, } diff --git a/rma/data/rma_sequence.xml b/rma/data/rma_sequence.xml index cca2b65a..d025881e 100644 --- a/rma/data/rma_sequence.xml +++ b/rma/data/rma_sequence.xml @@ -16,6 +16,7 @@ RTVG/%(year)s/ + @@ -25,6 +26,7 @@ RMA/%(year)s/ + @@ -34,6 +36,7 @@ RTV/%(year)s/ + diff --git a/rma/models/__init__.py b/rma/models/__init__.py index 1a7cbc3c..ae4f5826 100644 --- a/rma/models/__init__.py +++ b/rma/models/__init__.py @@ -10,3 +10,4 @@ from . import product_category from . import procurement from . import res_partner from . import res_company +from . import res_config_settings diff --git a/rma/models/procurement.py b/rma/models/procurement.py index bfe1821b..132376a9 100644 --- a/rma/models/procurement.py +++ b/rma/models/procurement.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from odoo import fields, models diff --git a/rma/models/product.py b/rma/models/product.py index 112e1c16..418e6860 100644 --- a/rma/models/product.py +++ b/rma/models/product.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from odoo import fields, models diff --git a/rma/wizards/stock_config_settings.py b/rma/models/res_config_settings.py similarity index 85% rename from rma/wizards/stock_config_settings.py rename to rma/models/res_config_settings.py index b2668d1a..4d889880 100644 --- a/rma/wizards/stock_config_settings.py +++ b/rma/models/res_config_settings.py @@ -1,10 +1,10 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from odoo import fields, models -class StockConfigSettings(models.TransientModel): +class ResConfigSettings(models.TransientModel): _inherit = "res.config.settings" group_rma_delivery_address = fields.Boolean( diff --git a/rma/models/rma_order.py b/rma/models/rma_order.py index 3dbb31f6..c84ddc80 100644 --- a/rma/models/rma_order.py +++ b/rma/models/rma_order.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from datetime import datetime diff --git a/rma/models/rma_order_line.py b/rma/models/rma_order_line.py index 045fd340..1cc7753d 100644 --- a/rma/models/rma_order_line.py +++ b/rma/models/rma_order_line.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) import operator diff --git a/rma/models/stock.py b/rma/models/stock.py index e7ece0b7..60ec2ebe 100644 --- a/rma/models/stock.py +++ b/rma/models/stock.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from odoo import api, fields, models diff --git a/rma/models/stock_warehouse.py b/rma/models/stock_warehouse.py index 238def19..6273c771 100644 --- a/rma/models/stock_warehouse.py +++ b/rma/models/stock_warehouse.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from odoo import _, fields, models @@ -114,6 +114,7 @@ class StockWarehouse(models.Model): "default_location_dest_id": customer_loc.id, "sequence": max_sequence, "color": color, + "sequence_code": "RMA → Customer", } ) # create rma_sup_out_type_id: @@ -129,6 +130,7 @@ class StockWarehouse(models.Model): "default_location_dest_id": supplier_loc.id, "sequence": max_sequence, "color": color, + "sequence_code": "Customer → RMA", } ) # create rma_cust_in_type_id: @@ -144,6 +146,7 @@ class StockWarehouse(models.Model): "default_location_dest_id": wh.lot_rma_id.id, "sequence": max_sequence, "color": color, + "sequence_code": "RMA -> Supplier", } ) # create rma_sup_in_type_id: @@ -159,6 +162,7 @@ class StockWarehouse(models.Model): "default_location_dest_id": wh.lot_rma_id.id, "sequence": max_sequence, "color": color, + "sequence_code": "Supplier -> RMA", } ) wh.write( diff --git a/rma/readme/CONFIGURE.rst b/rma/readme/CONFIGURE.rst new file mode 100644 index 00000000..740b1e14 --- /dev/null +++ b/rma/readme/CONFIGURE.rst @@ -0,0 +1,41 @@ +Security +-------- + +Go to Settings > Users and assign the appropiate permissions to users. +Different security groups grant distinct levels of access to the RMA features. + +* Users in group "RMA Customer User" or "RMA Supplier User" can access to, + create and process RMA's associated to customers or suppliers respectively. + +* Users in group "RMA Manager" can access to, create, approve and process RMA's + associated to both customers and suppliers. + +RMA Approval Policy +------------------- + +There are two RMA approval policies in product catogories: + +* One step: Always auto-approve RMAs that only contain products within + categories with this policy. +* Two steps: A RMA order containing a product within a category with this + policy will request the RMA manager approval. + +In order to change the approval policy of a product category follow the next +steps: + +#. Go to *Inventory > Configuration > Products > Product Categories*. +#. Select one and change the field *RMA Approval Policy* to your convenience. + +Other Settings +-------------- + +#. Go to RMA > Configuration > Settings > Return Merchandising + Authorization and select the option "Display 3 fields on rma: partner, + invoice address, delivery address" if needed. +#. Go to RMA > Configuration > Warehouse management > Warehouses and add + a default RMA location and RMA picking type for customers and suppliers RMA + picking type. In case the warehouse is configured to use routes, you need to + create at least one route per rma type with at least two push rules (one for + inbound another for outbound) it's very important to select the type of + operation supplier if we are moving in the company and customer if we are + moving out of the company. diff --git a/rma/readme/CONTRIBUTORS.rst b/rma/readme/CONTRIBUTORS.rst new file mode 100644 index 00000000..61bac6ba --- /dev/null +++ b/rma/readme/CONTRIBUTORS.rst @@ -0,0 +1,8 @@ +* Jordi Ballester Alomar +* Aaron Henriquez +* Lois Rilo +* Bhavesh Odedra +* Akim Juillerat +* Alexandre Fayolle +* Chafique Delli +* Héctor Villarreal diff --git a/rma/readme/DESCRIPTION.rst b/rma/readme/DESCRIPTION.rst new file mode 100644 index 00000000..6ca0172a --- /dev/null +++ b/rma/readme/DESCRIPTION.rst @@ -0,0 +1,18 @@ +A Return Merchandise Authorization (RMA), is a part of the process of +returning a product in order to receive a refund, replacement, or repair +during the product's warranty period. + +The purchaser of the product must contact the manufacturer (or distributor +or retailer) to obtain authorization to return the product. + +The resulting RMA number must be displayed on or included in the returned +product's packaging. + +The issuance of an RMA is a key gatekeeping moment in the reverse logistics +cycle, providing the vendor with a final opportunity to diagnose and correct +the customer's problem with the product (such as improper installation or +configuration) before the customer permanently relinquishes ownership +of the product to the manufacturer, commonly referred to as a return. + +As returns are costly for the vendor and inconvenient for the customer, +any return that can be prevented benefits both parties. diff --git a/rma/readme/ROADMAP.rst b/rma/readme/ROADMAP.rst new file mode 100644 index 00000000..ca6afe09 --- /dev/null +++ b/rma/readme/ROADMAP.rst @@ -0,0 +1,6 @@ +* Picking operations report in customer RMA dropshipping case is showing + "Vendor Address" while it should be "Customer Address". +* Dropshipping always counted as a delivery on the smart buttons. +* Uninstall hook. +* Constraints instead of required fields on rma.order.line. +* Rename type field on rma.order and rma.order.line diff --git a/rma/readme/USAGE.rst b/rma/readme/USAGE.rst new file mode 100644 index 00000000..b0ee9ff4 --- /dev/null +++ b/rma/readme/USAGE.rst @@ -0,0 +1,12 @@ +RMA are accessible though Inventory menu. There's four menus, divided by type. +Users can access to the list of RMA or RMA lines. + +Create an RMA: + +#. Select a partner. Enter RMA lines associated to an existing picking, or + manually. +#. Request approval and approve. +#. Click on RMA Lines button. +#. Click on more and select an option: "Receive products", "Create Delivery + Order". +#. Go back to the RMA. Set the RMA to done if not further action is required. diff --git a/rma/tests/__init__.py b/rma/tests/__init__.py index f0f79f13..e485a52f 100644 --- a/rma/tests/__init__.py +++ b/rma/tests/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017 ForgeFlow +# Copyright (C) 2017-20 ForgeFlow S.L. # License LGPL-3.0 or later (https://www.gnu.org/licenses/lgpl.html) from . import test_rma diff --git a/rma/views/res_config_settings_views.xml b/rma/views/res_config_settings_views.xml new file mode 100644 index 00000000..a749333a --- /dev/null +++ b/rma/views/res_config_settings_views.xml @@ -0,0 +1,52 @@ + + + + + + res.config.settings.view.form.inherit.rma + res.config.settings + + + + +
+

Return Merchandise Authorization

+
+
+
+ +
+
+
+
+
+
+ +
+
+
+
+
+
+
+
+
+ + + Settings + ir.actions.act_window + res.config.settings + form + inline + {'module' : 'rma'} + + +
diff --git a/rma/views/rma_menu.xml b/rma/views/rma_menu.xml new file mode 100644 index 00000000..b95f3e97 --- /dev/null +++ b/rma/views/rma_menu.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/rma/views/rma_operation_view.xml b/rma/views/rma_operation_view.xml index 46f0f840..8b98317e 100644 --- a/rma/views/rma_operation_view.xml +++ b/rma/views/rma_operation_view.xml @@ -78,18 +78,4 @@ - - - - diff --git a/rma/views/rma_order_line_view.xml b/rma/views/rma_order_line_view.xml index 3d008831..fc203ba5 100644 --- a/rma/views/rma_order_line_view.xml +++ b/rma/views/rma_order_line_view.xml @@ -93,7 +93,7 @@

-

@@ -248,11 +248,12 @@ -