Custom app error

hooks.py
“Issue”: {
“validate”: “diamondpharma.diamondpharma.api.test”
}

def test(doc, method=None):
frappe.msgprint(“Validate method triggered!”)

i got this error :
frame_ant.js:1 POST http://10.5.1.202/api/method/frappe.desk.form.save.savedocs 500 (INTERNAL SERVER ERROR)

(anonymous) @ frame_ant.js:1
send @ jquery.js:10109
ajax @ jquery.js:9690
(anonymous) @ request.js:268
(anonymous) @ request.js:105
h @ save.js:245
n @ save.js:23
(anonymous) @ save.js:272
(anonymous) @ form.js:808
Promise.then
(anonymous) @ dom.js:262
(anonymous) @ dom.js:260
validate_and_save @ form.js:799
(anonymous) @ form.js:738
save @ form.js:735
Save @ toolbar.js:670
(anonymous) @ page.js:268
dispatch @ jquery.js:5430
(anonymous) @ jquery.js:5234

i created new custom app and it worked with the new app i created .
no issues can any one help please

@hayyan_daood where exactly you got the error . what is the scenario ?

@bahaou , i solved the issue .

i went to bench console
and tried the the function there

bench console
import frappe
from diamonpharma.diamondpharma.api import test

doc = frappe.get_value(“Issue”,“ISS-2025-00069”)
test(doc)

the error was in the file api.py

SalarySlip is not in this path .

from erpnext.payroll.doctype.salary_slip.salary_slip import SalarySlip

i have been updated the the bench and frappe to version 15 so the SalarySlip class was not in this path .

this was the issue .

thank you for your response