Bỏ qua để đến Nội dung
Menu
Câu hỏi này đã bị gắn cờ
3 Trả lời
7482 Lượt xem

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">

. . .


Ảnh đại diện
Huỷ bỏ

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

Tác giả Câu trả lời hay nhất

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.


Ảnh đại diện
Huỷ bỏ
Câu trả lời hay nhất

Probably better to filter records in a custom report:

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

Ảnh đại diện
Huỷ bỏ
Bài viết liên quan Trả lời Lượt xem Hoạt động
2
thg 8 25
2744
3
thg 2 25
3954
0
thg 5 24
46
1
thg 4 24
3594
4
thg 9 23
5146