Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server Script it't not working #44374

Open
yahyaoudra opened this issue Nov 27, 2024 · 0 comments
Open

Server Script it't not working #44374

yahyaoudra opened this issue Nov 27, 2024 · 0 comments
Labels

Comments

@yahyaoudra
Copy link

Information about bug

I'm experiencing an issue where server scripts are not executing as expected in ERPNext v15. Specifically, I've created a simple server script that is intended to run on the Customer doctype with the After Insert event, but the script doesn't appear to trigger at all. I've verified the script setup and also attempted different document types and events, but none seem to work.

Environment:

ERPNext Version: 15.43.3
Frappe Version: v15.48.1

Steps to Reproduce:

Go to Settings > Server Script and create a new server script.
Script Type: Document Event
Reference Document Type: Customer
Event: After Insert

Script:
python
Copy code

def create_project_and_tasks(doc, method):
    frappe.log_error(title="Server Script Trigger Test", message=f"Server script has been triggered for the document: {doc.name}")
    frappe.throw("Server script triggered successfully.")

Save the script and ensure it is Active.
Create a new Customer from the Customer doctype.
Expected Behavior:

When a new customer is created, the server script should:
Log an entry in the Error Log with the title "Server Script Trigger Test".
Raise an error saying "Server script triggered successfully."

Actual Behavior:

No log entries are created in the Error Log.
No pop-up error is displayed after saving the customer.
It appears that the server script is not being triggered at all.
Additional Details:

I have verified that the server script feature is enabled in the site_config.json with "server_script_enabled": true.
I have also tried other document types (e.g., Sales Order) and different events (Before Insert, Before Save).
Client scripts are working fine, and I can confirm that client-side execution triggers as expected.
I tried restarting the bench and verified that the script is active and permissions are appropriate, but still no luck.
No relevant logs or errors appear in the Error Log or in the bench console when running the server script.

Steps Taken for Troubleshooting:

Restarted ERPNext services using bench restart.
Ensured that the server script feature is enabled.
Tested on different doctypes and events.
Verified user permissions and logged in as an administrator.
Monitored the bench console but didn't observe any related errors or logs.

Module

selling, other

Version

ERPNext Version: 15.43.3
Frappe Version: v15.48.1

Installation method

manual install

Relevant log output / Stack trace / Full Error Message.

No response

@yahyaoudra yahyaoudra added the bug label Nov 27, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant