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

Hide field using python



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.


@Saditi have you tried to hide field from doctype?


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


@Saditi Can you add screenshot for my better understanding?


@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 then on there u can make python function



Thanks @antzforwork, I will try this…

  • 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) .