The code I have done is followed below:
is_beneficiary = fields.Function(fields.Boolean(
'Is Beneficiary'), 'on_change_is_beneficiary')
@fields.depends('is_beneficiary', 'bank_branch')
def on_change_is_beneficiary(self, name=None):
if self.is_beneficiary:
if (self.bank_branch is None):
self.raise_user_error('Bank Details Need to be Filled')
else:
return self.is_beneficiary
On executing the above code error is showing:
RecursionError: maximum recursion depth exceeded while calling a Python object