From 7e0fd85a8a60b3368f1902c41de9ff2122e3ec64 Mon Sep 17 00:00:00 2001 From: AaronHForgeFlow Date: Mon, 6 May 2024 16:51:29 +0200 Subject: [PATCH] [IMP] rma: black, isort, prettier --- rma/README.rst | 162 ++++++---- rma/__manifest__.py | 2 +- rma/pyproject.toml | 3 + rma/readme/CONFIGURE.md | 42 +++ rma/readme/CONFIGURE.rst | 41 --- rma/readme/CONTRIBUTORS.md | 8 + rma/readme/CONTRIBUTORS.rst | 8 - rma/readme/DESCRIPTION.md | 19 ++ rma/readme/DESCRIPTION.rst | 18 -- rma/readme/ROADMAP.md | 6 + rma/readme/ROADMAP.rst | 6 - rma/readme/USAGE.md | 13 + rma/readme/USAGE.rst | 12 - rma/static/description/index.html | 520 ++++++++++++++++++++++++++++++ rma/tests/test_rma.py | 1 - rma/wizards/rma_make_picking.py | 3 +- 16 files changed, 707 insertions(+), 157 deletions(-) create mode 100644 rma/pyproject.toml create mode 100644 rma/readme/CONFIGURE.md delete mode 100644 rma/readme/CONFIGURE.rst create mode 100644 rma/readme/CONTRIBUTORS.md delete mode 100644 rma/readme/CONTRIBUTORS.rst create mode 100644 rma/readme/DESCRIPTION.md delete mode 100644 rma/readme/DESCRIPTION.rst create mode 100644 rma/readme/ROADMAP.md delete mode 100644 rma/readme/ROADMAP.rst create mode 100644 rma/readme/USAGE.md delete mode 100644 rma/readme/USAGE.rst create mode 100644 rma/static/description/index.html diff --git a/rma/README.rst b/rma/README.rst index 4cf46b444..ee577ae36 100644 --- a/rma/README.rst +++ b/rma/README.rst @@ -2,21 +2,42 @@ RMA (Return Merchandise Authorization) ====================================== +.. + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! This file is generated by oca-gen-addon-readme !! + !! changes will be overwritten. !! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !! source digest: sha256:51ec7a60674dede1504836e5881ee8a0f776b770dcc8238dce37e8376e5c4301 + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + +.. |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-LGPL--3-blue.png + :target: http://www.gnu.org/licenses/lgpl-3.0-standalone.html + :alt: License: LGPL-3 +.. |badge3| image:: https://img.shields.io/badge/github-ForgeFlow%2Fstock--rma-lightgray.png?logo=github + :target: https://github.com/ForgeFlow/stock-rma/tree/17.0/rma + :alt: ForgeFlow/stock-rma + +|badge1| |badge2| |badge3| + 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 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 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. +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. @@ -30,80 +51,84 @@ 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. - -* Users in group "RMA Customer User" or "RMA Supplier User" can access to, - create and process RMA's associated to customers or suppliers respectively. +Different security groups grant distinct levels of access to the RMA +features. -* Users in group "RMA Manager" can access to, create, approve and process RMA's - associated to both customers and suppliers. +- 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. +- 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: +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. +1. Go to *Inventory > Configuration > Products > Product Categories*. +2. 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. +-------------- + +1. Go to RMA > Configuration > Settings > Return Merchandising + Authorization and select the option "Display 3 fields on rma: + partner, invoice address, delivery address" if needed. +2. 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. Usage ===== -RMA are accessible though Inventory menu. There's four menus, divided by type. -Users can access to the list of RMA or RMA lines. +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. +1. Select a partner. Enter RMA lines associated to an existing picking, + or manually. +2. Request approval and approve. +3. Click on RMA Lines button. +4. Click on more and select an option: "Receive products", "Create + Delivery Order". +5. Go back to the RMA. Set the RMA to done if not further action is + required. Known issues / Roadmap ====================== -* 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 +- 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 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 `_. +If you spotted it first, help us to smash it by providing a detailed and welcomed +`feedback `_. Do not contact contributors directly about support or help with technical issues. @@ -111,26 +136,25 @@ Credits ======= Authors -~~~~~~~ +------- -* ForgeFlow S.L. +* ForgeFlow Contributors -~~~~~~~~~~~~ +------------ -* Jordi Ballester Alomar -* Aaron Henriquez -* Lois Rilo -* Bhavesh Odedra -* Akim Juillerat -* Alexandre Fayolle -* Chafique Delli -* Héctor Villarreal +- Jordi Ballester Alomar +- Aaron Henriquez +- Lois Rilo +- Bhavesh Odedra +- Akim Juillerat +- Alexandre Fayolle +- Chafique Delli +- Héctor Villarreal Maintainers -~~~~~~~~~~~ - -This module is maintained by the ForgeFlow. +----------- -This module is part of the `ForgeFlow/stock-rma `_ project on GitHub. +This module is part of the `ForgeFlow/stock-rma `_ project on GitHub. +You are welcome to contribute. diff --git a/rma/__manifest__.py b/rma/__manifest__.py index 015ed11d1..93eb3ea05 100644 --- a/rma/__manifest__.py +++ b/rma/__manifest__.py @@ -8,7 +8,7 @@ "category": "RMA", "summary": "Introduces the return merchandise authorization (RMA) process in odoo", "author": "ForgeFlow", - "website": "https://github.com/ForgeFlow/stock-rma", + "website": "https://github.com/ForgeFlow", "depends": ["stock", "mail", "web"], "demo": ["demo/stock_demo.xml"], "data": [ diff --git a/rma/pyproject.toml b/rma/pyproject.toml new file mode 100644 index 000000000..4231d0ccc --- /dev/null +++ b/rma/pyproject.toml @@ -0,0 +1,3 @@ +[build-system] +requires = ["whool"] +build-backend = "whool.buildapi" diff --git a/rma/readme/CONFIGURE.md b/rma/readme/CONFIGURE.md new file mode 100644 index 000000000..781da5682 --- /dev/null +++ b/rma/readme/CONFIGURE.md @@ -0,0 +1,42 @@ +## 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: + +1. Go to *Inventory \> Configuration \> Products \> Product + Categories*. +2. Select one and change the field *RMA Approval Policy* to your + convenience. + +## Other Settings + +1. Go to RMA \> Configuration \> Settings \> Return Merchandising + Authorization and select the option "Display 3 fields on rma: + partner, invoice address, delivery address" if needed. +2. 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/CONFIGURE.rst b/rma/readme/CONFIGURE.rst deleted file mode 100644 index 740b1e141..000000000 --- a/rma/readme/CONFIGURE.rst +++ /dev/null @@ -1,41 +0,0 @@ -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.md b/rma/readme/CONTRIBUTORS.md new file mode 100644 index 000000000..4b7300520 --- /dev/null +++ b/rma/readme/CONTRIBUTORS.md @@ -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/CONTRIBUTORS.rst b/rma/readme/CONTRIBUTORS.rst deleted file mode 100644 index 61bac6bad..000000000 --- a/rma/readme/CONTRIBUTORS.rst +++ /dev/null @@ -1,8 +0,0 @@ -* Jordi Ballester Alomar -* Aaron Henriquez -* Lois Rilo -* Bhavesh Odedra -* Akim Juillerat -* Alexandre Fayolle -* Chafique Delli -* Héctor Villarreal diff --git a/rma/readme/DESCRIPTION.md b/rma/readme/DESCRIPTION.md new file mode 100644 index 000000000..1c9bf6299 --- /dev/null +++ b/rma/readme/DESCRIPTION.md @@ -0,0 +1,19 @@ +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/DESCRIPTION.rst b/rma/readme/DESCRIPTION.rst deleted file mode 100644 index 6ca0172a8..000000000 --- a/rma/readme/DESCRIPTION.rst +++ /dev/null @@ -1,18 +0,0 @@ -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.md b/rma/readme/ROADMAP.md new file mode 100644 index 000000000..349492405 --- /dev/null +++ b/rma/readme/ROADMAP.md @@ -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/ROADMAP.rst b/rma/readme/ROADMAP.rst deleted file mode 100644 index ca6afe096..000000000 --- a/rma/readme/ROADMAP.rst +++ /dev/null @@ -1,6 +0,0 @@ -* 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.md b/rma/readme/USAGE.md new file mode 100644 index 000000000..592a7f653 --- /dev/null +++ b/rma/readme/USAGE.md @@ -0,0 +1,13 @@ +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: + +1. Select a partner. Enter RMA lines associated to an existing picking, + or manually. +2. Request approval and approve. +3. Click on RMA Lines button. +4. Click on more and select an option: "Receive products", "Create + Delivery Order". +5. Go back to the RMA. Set the RMA to done if not further action is + required. diff --git a/rma/readme/USAGE.rst b/rma/readme/USAGE.rst deleted file mode 100644 index b0ee9ff45..000000000 --- a/rma/readme/USAGE.rst +++ /dev/null @@ -1,12 +0,0 @@ -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/static/description/index.html b/rma/static/description/index.html new file mode 100644 index 000000000..c03c415cb --- /dev/null +++ b/rma/static/description/index.html @@ -0,0 +1,520 @@ + + + + + +RMA (Return Merchandise Authorization) + + + +
+

