print_designer icon indicating copy to clipboard operation
print_designer copied to clipboard

feat: Conditional display

Open batonac opened this issue 1 year ago • 2 comments

It would be great to add the ability to show/hide any element in a print format based on document conditions.

Consider the following example, where I have boxes for various dynamic fields, not all of which will always be populated in a given document: image

On the 'Project/PO' rectangle in the shown example, I'd like to choose to only display it if the Customer's Purchase Order field is set in a given doctype. I believe that the existing frappe.ui.FilterGroup could provide a good user experience for this, and I suggest adding a checkbox and FilterGroup in the following arrangement to the settings sidebar: image

These selections, of course, would need to be transposed into Jinja if statements which enclose the conditional elements.

batonac avatar Sep 19 '23 12:09 batonac

@batonac This is something i am planning to do along with computed fields ( basic arithmetic operation ) but is on medium priority.

maharshivpatel avatar Sep 19 '23 13:09 maharshivpatel

it will also be great to support call doc methods or whitelist methods for dynamic text.

szufisher avatar Oct 23 '23 12:10 szufisher