Merge pull request #1038 from shariquerik/to-status-type-1

This commit is contained in:
Shariq Ansari 2025-07-15 12:39:07 +05:30 committed by GitHub
commit 1e245e7719
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -22,6 +22,8 @@ def get_duration(from_date, to_date):
def add_status_change_log(doc):
to_status_type = frappe.db.get_value("CRM Deal Status", doc.status, "type") if doc.status else None
if not doc.is_new():
previous_status = doc.get_doc_before_save().status if doc.get_doc_before_save() else None
previous_status_type = (
@ -41,7 +43,6 @@ def add_status_change_log(doc):
"log_owner": frappe.session.user,
},
)
to_status_type = frappe.db.get_value("CRM Deal Status", doc.status, "type") if doc.status else None
last_status_change = doc.status_change_log[-1]
last_status_change.to = doc.status
last_status_change.to_type = to_status_type or ""