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

Hide field using python

customization
erpnext

#1

Can someone please help me to hide Payment due date field from sales invoice using python.

I am using subscription, so when subscription generate new invoice due date should not be displayed.


#2

@Saditi have you tried to hide field from doctype?


#3

@arokia using hidden ?
Yes it will hide field permanently from sales invoice doctype only, and I want to hide the field from subscription.


#4

@Saditi Can you add screenshot for my better understanding?


#5

@Saditi maybe you can use js
frm.set_df_property("[payment due date]","hidden",1)
but before that to determine it should hidden or not, make a call method on py using frappe.call then on there u can make python function

reference:



#6

Thanks @antzforwork, I will try this…


#7
  • Correct way to use set_df_property is
    frm.set_df_property("field_name", "property", "value") .
  • So in your case, if you want to make payment due date hidden, then you will have to do the following
    frm.set_df_property("payment_due_date", "hidden", 1) .