This question has been flagged
2 Replies
3147 Views

In the tree view , i wann to display only one latest record from each user . Currently is displays all the records created by default , now i have added a group filter by month , it shows all the records of the month , but not single record of each user .

How to achieve this .

Avatar
Discard

This is difficult to achieve using group by, you will have to do something similar to what Odoo does in Reporting.

Author

can u gv more info on that.

Check this file: addons/point_of_sale/report/pos_order_report.py as well as its views.

Best Answer

Sounds like you need a new model with two fields:
user_id: many2one to res.users

latest_record: functional field related to the model you want

In the function code for the functional field, you can return the record ID of the latest record for the relational model, based on whatever logic you want to put in there. You could then create a normal tree view for this new model, and it should effectively give you what you want.

Avatar
Discard
Best Answer

Hi..

In Tree view you have an option to display in records in Bold which are not read "bold:message_unread==True"...

so same thing can be used to set Current filter in the search view ...

Avatar
Discard
Author

Hi , I did something like this in tree view ,but nothing changes . sicon_client_details_tree sicon_client_details

Author

Thanks for the idea , jus did some work around nd am getting the result .