RMA (Return Merchandise Authorization)

+ + +

Beta License: LGPL-3 ForgeFlow/stock-rma

+

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.

+

Table of contents

+ +
+

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.

+
    +
  • 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:

+
    +
  1. Go to Inventory > Configuration > Products > Product Categories.
  2. +
  3. Select one and change the field RMA Approval Policy to your +convenience.
  4. +
+
+
+

Other Settings

+
    +
  1. Go to RMA > Configuration > Settings > Return Merchandising +Authorization and select the option “Display 3 fields on rma: +partner, invoice address, delivery address” if needed.
  2. +
  3. 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.
  4. +
+
+
+
+

Usage

+

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:

+
    +
  1. Select a partner. Enter RMA lines associated to an existing picking, +or manually.
  2. +
  3. Request approval and approve.
  4. +
  5. Click on RMA Lines button.
  6. +
  7. Click on more and select an option: “Receive products”, “Create +Delivery Order”.
  8. +
  9. Go back to the RMA. Set the RMA to done if not further action is +required.
  10. +
+
+
+

Known issues / Roadmap

+
    +
  • 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
  • +
+
+
+

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 to smash it by providing a detailed and welcomed +feedback.

+

Do not contact contributors directly about support or help with technical issues.

+
+
+

Credits

+
+

