ERPNext.com Frappe Cloud Support Partners Foundation Frappe School

A restricted document is not hidden after "insufficient permission" message is closed by user

There is an issue that I thought was solved in this version but unfortunately not.
It is about the documents that are restricted for some users based on a link field.
In my case, it is a supplier group.
A user is given a limited access to local suppliers only, and when a purchase invoice is from a foreign supplier he gets this message, but at the same time can see all the contents with the message covering it,
And also can close the message and do whatever he wishes with the invoice, printing and emailing.

I found out that I forgot to add a link field of “Supplier Group”. I thought it was there because of the error message that shows for the user.
After I added the field, with its content. The restriction worked well.