Hi. I'd like to ask for help on how to create a custom script that will check for the contents of field against_sales_order in each row of the Delivery Note Item table and evaluate if it is empty (null) or not. If the against_sales_order is null, then the form should not be saved or submitted (validated = false;).
I am aware that there is a "Sales Order Required" toggle in Selling Settings, which we can set to "Yes" and is what we currently do. However, I want to change this toggle to "No" because there are specific use-cases where an invoice can be done by certain roles/users without a sales order. Importantly, these use cases will also not impact inventory. Thus, I intend to set a permission check via client script on the "update_stock" field that it must always be unchecked (or just hide it and default it as unchecked).
By setting "Sales Order Required" to "No", a user can now create transactions that impact inventory without a sales order. This is not ideal as we use submitted Sales Orders as a sort of approval form to trigger stock delivery. We do not want to be creating Delivery Notes without a proper order.
–
Note:
If you are posting an issue,
We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
Hi. I'd like to ask for help on how to create a custom script that will check for the contents of field against_sales_order in each row of the Delivery Note Item table and evaluate if it is empty (null) or not. If the against_sales_order is null, then the form should not be saved or submitted (validated = false;).
I am aware that there is a "Sales Order Required" toggle in Selling Settings, which we can set to "Yes" and is what we currently do. However, I want to change this toggle to "No" because there are specific use-cases where an invoice can be done by certain roles/users without a sales order. Importantly, these use cases will also not impact inventory. Thus, I intend to set a permission check via client script on the "update_stock" field that it must always be unchecked (or just hide it and default it as unchecked).
By setting "Sales Order Required" to "No", a user can now create transactions that impact inventory without a sales order. This is not ideal as we use submitted Sales Orders as a sort of approval form to trigger stock delivery. We do not want to be creating Delivery Notes without a proper order.
–
Note:
If you are posting an issue,
We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
From what I understand, Sales Order to be mandatory for certain set of users and not for other users?
here is what you can write:
https://gist.github.com/rmehta/7751058
- Rushabh
On Friday, November 29, 2013 3:52:23 PM UTC+5:30, lxnow wrote:
Hi. I'd like to ask for help on how to create a custom script that will check for the contents of field against_sales_order in each row of the Delivery Note Item table and evaluate if it is empty (null) or not. If the against_sales_order is null, then the form should not be saved or submitted (validated = false;).
I am aware that there is a "Sales Order Required" toggle in Selling Settings, which we can set to "Yes" and is what we currently do. However, I want to change this toggle to "No" because there are specific use-cases where an invoice can be done by certain roles/users without a sales order. Importantly, these use cases will also not impact inventory. Thus, I intend to set a permission check via client script on the "update_stock" field that it must always be unchecked (or just hide it and default it as unchecked).
By setting "Sales Order Required" to "No", a user can now create transactions that impact inventory without a sales order. This is not ideal as we use submitted Sales Orders as a sort of approval form to trigger stock delivery. We do not want to be creating Delivery Notes without a proper order.
–
Note:
If you are posting an issue,
We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
On Friday, November 29, 2013 3:52:23 PM UTC+5:30, lxnow wrote:
Hi. I'd like to ask for help on how to create a custom script that will check for the contents of field against_sales_order in each row of the Delivery Note Item table and evaluate if it is empty (null) or not. If the against_sales_order is null, then the form should not be saved or submitted (validated = false;).
I am aware that there is a "Sales Order Required" toggle in Selling Settings, which we can set to "Yes" and is what we currently do. However, I want to change this toggle to "No" because there are specific use-cases where an invoice can be done by certain roles/users without a sales order. Importantly, these use cases will also not impact inventory. Thus, I intend to set a permission check via client script on the "update_stock" field that it must always be unchecked (or just hide it and default it as unchecked).
By setting "Sales Order Required" to "No", a user can now create transactions that impact inventory without a sales order. This is not ideal as we use submitted Sales Orders as a sort of approval form to trigger stock delivery. We do not want to be creating Delivery Notes without a proper order.
–
Note:
If you are posting an issue,
We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.
End of Note
—
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.