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

I have a report that works perfectly for me but they ask me that before I launch the results it will be filtered through a start date and end date set before entering the report, someone knows how I can perform that process of having a view to select the start date and end date to add it to a report that is already working but that filter is required?

I want to show the items that are in a date range that that date is previously selected. For example: Pono start date: 01/01/2019 and end date: 01/30/2019 when you enter those dates will show the elements that are only in that range.

searching online I found this code:

filter name = "today" string = "Today" domain = "[('date', '> =', datetime.datetime.combine (context_today (), datetime.time (0,0,0))), ('date', '<=', datetime.datetime.combine (context_today (), datetime.time (23,59,59)))] "/>

Now my question, I want to enter it in my view of the report but I don't know how to put it, could you help me and change today to make it monthly?

Small excerpt from my report view:

    <report
        id = "larger_list"
        model = "project_rc.account"
        string = "Lmayor"
        name = "project_rc.report_cuenta_view"
        file = "project_rc.report_lmayor"
        report_type = "qweb-html" />

    <template id = "report_cuenta_view">
        <t t-call = "web.html_container">
            <t t-foreach = "docs" t-as = "i">
                <t t-call = "web.internal_layout">
                    <div class = "page">

. . .


Avatar
Discard

I have edited my publication because I found new information, I hope you can help me.

Author Best Answer

Yes, I have seen using abstract and transmodel but it only throws me the report without the data then I did not know how to solve the problem and I tried to do it in different simpler ways.  

But if you could help me solve the problem I have, I would be grateful, I await your response.


Avatar
Discard
Best Answer

Probably better to filter records in a custom report:

https://www.odoo.com/documentation/13.0/reference/reports.html#custom-reports

Avatar
Discard
Related Posts Replies Views Activity
3
Feb 25
3298
0
May 24
46
1
Apr 24
3225
4
Sep 23
4705
2
Sep 23
6916