is it possible to add a filter to the sale order tree view to search for a stock-picking-number and get as result the sale orders that belong to this stock-picking?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
- CRM
- e-Commerce
- Accounting
- Inventory
- PoS
- Project management
- MRP
This question has been flagged
Hi Jack: Yes, you can. Go to the Filters drop down in Sales > Orders > Orders, select Add Custom Filters and then Pickings. You can then choose contains and type the stock picking number. This will retrieve the Sales Order that has the stock picking number associated with them.
thanks. can i also add such filter using xml and extending the search_view <field...... filter_domain=???> so that the users do not have to add a custom filter each time?
Yes. You can create a customization to add a custom filter to the ones already appearing in the drop down list.
If you want the user to provide the value of the stock picking number every time then you should customize the view related to the search box to provide the user can type the value and select the field to search against.
For example, it is possible to customize the search box so that when the user types in the stock picking number in the search box, the user gets the option to select "Search Picking for:"
@Paresh Wagh: can you provide code for such customization? many thanks
Hi Jack: Sure. Which version of Odoo are you using ?
V12 CE
Extend the "sale.order.search.inherit.sale" view and use the following in the arch definition.
You will get an option for "Search Pickings for:" when you type some value in the Search box on the Sales > Orders > Orders list view.
<?xml version="1.0"?>
<data inherit_id="sale.sale_order_view_search_inherit_sale">
<xpath expr="/search" position="inside">
<field name="picking_ids"/>
</xpath>
</data>
Enjoying the discussion? Don't just read, join in!
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign up