Issue #8325 done. Nested departments in templates