estimate
This commit is contained in:
parent
afa161a0cf
commit
c35689aaf8
3 changed files with 26 additions and 3 deletions
21
custom_ui/events/estimate.py
Normal file
21
custom_ui/events/estimate.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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")
|
||||
Loading…
Add table
Add a link
Reference in a new issue