Let's not have errors when accessing tree view. If you later click in a non accessible record, then the error will show anyway. It's just avoid blocking accessing the EDI menu.
The good solution would be filtering the exchange records by related record, as said in https://github.com/OCA/edi/issues/933 discussion. But here we are speaking of v12, no need to be too picky in this version, right?
Let's not have errors when accessing tree view. If you later click in a non accessible record, then the error will show anyway. It's just avoid blocking accessing the EDI menu.
The good solution would be filtering the exchange records by related record, as said in https://github.com/OCA/edi/issues/933 discussion. But here we are speaking of v12, no need to be too picky in this version, right?