fix: move sla details from lead to deal on convertion

This commit is contained in:
Shariq Ansari 2023-12-14 14:39:43 +05:30
parent 8187d17154
commit ee8f5d8188
2 changed files with 14 additions and 0 deletions

View File

@ -125,6 +125,19 @@ class CRMLead(Document):
"contacts": [{"contact": contact}],
}
)
if self.first_responded_on:
deal.update(
{
"sla_creation": self.sla_creation,
"response_by": self.response_by,
"sla_status": self.sla_status,
"communication_status": self.communication_status,
"first_response_time": self.first_response_time,
"first_responded_on": self.first_responded_on
}
)
deal.insert(ignore_permissions=True)
return deal.name

View File

@ -377,6 +377,7 @@ function getParsedFields(sections) {
}
async function convertToDeal() {
updateField('communication_status', 'Replied')
let deal = await call('crm.fcrm.doctype.crm_lead.crm_lead.convert_to_deal', {
lead: lead.data.name,
})