I would like to create an ERPNext user for my Customers, so that they can login and see their Sales Orders and Invoices (read only). For this I can create a Role. But obviously they should only see those records, which were created against their Customer Master (I could either link the ERPNext User to the Customer Master as custom field, or I could use the Email address as identifier).
Without having to share each document manually, I would like to have this sharing rule applied automatically for each Document. So for example Customer ABC has the email firstname.lastname@example.org in his Customer Record. I also created a user called ‘ABC’ with the email email@example.com. Now if I create a Sales Order against Customer ‘ABC’, the user ‘ABC’ should automatically get access to that record.