Purchase Order approval

182 views
Skip to first unread message

MP

unread,
Jun 20, 2013, 5:58:27 AM6/20/13
to erpnext-dev...@googlegroups.com

We have a need for each Purchase Order (PO) to be approved by appropriate manager. In order to implement this, we have decided to take below approach. I need to know if the below approach is appropriate. Are there any Pros and Cons of this approach? Is there any better approach to achieve the same?

 Setup:

  • -         We have added a custom field for Purchase Order DocType called ‘Purchase Order Approver’ which is a link field to Profile DocType.
  • -          Each user with ‘Purchase User’ role can only Add/edit Purchase Order. They are not given Submit right. They can also see the Purchase Order they created.
  • -          For Profile DocType, the user role ‘ALL’ is given read permission for all users.
  • -          Added a new user role called ‘Purchase Approver’ and assigned Read, Edit, Submit, Cancel, Amend and Report rights to it for those Purchase Order for which they are selected as approver. (This way they can only see and Submit those PO for which they are approver.)

Process:

  • -          When a use creates Purchase Order, in addition to other details, they will also select the user (manager) who will approve the Purchase order they are creating and save the order.
  • -          A user with Purchase Approver role will then be able to Submit any Purchase Order for which they are approver.

 Missing functionality:

-          By using above approach, we are not able to send any notification to the Purchae Approver User for them to approve the order. Is there anyway we can achieve this?


Kind regards,



 

 

Rushabh Mehta

unread,
Jun 21, 2013, 12:49:39 AM6/21/13
to erpnext-dev...@googlegroups.com
Mayur,

Looks okay to me - I agree that notifications need to be much deeper into the product and should be based on some abstraction. Will get to it slowly - first need to get through documentation and web shop now that the new UI is coming close to release.

btw, did you try Workflow? One user shared his settings with us and they had 24 Workflow rules for one DocType !! :)

best,
Rushabh


T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f71ab69a-a5b2-46a2-b899-016ec5b7d8dc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Umair Sayyed

unread,
Jun 21, 2013, 1:05:56 AM6/21/13
to erpnext-dev...@googlegroups.com
Hello Mayur,

The Role and Permission is customized well to fit with your workflow.

For notification to Approver, Assign To feature can be used. Purchase User will assign transaction to Approver. This will also send an email notification to Approver and add item on his/her To-do List.

Approver should be selected in a custom field created by you. Based on this field, you can set restriction for Approver. You can update the value in Approver field automatically from Set Property option, provided each Purchase User has predetermined approved of transactions made by him.

With this approach, Purchase User will only need to assign transaction to Approver manually. The value in the Approver field will be fetched from Set Properties option.





 

 

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/f71ab69a-a5b2-46a2-b899-016ec5b7d8dc%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Thanks and Regards,
Umair Sayyed
www.erpnext.com

MP

unread,
Jun 21, 2013, 6:46:34 AM6/21/13
to erpnext-dev...@googlegroups.com
Thanks Rushabh.

We decided not to use the workflow as we have very complex authorization matrix which may not be met by the current workflow design. But we are very keen to use it and if we came across situation where we can use it then we will use it. I could have used it for this PO requirement.Are you able to share these settings where this company has setup 24 workflows rules?

Kind regards,
Mayur Patel

On Friday, June 21, 2013 5:49:39 AM UTC+1, rushabh wrote:
Mayur,

Looks okay to me - I agree that notifications need to be much deeper into the product and should be based on some abstraction. Will get to it slowly - first need to get through documentation and web shop now that the new UI is coming close to release.

btw, did you try Workflow? One user shared his settings with us and they had 24 Workflow rules for one DocType !! :)

best,
Rushabh


T: @rushabh_mehta

On 20-Jun-2013, at 3:28 PM, MP <mayur....@gmail.com> wrote:

We have a need for each Purchase Order (PO) to be approved by appropriate manager. In order to implement this, we have decided to take below approach. I need to know if the below approach is appropriate. Are there any Pros and Cons of this approach? Is there any better approach to achieve the same?

 Setup:

  • -         We have added a custom field for Purchase Order DocType called ‘Purchase Order Approver’ which is a link field to Profile DocType.
  • -          Each user with ‘Purchase User’ role can only Add/edit Purchase Order. They are not given Submit right. They can also see the Purchase Order they created.
  • -          For Profile DocType, the user role ‘ALL’ is given read permission for all users.
  • -          Added a new user role called ‘Purchase Approver’ and assigned Read, Edit, Submit, Cancel, Amend and Report rights to it for those Purchase Order for which they are selected as approver. (This way they can only see and Submit those PO for which they are approver.)

