Can not save item

Hi,

I have a question, if I use role “Item Manager”, when I click “Save”, no error message popup. And I found if I fill in price, then it can not save, if let it blank it can save. But I already add “Price List” permission to this role. Has any ideas I need to check? Or where can find more information like log on this issue?

jquery.min.js:4 POST http://leserp.erppi.com/ 403 (FORBIDDEN)
send @ jquery.min.js:4
ajax @ jquery.min.js:4
frappe.request.call @ desk.min.js:1440
frappe.call @ desk.min.js:1336
_call @ form.min.js:2646
(anonymous) @ form.min.js:2489
check_name @ form.min.js:2560
save @ form.min.js:2486
frappe.ui.form.save @ form.min.js:2669
(anonymous) @ form.min.js:848
i @ jquery.min.js:2
add @ jquery.min.js:2
_f.Frm._save @ form.min.js:837
(anonymous) @ form.min.js:807
setTimeout (async)
_f.Frm.save @ form.min.js:807
Save @ form.min.js:1885
dispatch @ jquery.min.js:3
$event.dispatch @ report.min.js:3092
r.handle @ jquery.min.js:3
form.min.js:2658 Uncaught TypeError: Cannot read property 'docs' of null
    at Object.always (form.min.js:2658)
    at Object.<anonymous> (desk.min.js:1475)
    at i (jquery.min.js:2)
    at Object.fireWith [as rejectWith] (jquery.min.js:2)
    at z (jquery.min.js:4)
    at XMLHttpRequest.<anonymous> (jquery.min.js:4)

@hellorachel,

do you have any custom script on Item doctype? If Yes, can you share the script.

Also check the error log in Error Log doctype and Error Snapshot

Hi

Yes, I had some custom script, here is my script. I try to generate my item code.

cur_frm.cscript.custom_validate = function(doc) {
// clear item_code (name is from item_code)
//console.log(Boolean(doc.is_accessory));
if(!Boolean(doc.is_accessory)){
doc.item_code = “”;

if(doc.factory_shortname){
 
  doc.item_code += doc.factory_shortname;
}

if(doc.serial_number){
  doc.item_code += doc.serial_number;
}

if(doc.p_m_abbr){
  doc.item_code += doc.p_m_abbr;
}

if(doc.others_abbr){
  doc.item_code += doc.others_abbr;
}

if(doc.method_of_m_abbr){
  doc.item_code += doc.method_of_m_abbr;
}

 if(doc.method_of_p_abbr){
  doc.item_code += doc.method_of_p_abbr;
}

 if(doc.others_method_abbr){
  doc.item_code += doc.others_method_abbr;
}
}

}

@hellorachel,

Custom Script seems ok can you please check for the error log in Error Log or in frappe-bench/logs directory.

Hi,

Thanks, sorry to bother you. I found I didnt add “Item Price” permission. >‘’<