mirror of
https://github.com/frappe/erpnext.git
synced 2026-08-13 14:41:53 +00:00
fix(frappe_crm_api): handle failure for after_app_install and after_app_uninstall
(cherry picked from commit 2de423e225)
This commit is contained in:
@@ -192,22 +192,28 @@ def is_crm_installed():
|
|||||||
|
|
||||||
|
|
||||||
def remove_allowed_users_on_crm_install():
|
def remove_allowed_users_on_crm_install():
|
||||||
CRMSettings = frappe.get_single("CRM Settings")
|
try:
|
||||||
|
CRMSettings = frappe.get_single("CRM Settings")
|
||||||
|
|
||||||
if not CRMSettings.enable_frappe_crm_data_synchronization:
|
if not CRMSettings.enable_frappe_crm_data_synchronization:
|
||||||
return
|
return
|
||||||
|
|
||||||
CRMSettings.allowed_users = []
|
CRMSettings.allowed_users = []
|
||||||
CRMSettings.save()
|
CRMSettings.save()
|
||||||
click.secho("Removed Allowed Users from CRM Settings.")
|
click.secho("Removed 'Allowed Users' from CRM Settings.")
|
||||||
|
except Exception:
|
||||||
|
click.secho("'Allowed Users' from CRM Settings couldn't be cleared.")
|
||||||
|
|
||||||
|
|
||||||
def disable_frappe_crm_data_synchronization_on_crm_uninstall():
|
def disable_frappe_crm_data_synchronization_on_crm_uninstall():
|
||||||
CRMSettings = frappe.get_single("CRM Settings")
|
try:
|
||||||
|
CRMSettings = frappe.get_single("CRM Settings")
|
||||||
|
|
||||||
if not CRMSettings.enable_frappe_crm_data_synchronization:
|
if not CRMSettings.enable_frappe_crm_data_synchronization:
|
||||||
return
|
return
|
||||||
|
|
||||||
CRMSettings.enable_frappe_crm_data_synchronization = 0
|
CRMSettings.enable_frappe_crm_data_synchronization = 0
|
||||||
CRMSettings.save()
|
CRMSettings.save()
|
||||||
click.secho("Enable Frappe CRM Data Synchronization on CRM Settings has been disabled.")
|
click.secho("'Enable Frappe CRM Data Synchronization' on CRM Settings has been disabled.")
|
||||||
|
except Exception:
|
||||||
|
click.secho("'Enable Frappe CRM Data Synchronization' on CRM Settings could not be disabled.")
|
||||||
|
|||||||
Reference in New Issue
Block a user