update events
This commit is contained in:
parent
041e9f5461
commit
fa9d64bb1a
@ -11,4 +11,12 @@ def after_insert(doc, method):
|
||||
address_doc.save()
|
||||
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")
|
||||
frappe.log_error(f"Error in estimate after_insert: {str(e)}", "Estimate Hook Error")
|
||||
|
||||
def after_save(doc, method):
|
||||
if not doc.custom_sent:
|
||||
return
|
||||
print("DEBUG: Quotation has been sent, updating Address status")
|
||||
address_doc = frappe.get_doc("Address", doc.custom_installation_address)
|
||||
address_doc.custom_estimate_sent_status = "Completed"
|
||||
address_doc.save()
|
||||
@ -8,11 +8,3 @@ def after_insert(doc, method):
|
||||
address_doc.custom_estimate_sent_status = "In Progress"
|
||||
address_doc.save()
|
||||
|
||||
|
||||
def after_save(doc, method):
|
||||
if not doc.custom_sent:
|
||||
return
|
||||
print("DEBUG: Quotation has been sent, updating Address status")
|
||||
address_doc = frappe.get_doc("Address", doc.custom_installation_address)
|
||||
address_doc.custom_quotation_sent = "Completed"
|
||||
address_doc.save()
|
||||
@ -160,13 +160,15 @@ add_to_apps_screen = [
|
||||
|
||||
doc_events = {
|
||||
"On-Site Meeting": {
|
||||
"after_insert": "custom_ui.events.onsite_meeting.after_insert"
|
||||
"after_insert": "custom_ui.events.onsite_meeting.after_insert",
|
||||
"on_update": "custom_ui.events.onsite_meeting.on_update"
|
||||
},
|
||||
"Address": {
|
||||
"after_insert": "custom_ui.events.address.after_insert"
|
||||
},
|
||||
"Quotation": {
|
||||
"after_insert": "custom_ui.events.estimate.after_insert"
|
||||
"after_insert": "custom_ui.events.estimate.after_insert",
|
||||
"after_save": "custom_ui.events.estimate.after_save"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user