switch non-working features to have notifications

This commit is contained in:
Casey 2025-12-02 09:58:29 -06:00
parent 0bad4dbc95
commit 77fce34c05
7 changed files with 35 additions and 20 deletions

View file

@ -3,19 +3,13 @@ import frappe
def after_insert(doc, method):
try:
print("DEBUG: after_insert hook triggered for Quotation:", doc.name)
print("DEBUG: custom_installation_address:", doc.custom_installation_address)
if not doc.custom_installation_address:
print("ERROR: custom_installation_address is empty")
return
address_doc = frappe.get_doc("Address", doc.custom_installation_address)
print("DEBUG: Retrieved address document:", address_doc.name)
address_doc.custom_estimate_sent_status = "In Progress"
address_doc.save()
print("DEBUG: Address status updated successfully")
except Exception as e:
print("ERROR in after_insert hook:", str(e))
frappe.log_error(f"Error in estimate after_insert: {str(e)}", "Estimate Hook Error")

View file

@ -1,7 +1,8 @@
import frappe
def after_insert(doc, method):
print(doc.address)
print("DEBUG: After Insert Triggered for On-Site Meeting")
print("DEBUG: Updating on-site meeting status in Address")
if doc.address and not doc.end_time and not doc.start_time:
address_doc = frappe.get_doc("Address", doc.address)
address_doc.custom_onsite_meeting_scheduled = "In Progress"

View file

@ -6,6 +6,15 @@ from .utils import create_module
def after_install():
create_module()
add_custom_fields()
update_onsite_meeting_fields()
frappe.db.commit()
# Proper way to refresh metadata
frappe.clear_cache(doctype="Address")
frappe.reload_doctype("Address")
frappe.clear_cache(doctype="On-Site Meeting")
frappe.reload_doctype("On-Site Meeting")
update_address_fields()
build_frontend()
def after_migrate():