Process:

  • -          When a use creates Purchase Order, in addition to other details, they will also select the user (manager) who will approve the Purchase order they are creating and save the order.
  • -          A user with Purchase Approver role will then be able to Submit any Purchase Order for which they are approver.

 Missing functionality:

-          By using above approach, we are not able to send any notification to the Purchae Approver User for them to approve the order. Is there anyway we can achieve this?


Kind regards,



 

 


--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

MP

unread,
Jun 21, 2013, 6:48:07 AM6/21/13
to erpnext-dev...@googlegroups.com
Thanks Umair for this tip. This will help for sure.

Kind regards,


On Friday, June 21, 2013 6:05:56 AM UTC+1, Umair Sayyed wrote:
Hello Mayur,

The Role and Permission is customized well to fit with your workflow.

For notification to Approver, Assign To feature can be used. Purchase User will assign transaction to Approver. This will also send an email notification to Approver and add item on his/her To-do List.

Approver should be selected in a custom field created by you. Based on this field, you can set restriction for Approver. You can update the value in Approver field automatically from Set Property option, provided each Purchase User has predetermined approved of transactions made by him.

With this approach, Purchase User will only need to assign transaction to Approver manually. The value in the Approver field will be fetched from Set Properties option.

On Thu, Jun 20, 2013 at 3:28 PM, MP <mayur....@gmail.com> wrote:

We have a need for each Purchase Order (PO) to be approved by appropriate manager. In order to implement this, we have decided to take below approach. I need to know if the below approach is appropriate. Are there any Pros and Cons of this approach? Is there any better approach to achieve the same?

 Setup:

  • -         We have added a custom field for Purchase Order DocType called ‘Purchase Order Approver’ which is a link field to Profile DocType.
  • -          Each user with ‘Purchase User’ role can only Add/edit Purchase Order. They are not given Submit right. They can also see the Purchase Order they created.
  • -          For Profile DocType, the user role ‘ALL’ is given read permission for all users.
  • -          Added a new user role called ‘Purchase Approver’ and assigned Read, Edit, Submit, Cancel, Amend and Report rights to it for those Purchase Order for which they are selected as approver. (This way they can only see and Submit those PO for which they are approver.)

Process:

  • -          When a use creates Purchase Order, in addition to other details, they will also select the user (manager) who will approve the Purchase order they are creating and save the order.
  • -          A user with Purchase Approver role will then be able to Submit any Purchase Order for which they are approver.

 Missing functionality:

-          By using above approach, we are not able to send any notification to the Purchae Approver User for them to approve the order. Is there anyway we can achieve this?


Kind regards,



 

 

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+unsub...@googlegroups.com.

MP

unread,
Jun 21, 2013, 12:34:23 PM6/21/13
to erpnext-dev...@googlegroups.com
Hi again,

As per your suggestion, we have decided to use User Property to set the approver automatically on the Purchase Order page. Instead of setting this property manually, we want it to automatically get set, when a employee records get saved. So in order to achieve this. I wrote a custom script (Type: Server) as below:

webnotes.conn.set_default("purchase_order_approver", self.doc.reports_to_user_id, self.doc.user_id).

Above works fine.

Is this approach fine?

Please note that the web interface didn't allow me to create Server side script. The Custom Script page has Client as default for Type field and it is read only. It must have been read- only for good reason. But I decided to change Custom Script docType and removed Readonly flag. Is there any reason why web interface doesn't allow creation on of server side script?


Kind regards,
Mayur Patel

Rushabh Mehta

unread,
Jun 22, 2013, 3:48:54 AM6/22/13
to erpnext-dev...@googlegroups.com
Mayur,

Custom Script is okay to use if you are the Administrator.

We have disabled access for our hosted customers because of the obvious access someone can get if they can write a server script.

You should also block Custom Script (server) for all users other than Administrator.

best,
Rushabh


T: @rushabh_mehta

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.

To post to this group, send email to erpnext-dev...@googlegroups.com.

MP

unread,
Jun 24, 2013, 3:12:42 AM6/24/13
to erpnext-dev...@googlegroups.com
Thanks Rushabh.

Understood. I will block it for everyone else but the administrator.

Kind regards,
Mayur Patel
Reply all
Reply to author
Forward
0 new messages