diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index 8e56dad0..e9a1dd61 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -18,7 +18,6 @@ class CRMDeal(Document): def validate(self): self.set_primary_contact() self.set_primary_email_mobile_no() - self.update_organization() if self.deal_owner and not self.is_new(): self.share_with_agent(self.deal_owner) self.assign_agent(self.deal_owner) @@ -69,20 +68,6 @@ class CRMDeal(Document): self.mobile_no = "" self.phone = "" - def update_organization(self): - if self.organization: - if self.has_value_changed("organization"): - organization = frappe.get_cached_doc("CRM Organization", self.organization) - self.website = organization.website - self.territory = organization.territory - self.annual_revenue = organization.annual_revenue - if self.has_value_changed("website"): - frappe.db.set_value("CRM Organization", self.organization, "website", self.website) - if self.has_value_changed("territory"): - frappe.db.set_value("CRM Organization", self.organization, "territory", self.territory) - if self.has_value_changed("annual_revenue"): - frappe.db.set_value("CRM Organization", self.organization, "annual_revenue", self.annual_revenue) - def assign_agent(self, agent): if not agent: return diff --git a/crm/fcrm/doctype/crm_organization/crm_organization.py b/crm/fcrm/doctype/crm_organization/crm_organization.py index f1ecaae9..6d9a2a14 100644 --- a/crm/fcrm/doctype/crm_organization/crm_organization.py +++ b/crm/fcrm/doctype/crm_organization/crm_organization.py @@ -6,26 +6,6 @@ from frappe.model.document import Document class CRMOrganization(Document): - def on_update(self): - self.update_deal_organization_fields() - - def update_deal_organization_fields(self): - if ( - self.has_value_changed("website") - or self.has_value_changed("territory") - or self.has_value_changed("annual_revenue") - ): - for deal in frappe.get_all( - "CRM Deal", - filters={"organization": self.name}, - ): - if self.has_value_changed("website"): - frappe.db.set_value("CRM Deal", deal.name, "website", self.website) - if self.has_value_changed("territory"): - frappe.db.set_value("CRM Deal", deal.name, "territory", self.territory) - if self.has_value_changed("annual_revenue"): - frappe.db.set_value("CRM Deal", deal.name, "annual_revenue", self.annual_revenue) - @staticmethod def default_list_data(): columns = [ diff --git a/frontend/src/pages/Deals.vue b/frontend/src/pages/Deals.vue index efa64340..71c0096b 100644 --- a/frontend/src/pages/Deals.vue +++ b/frontend/src/pages/Deals.vue @@ -101,15 +101,13 @@ const rows = computed(() => { deals.value.data.rows.forEach((row) => { _rows[row] = deal[row] - let org = getOrganization(deal.organization) - if (row == 'organization') { _rows[row] = { label: deal.organization, - logo: org?.organization_logo, + logo: getOrganization(deal.organization)?.organization_logo, } } else if (row == 'annual_revenue') { - _rows[row] = formatNumberIntoCurrency(org?.annual_revenue) + _rows[row] = formatNumberIntoCurrency(deal.annual_revenue) } else if (row == 'status') { _rows[row] = { label: deal.status,