Validation Error

I’ve JS file like:

frappe.ui.form.on('Hardware Case', {
        vendor(frm) {
                let vendor = frm.doc.vendor
                console.log(vendor)
                if (vendor){
                   frappe.call({
                  method: "spms.hardware_management_system.doctype.hardware_case.get_assignee_by_vendor",
                  args: {
                 vendor: vendor },
           }).done((r) =>{
               console.log(r)
           })
                }

        }
})

And server side python file:

import frappe
from frappe.model.document import Document


class HardwareCase(Document):
        pass

@frappe.whitelist()
def get_assignee_by_vendor(vendor):
    print(vendor)
    return vendor

But getting below error on event change of one field:

frappe.exceptions.ValidationError: Failed to get method for command spms.hardware_management_system.doctype.hardware_case.get_assignee_by_vendor with module 'spms.hardware_management_system.doctype.hardware_case' has no attribute 'get_assignee_by_vendor'

@Narayan_Banik

Method path will be

spms.hardware_management_system.doctype.hardware_case.hardware_case.get_assignee_by_vendor

You mean without double quotation ?

@Narayan_Banik

"spms.hardware_management_system.doctype.hardware_case.hardware_case.get_assignee_by_vendor"

Thanks…its folder and then filename… Got it thanks.
hardware_case.hardware_case

1 Like