diff --git a/crm/api/doc.py b/crm/api/doc.py index b79de0c9..7f47b095 100644 --- a/crm/api/doc.py +++ b/crm/api/doc.py @@ -215,6 +215,9 @@ def get_list_data( rows.append(column.get("key")) column["label"] = _(column.get("label")) + if column.get("key") == "_liked_by" and column.get("width") == "10rem": + column["width"] = "50px" + data = frappe.get_list( doctype, fields=rows, @@ -248,6 +251,7 @@ def get_list_data( }, {"label": "Assigned To", "type": "Text", "value": "_assign"}, {"label": "Owner", "type": "Link", "value": "owner", "options": "User"}, + {"label": "Liked By", "type": "Data", "value": "_liked_by"}, ] for field in std_fields: diff --git a/crm/fcrm/doctype/crm_deal/crm_deal.py b/crm/fcrm/doctype/crm_deal/crm_deal.py index d4e3fcaa..d303c572 100644 --- a/crm/fcrm/doctype/crm_deal/crm_deal.py +++ b/crm/fcrm/doctype/crm_deal/crm_deal.py @@ -108,8 +108,8 @@ class CRMDeal(Document): """ sla = get_sla(self) if not sla: - # self.first_responded_on = None - # self.first_response_time = None + self.first_responded_on = None + self.first_response_time = None return self.sla = sla.name diff --git a/crm/fcrm/doctype/crm_lead/crm_lead.py b/crm/fcrm/doctype/crm_lead/crm_lead.py index 0ec3ad81..b8160525 100644 --- a/crm/fcrm/doctype/crm_lead/crm_lead.py +++ b/crm/fcrm/doctype/crm_lead/crm_lead.py @@ -234,8 +234,8 @@ class CRMLead(Document): """ sla = get_sla(self) if not sla: - # self.first_responded_on = None - # self.first_response_time = None + self.first_responded_on = None + self.first_response_time = None return self.sla = sla.name diff --git a/docker/docker-compose.yml b/docker/docker-compose.yml new file mode 100644 index 00000000..b4c8d7c4 --- /dev/null +++ b/docker/docker-compose.yml @@ -0,0 +1,32 @@ +version: "3.7" +name: crm +services: + mariadb: + image: mariadb:10.6 + command: + - --character-set-server=utf8mb4 + - --collation-server=utf8mb4_unicode_ci + - --skip-character-set-client-handshake + - --skip-innodb-read-only-compressed # Temporary fix for MariaDB 10.6 + environment: + MYSQL_ROOT_PASSWORD: 123 + volumes: + - mariadb-data:/var/lib/mysql + + redis: + image: redis:alpine + + frappe: + image: frappe/bench:latest + command: bash /workspace/init.sh + environment: + - SHELL=/bin/bash + working_dir: /home/frappe + volumes: + - .:/workspace + ports: + - 8000:8000 + - 9000:9000 + +volumes: + mariadb-data: \ No newline at end of file diff --git a/docker/init.sh b/docker/init.sh new file mode 100644 index 00000000..1fb4b01f --- /dev/null +++ b/docker/init.sh @@ -0,0 +1,40 @@ +#!bin/bash + +if [ -d "/home/frappe/frappe-bench/apps/frappe" ]; then + echo "Bench already exists, skipping init" + cd frappe-bench + bench start +else + echo "Creating new bench..." +fi + +bench init --skip-redis-config-generation frappe-bench + +cd frappe-bench + +# Use containers instead of localhost +bench set-mariadb-host mariadb +bench set-redis-cache-host redis:6379 +bench set-redis-queue-host redis:6379 +bench set-redis-socketio-host redis:6379 + +# Remove redis, watch from Procfile +sed -i '/redis/d' ./Procfile +sed -i '/watch/d' ./Procfile + +bench get-app crm + +bench new-site crm.localhost \ + --force \ + --mariadb-root-password 123 \ + --admin-password admin \ + --no-mariadb-socket + +bench --site crm.localhost install-app crm +bench --site crm.localhost set-config developer_mode 1 +bench --site crm.localhost clear-cache +bench --site crm.localhost set-config mute_emails 1 +bench --site crm.localhost add-user alex@example.com --first-name Alex --last-name Scott --password 123 --user-type 'System User' --add-role 'crm Admin' +bench use crm.localhost + +bench start \ No newline at end of file diff --git a/frappe-ui b/frappe-ui index 38a7784d..1394a12b 160000 --- a/frappe-ui +++ b/frappe-ui @@ -1 +1 @@ -Subproject commit 38a7784d7be13493e975a9def90a28b1f5cda095 +Subproject commit 1394a12b6de105649c8ca5beeead62a38ef1b18e diff --git a/frontend/package.json b/frontend/package.json index 8742683b..afe2dd24 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -13,7 +13,7 @@ "@vueuse/core": "^10.3.0", "@vueuse/integrations": "^10.3.0", "feather-icons": "^4.28.0", - "frappe-ui": "^0.1.53", + "frappe-ui": "^0.1.55", "gemoji": "^8.1.0", "mime": "^4.0.1", "pinia": "^2.0.33", diff --git a/frontend/src/components/Activities.vue b/frontend/src/components/Activities.vue index c0157e95..f6c27165 100644 --- a/frontend/src/components/Activities.vue +++ b/frontend/src/components/Activities.vue @@ -950,6 +950,10 @@ const props = defineProps({ type: String, default: 'CRM Lead', }, + tabs: { + type: Array, + default: () => [], + }, }) const doc = defineModel() @@ -1078,7 +1082,7 @@ const defaultActions = computed(() => { { icon: h(WhatsAppIcon, { class: 'h-4 w-4' }), label: __('New WhatsApp Message'), - onClick: () => (tabIndex.value = 5), + onClick: () => (tabIndex.value = getTabIndex('WhatsApp')), condition: () => whatsappEnabled.value, }, ] @@ -1354,6 +1358,10 @@ function scroll(hash) { }, 500) } +function getTabIndex(name) { + return props.tabs.findIndex((tab) => tab.name === name) +} + defineExpose({ emailBox }) const route = useRoute() diff --git a/frontend/src/components/CallUI.vue b/frontend/src/components/CallUI.vue index eae9e8f3..2123daf9 100644 --- a/frontend/src/components/CallUI.vue +++ b/frontend/src/components/CallUI.vue @@ -189,7 +189,6 @@