No, the Law you mentioned has not been adopted, there is not even such a bill.
According to Cabinet Resolution No. 57, during martial law restrictions on border crossing apply to citizens of Ukraine from 18 to 60 years old. But there is a list of exceptions for this category as well.
You can read our article - https://ua-lawyer.com/uk/articles/3/khto-z-cholovikiv-maie-pravo-viyizdu-za-kordon /.