fix: enabling erpnext integration not creating form script

This commit is contained in:
Shariq Ansari 2024-09-17 14:51:22 +05:30
parent e60d74cdac
commit d1c37c11fc
2 changed files with 5 additions and 1 deletions

View File

@ -18,6 +18,10 @@ frappe.ui.form.on("CRM Form Script", {
);
}
if (!frappe.boot.developer_mode) {
frm.toggle_enable("is_standard", 0);
}
frm.trigger("add_enable_button");
},

View File

@ -14,7 +14,7 @@ class CRMFormScript(Document):
or frappe.flags.in_test
or frappe.flags.in_fixtures
)
if in_user_env and self.is_standard and not frappe.conf.developer_mode:
if in_user_env and not self.is_new() and self.is_standard and not frappe.conf.developer_mode:
# only enabled can be changed for standard form scripts
if self.has_value_changed("enabled"):
enabled_value = self.enabled