Fixed broken link /inv/track/search?report=inc default template

problem was the hasattr() function requires string as second parameter and when we pass tablename as the second parameter it was sometimes None. So added condition to check None.