diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index d303c572..901f2179 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -106,6 +106,8 @@ class CRMDeal(Document): """ Find an SLA to apply to the deal. """ + if self.sla: return + sla = get_sla(self) if not sla: self.first_responded_on = None diff --git a/crm/fcrm/doctype/crm_form_script/crm_form_script.py b/crm/fcrm/doctype/crm_form_script/crm_form_script.py index ff93ff4f..c45ff55a 100644 --- a/crm/fcrm/doctype/crm_form_script/crm_form_script.py +++ b/crm/fcrm/doctype/crm_form_script/crm_form_script.py @@ -6,27 +6,7 @@ from frappe.model.document import Document class CRMFormScript(Document): - def validate(self): - self.check_if_duplicate() - - def check_if_duplicate(self): - """Check if there is already a script for this doctype""" - if self.dt and self.enabled: - filters = { - "dt": self.dt, - "view": self.view, - "enabled": 1, - } - if self.name: - filters["name"] = ["!=", self.name] - - if frappe.db.exists("CRM Form Script", filters): - frappe.throw( - frappe._( - "Script already exists for this doctype and is enabled" - ), - frappe.DuplicateEntryError, - ) + pass def get_form_script(dt, view="Form"): """Returns the form script for the given doctype""" @@ -37,11 +17,10 @@ def get_form_script(dt, view="Form"): .where(FormScript.dt == dt) .where(FormScript.view == view) .where(FormScript.enabled == 1) - .limit(1) ) doc = query.run(as_dict=True) if doc: - return doc[0].script + return [d.script for d in doc] if len(doc) > 1 else doc[0].script else: return None diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index b8160525..f4ebe162 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -232,6 +232,8 @@ class CRMLead(Document): """ Find an SLA to apply to the lead. """ + if self.sla: return + sla = get_sla(self) if not sla: self.first_responded_on = None diff --git a/crm/overrides/email_template.py b/crm/overrides/email_template.py index da14c714..3a4e30f7 100644 --- a/crm/overrides/email_template.py +++ b/crm/overrides/email_template.py @@ -41,9 +41,11 @@ class CustomEmailTemplate(EmailTemplate): rows = [ "name", "enabled", + "use_html", "reference_doctype", "subject", "response", + "response_html", "modified", ] return {'columns': columns, 'rows': rows} diff --git a/frontend/package.json b/frontend/package.json index b7b4825c..48b2b0f6 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -27,6 +27,7 @@ }, "devDependencies": { "@vitejs/plugin-vue": "^4.2.3", + "@vitejs/plugin-vue-jsx": "^3.0.1", "autoprefixer": "^10.4.14", "postcss": "^8.4.5", "vite": "^4.4.9", diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index 1baf58a1..4beec830 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -102,11 +102,11 @@ >
@@ -156,10 +156,10 @@
-
+
-
+
@@ -313,7 +310,7 @@
-
+
-
- -
-
-
-
-
-
- - {{ activity.data.sender_full_name }} - · - -
- {{ __(timeAgo(activity.creation)) }} -
-
- -
-
- - - - - - -
-
-
- {{ activity.data.subject }} -
-
- - {{ __('TO') }}: - - {{ activity.data.recipients }} - , - - {{ __('CC') }}: - - {{ activity.data.cc }} - , - - {{ __('BCC') }}: - - {{ activity.data.bcc }} -
-
+
+
+
-
-
- - {{ activity.owner_name }} - - {{ __('added a') }} - - {{ __('comment') }} - -
-
+
+
+ + {{ activity.data.sender_full_name }} + ·
{{ __(timeAgo(activity.creation)) }}
-
-
-
-
-
-
+
+ + + + + + +
+
+
+ {{ activity.data.subject }} +
+
+ + {{ __('TO') }}: + + {{ activity.data.recipients }} + , + + {{ __('CC') }}: + + {{ activity.data.cc }} + , + + {{ __('BCC') }}: + + {{ activity.data.bcc }} +
+ +
+ +
+
+
+
+
+
+ + {{ activity.owner_name }} + + {{ __('added a') }} + + {{ __('comment') }} + +
+
+ +
+ {{ __(timeAgo(activity.creation)) }} +
+
-
-
+
+
+ +
+
+
+
+
+
+ {{ + activity.type == 'Incoming' + ? __('Inbound Call') + : __('Outbound Call') + }} +
+
+ +
+ {{ __(timeAgo(activity.creation)) }} +
+
+
+
+
+
+ +
{{ __('Duration') }}
+
+ {{ activity.duration }} +
+
+
+ +
{{ - activity.type == 'Incoming' - ? __('Inbound Call') - : __('Outbound Call') + activity.show_recording + ? __('Hide Recording') + : __('Listen to Call') }}
-
- -
- {{ __(timeAgo(activity.creation)) }} -
-
-
-
-
- -
{{ __('Duration') }}
-
- {{ activity.duration }} -
-
-
- -
- {{ - activity.show_recording - ? __('Hide Recording') - : __('Listen to Call') - }} -
-
-
-
- -
-
-
- -
-
- {{ __(activity.caller.label) }} -
-
- {{ activity.from }} -
-
-
- +
+ +
+
+
+ -
- -
-
- {{ __(activity.receiver.label) }} -
-
- {{ activity.to }} -
+
+
+ {{ __(activity.caller.label) }} +
+
+ {{ activity.from }} +
+
+
+ +
+ +
+
+ {{ __(activity.receiver.label) }} +
+
+ {{ activity.to }}
-
-
-
- - {{ activity.owner_name }} - - {{ __(activity.type) }} +
+
+
+
+ + {{ activity.owner_name }} + + {{ __(activity.type) }} + + {{ __(activity.data.field_label) }} + + {{ __(activity.value) }} + +
+ + {{ getUser(activity.data.old_value).full_name }} +
+
+ {{ activity.data.old_value }} +
+
+ {{ __('to') }} + +
+ + {{ getUser(activity.data.value).full_name }} +
+
+ {{ activity.data.value }} +
+
+
+ +
+ +
+ {{ __(timeAgo(activity.creation)) }} +
+
+
+
+
+
+
{{ __(activity.data.field_label) }} - {{ __(activity.value) }} + +
+
+ {{ + startCase(__(activity.type)) + }}
- -
- -
- {{ __(timeAgo(activity.creation)) }} -
-
-
-
+ +
+ {{ __(timeAgo(activity.creation)) }} +
+
+
+
+
+
-
- -
+ +
@@ -891,6 +882,7 @@ /> diff --git a/frontend/src/components/EmailContent.vue b/frontend/src/components/EmailContent.vue new file mode 100644 index 00000000..edade130 --- /dev/null +++ b/frontend/src/components/EmailContent.vue @@ -0,0 +1,127 @@ +