Authors

+
    +
  • ForgeFlow
  • +
+
+
+

Contributors

+ +
+
+

Maintainers

+

This module is part of the ForgeFlow/stock-rma project on GitHub.

+

You are welcome to contribute.

+
+
+
+ + diff --git a/rma/tests/test_rma.py b/rma/tests/test_rma.py index 5ab4bbd40..251fcb2f3 100644 --- a/rma/tests/test_rma.py +++ b/rma/tests/test_rma.py @@ -221,7 +221,6 @@ def _get_picking_type(cls, wh, loc1, loc2): def _create_rma_from_move( cls, products2move, r_type, partner, dropship, supplier_address_id=None ): - moves = [] if r_type == "customer": picking_type = cls._get_picking_type( diff --git a/rma/wizards/rma_make_picking.py b/rma/wizards/rma_make_picking.py index 0b92b1d85..3939fae97 100644 --- a/rma/wizards/rma_make_picking.py +++ b/rma/wizards/rma_make_picking.py @@ -5,7 +5,8 @@ from odoo import _, api, fields, models from odoo.exceptions import UserError, ValidationError -from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT, float_compare +from odoo.tools import DEFAULT_SERVER_DATETIME_FORMAT as DT_FORMAT +from odoo.tools import float_compare class RmaMakePicking(models.TransientModel):