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

Hi there
We have just started using Odoo 17 and my task is to customise the quotes that we send out.  The form is using a one to many relationship for the line items.  I need the flexibility to conditionally show or hide the line items in the report (for example, our quote may have multiple labour line items but we do not wish to show the client these fields).  I have placed a checkbox on the form (called x_studio_print).  If this is elected, then we want to hide this line in the report.
The image below is a snippit from the form design showing the checkbox setup



The code I was trying to use with no success is  {'invisible': [('x_studio_print','=',True)]}

The code form the report for that Dynamic table is

I would appreciate any help or feedback.

Many thanks
Paul

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

Hi Paul: You need to use the t-if directive in reports for conditional logic. Here's a link to the documentation page that explains it in detail. Hope this helps.

QWeb Templates — Odoo 17.0 documentation

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

Thank you Paresh.  Works like a charm.

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

How did you make it to work?