I want to change the visibility of a field gst_tp in a doctype based on the field value of other doctype.
i don’t know doc.field_name.hidden = 1 is right.! i tried but it didn’t make the field hidden.
def onload(self):
self.gccv()
def gccv(self):
if self.policy_name =="Goods Carrying Commercial Vehicle":
value = frappe.get_all("Motor",filters={"prospect_id":self.prospect_id},fields=["ll_cleaner","compulsory_pa"],as_list = 1)
if value:
if value[0][1] == "No" and value[0][0] == 0:
doc.gst_tp.hidden = 1
else:
doc.gst_tp.hidden = 0