-
-
Notifications
You must be signed in to change notification settings - Fork 204
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[IMP] rma: custom route for replace action #434
base: 16.0
Are you sure you want to change the base?
Conversation
Hi @pedrobaeza, @chienandalu, |
e918846
to
c310a13
Compare
c310a13
to
bfdecff
Compare
This commit adds a new field, rma_out_replace_route_id, to the warehouse. If this field is set, it specifies a custom route to be used for RMA replacement actions, allowing separation of RMA replacement orders from regular deliveries. If the field is not set, the default delivery route will be used.
bfdecff
to
3b76c37
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are going to need more routes than the a highway, hehe
@@ -30,6 +30,7 @@ class StockWarehouse(models.Model): | |||
) | |||
rma_in_route_id = fields.Many2one("stock.route", "RMA in Route") | |||
rma_out_route_id = fields.Many2one("stock.route", "RMA out Route") | |||
rma_out_replace_route_id = fields.Many2one("stock.route", "RMA out Replace Route") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sbejaoui Should'nt we use the mechanisms to create that route (see _get_route_values()
) ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the common use case is to use the default delivery route, which is why I didn't create or assign a custom route to the warehouse. If more people feel that having a custom route for RMA delivery by default is necessary, I will make the change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why only for replace and not for all RMA deliveries?
While it's doing the job, I'm not sure it's a good approach. You can configure specific warehouse behavior by configuring a route on a product or product category. This is even more important in newer versions of odoo where you can configure a route on the carrier. If you force a route from rma, you are overriding those configurations.
From what I understood, you want to isolate the rma delivery from other deliveries. However, this is already the case as you have a dedicated procurement group for the rma delivery. The issue arise when you use the stock_picking_group_by_partner_by_carrier
module that regroup deliveries for a same partner. In my opinion, a cleaner approach is to create a glue module with an option on the picking type to disable rma grouping.
The rma module differentiates between replacement and delivery actions. In the case of a replacement, the product is picked from stock, while for delivery, it’s picked from the RMA location.
I agree, the use of routes in the rma module should be reconsidered to better align with the Odoo standard. While I don’t have specific ideas yet on how to achieve this alignment, my point is that this PR follows the existing logic in the module and doesn’t introduce any new approaches or changes to the current structure. rma/rma/models/stock_warehouse.py Lines 23 to 30 in 9f19281
One reason for grouping pickings is indeed the |
Thanks for the clarification. I had another look with your comment in mind and I do understand there is a cc @phschmidt |
Sorry @jbaudoux , but as I already wrote, I will not be contributing to the RMA Reop any more for now. |
RMA replacement orders currently use the default delivery route, which results in their creation under the default delivery picking type. While this behavior works, it prevents users from tracking RMA replacement orders separately from regular deliveries.
This PR introduces a new field,
rma_out_replace_route_id
, to the warehouse. If set, this field specifies a custom route for RMA replacement actions, allowing users to separate RMA replacement orders from standard deliveries and manage them independently. If the field is not set, the default delivery route will continue to be used.