Skip to Content
Menu
This question has been flagged
2 Replies
1690 Views

hi all, i have a form named "fee_rule" on which on which there is a tab named "area_details" in which we have fields for country_area,cit,town etc..what i want to do is that when i select country as country_area and give city name under city field and then i go back and  select town as country_area and select town under town the city field should be cleared bcz now i have selected town in the country_area,,,


.In area details tab:when user select different country area one by one the data is not being clear such as if the user first selects country type city and selects the city and after this he selects town in the same line the city columns data does not clear.


i hope u understand

Avatar
Discard
Best Answer

You can use api.onchange to clear the other fields.

@api.onchange('my_field')
def onchange_myfield(self):
if self.my_field:
self.field1 = ''
self.field2 = None


Avatar
Discard
Author Best Answer

THANKS A LOT @sudhir arya i found it.

Avatar
Discard