Restricting View and Edit

Is there any way we can customize the following scenario in erpnext:-1:When we add a new item(along with images) it should be saved and it should not be editable then.
2.There should be an edit button on which if we click we can edit the item.
In short we must view the item after adding and edit only when required??

Only a guess but perhaps Workflows could help you here ?

Perhaps I am not getting what you want to imply by workflow implementation. Would you please explain or elaborate it a little??This might be helpful.

Although tried all aspect of workflows but the purpose remains unserved.

I guess You can use role permission manager to ristrict item write and amend rights. Additionally try using some specific user to create/amend items and block create/amend rights for all other users

Solved it using custom script

Can u share the approach of script ?

Use this to create an edit button and then click on it to save . Serving the “View” and "edit " Approach what ewe wanted.
cur_frm.cscript.custom_refresh = function(doc) {
if(cur_frm.doc.[MANDATORY_FIELD_OF_DOCTYPE]) {
$.each(cur_frm[‘fields_dict’], function( index, value ) {
cur_frm.toggle_enable(index, false)
});
cur_frm.disable_save();
cur_frm.add_custom_button((‘Edit’), function(){
$.each(cur_frm[‘fields_dict’], function( index, value ) {
cur_frm.toggle_enable(index, true)
});
cur_frm.enable_save();
cur_frm.remove_custom_button(
(‘Edit’));
});
}
}

1 Like

Thanks