Automatically share Sales Orders with Customers

Dear all,

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 in his Customer Record. I also created a user called ‘ABC’ with the email Now if I create a Sales Order against Customer ‘ABC’, the user ‘ABC’ should automatically get access to that record.

Any ideas?

Thanks, David

@David_Stegnitz this works out of the box with the portal. Just create a Contact in Customer with the user’s record and then when the user logs in they will see their order history.

1 Like

@rmehta thank you for your quick reply. Yes, the Portal already is very useful. But I’d like to give the Customer a bit of a higher permission than possible in the default Portal. When I go to Website - Web Form I can see the option to create NEW Forms for Portal/Website users. What I would like to do is to add some EXISTING Forms and Reports to the Portal, such as the Inventory Stock List, or the Delivery Note Documents.

Thanks, David

@David_Stegnitz not possible out of the box at the moment, you will have to customize.

@rmehta thanks, I will think about an alternative. Just one more related question: Do you see any option to manage the sharing settings on a document thru the RESTful API?

Good evening, any idea of the Sharing Access on a Document Level can be set/achieved via the RESTful API? Maybe there is any special method supporting this? Thanks, David

A short reply if there is any way to share documents thru the RESTful API in ERPNext would be much appreciated. Thanks, David

Rmehta, I tried your recommendation about the contact creation, however I can’t get our demo customer to see Sales Orders in his portal.
I have even created permissions for customer to see Sales Orders, but it didn’t help.
Furthermore, when the demo customer is logged-in and it presses “Place Order” in the cart, it gets “Not permitted” notification. Browser console shows following error:

Failed to load resource: the server responded with a status of 403 (FORBIDDEN)

Now we test v7.2.13 .

Is that a bug or just configuration issue?

Not valid UTL

on submitting the doctype(Order Book)i want to create sales order from the customers who are in submitted state.