Skip to Content
Menu
This question has been flagged
3 Replies
3194 Views

Hello everyone, 

I want to add a field in my sale order that displays all the states of stock_picking of this sale order which i name delivery_status

Eg: the order S00001 have two stock.picking WH/OUT/00001 which is done and WH/OUT/00002 waiting

delivery_status should display the values done and waiting as a many2many tags widget and i need to be able to group my sale orders according to this value

The only solution i can think of is to make the delivery_status field a computed  text field and then i compute the values and display a text, but this method doesn't work for me when it comes to being able to group by the value or the display.

I can't use a related field because the state field is a selection field in stock.picking and related fields should have the same type so my related field in the sale.order should be a selection which only displays one value.

Does any one have an idea or faced a similar situation ? 

Thank you very  much 


Avatar
Discard
Best Answer

Hi,


The "Delivery Status on Sale Order" app for Odoo version 14 adds a new delivery status field to the sales order tree view and in the form view, which allows you to track the delivery status of each order. The delivery status field has several options, including:


Nothing to Deliver - If no delivery is created for a sales order.


To Deliver - Delivery is still to receive


Partially Deliver - If More than one delivery is created for a sales order and some of them received and some still to receive


Delivered - If all delivery are done


Processing - If any delivery is in waiting state


Overall, the "Delivery Status on Sale Order" app is a useful tool for tracking the delivery status of your sales orders in Odoo version 14.


Here is the link to the app:


https://apps.odoo.com/apps/modules/14.0/sales_order_delivery_status/


Hope it helps

Avatar
Discard
Best Answer

Hi, there,

Reference:

https://github.com/OCA/sale-workflow/tree/15.0/sale_delivery_state

This is the solution and installs it first, please.

Hope it is useful.


Avatar
Discard
Best Answer

Hi, 
You cannot group by M2M field. this is a limitation in Odoo and i don't think someone already did itand shared it with the community..

What i would recommand to you is: 
1- For each picking status, add invisible, computed and stored boolean field in sale.order. 
For ex: has_done_picking, has_waiting_picking, .. 
2- if order has done picking, so has_done_picking=True ( and of course you will add it to your M2M for visibility to the client ) 
3- in list view, you can group by these boolean fields. ( AND, OR ) 

I know.. it's heavy but i think it does the job. 

hope this helps.
Regrads.

Avatar
Discard

Grouping of Many2Many fields is possible at version 15. See https://www.youtube.com/watch?v=iD2kb51Q7xg

Nice, I did not know that!
Thanks Ray,