Hi,
In
Odoo Studio, you can achieve sorting by multiple fields in a report by
manually adding XML code to the report's template. Here's how you can do
it:
- Open the report in Odoo Studio.
- Switch to the "Advanced Mode" to access the XML view of the report template.
- Locate the tag in the XML code. This tag is used to retrieve records from the database.
- Add the following code after the tag to sort the records by multiple fields:
r.name))"/>
Replace 'your_model_name' with the actual name of the model you're using in the report.
In the above code, r.start_date and r.name
are the fields by which you want to sort the records. You can replace
them with the actual field names as per your requirement. The sorted() method is used to sort the records based on the specified fields.
- Replace the usage of records with records_sorted in the subsequent code where you iterate over the records to display them in the report. For example:
- Save the changes and preview the report to verify that the records are sorted as expected.
Following these steps, you can manually add sorting by multiple fields to a report in Odoo Studio. Remember to replace 'your_model_name' with the actual model name and adjust the field names as needed, You can try this it may meet your requirement
Hope it helps