Hello,
I would like to search for an order by the values on the order lines. As an example lets say I would like to search by the "Unit Price" field on the sales order line. How would we do that?
Odoo is the world's easiest all-in-one management software.
It includes hundreds of business apps:
Hello,
I would like to search for an order by the values on the order lines. As an example lets say I would like to search by the "Unit Price" field on the sales order line. How would we do that?
This can be done via studio and a little bit of XML. You would have to be in developer mode for this.
1) The first step would be to make sure you have an auto-created studio inherited view for your search view. If you do not have one then simply drag and drop an existing field on the Auto Complete section. This should create the required view needed along with the XPath as well.
2) Next Step would be to remove that field from the XML code and add your required field. In this example we we would like to search by the unit price so this is how it would look:
In this case, the name of the field we are referring to first is "order_line" and then we would like to search the order lines for another specific subfield. In this case, it is Unit Price and this is done by the filter_domain function where we are referring to the subfield order_line.price_unit.
We can use this same syntax to search for another field that you require from the Sale Order Line. The main change here would be the subfield: order_line.fieldfromsaleorderline
3) Once saved, you can test it by going to your sales order list view and searching for the unit price. As an example, I have searched for orders that contain lines where the unit price is $100.00. So this is how it would look:
Please Note: The decimal places are important for this field so make sure to search it by including the decimal places. So 100 in this case would be 100.00. But this can vary from field to field.
Create an account today to enjoy exclusive features and engage with our awesome community!
Sign upRelated Posts | Replies | Views | Activity | |
---|---|---|---|---|
|
2
May 25
|
4353 | ||
|
1
Apr 25
|
1164 | ||
|
2
Oct 24
|
3861 | ||
|
1
Sep 24
|
3518 | ||
|
1
Sep 24
|
2338 |