ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

Dynamically show/hide Report filter fields


#1
Hi guys, 

Is there any way to hide/show a report filter on client side ? 
For example, I wanna show the filter for a certain User Role only ?

Thank you!!




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/103925b4-21f6-4505-9671-5b7ef2f869c4%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

#2
Hi Nguyen,

Can you be more specific? A screenshot would also help.

Thanks,
Anand.


On Fri, Jul 25, 2014 at 12:05 PM, Nguyen Do Le Bao <na...@gmail.com> wrote:
Hi guys,

Is there any way to hide/show a report filter on client side ?
For example, I wanna show the filter for a certain User Role only ?

Thank you!!




Note:



If you are posting an issue,


  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.

  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.

  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email

  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.



    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/103925b4-21f6-4505-9671-5b7ef2f869c4%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.




Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CAAQzbF03Npj0aks_sC4h_wX7UHUS9SRNGToC1yYgVQ5KdQWhmQ%40mail.gmail.com.

    For more options, visit https://groups.google.com/d/optout.

#3

Hello

Even I have the same requirement. Did you find any solution?


#4

Oh I just got it solved.

you can check condition and use toggle function as below.

var dt_filter= frappe.query_report.get_filter(“date”);
if (frappe.user.has_role(“Role Name”)) {
dt_filter.toggle(false);
}
dt_filter.refresh();