Merge pull request #1152 from shariquerik/fixes-4

This commit is contained in:
Shariq Ansari 2025-08-19 02:18:51 +05:30 committed by GitHub
commit 89cce5160c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 91 additions and 83 deletions

View File

@ -192,7 +192,7 @@ def add_default_fields_layout(force=False):
},
"CRM Deal-Data Fields": {
"doctype": "CRM Deal",
"layout": '[{"label": "Details", "name": "details_section", "opened": true, "columns": [{"name": "column_z9XL", "fields": ["organization", "annual_revenue", "next_step"]}, {"name": "column_gM4w", "fields": ["website", "close_date", "deal_owner"]}, {"name": "column_gWmE", "fields": ["territory", "probability"]}]}]',
"layout": '[{"name":"first_tab","sections":[{"label":"Details","name":"details_section","opened":true,"columns":[{"name":"column_z9XL","fields":["organization","annual_revenue","next_step"]},{"name":"column_gM4w","fields":["website","closed_date","deal_owner"]},{"name":"column_gWmE","fields":["territory","probability"]}]},{"label":"Products","name":"section_jHhQ","opened":true,"columns":[{"name":"column_xiNF","fields":["products"]}],"editingLabel":false,"hideLabel":true},{"label":"New Section","name":"section_WNOQ","opened":true,"columns":[{"name":"column_ziBW","fields":["total"]},{"label":"","name":"column_wuwA","fields":["net_total"]}],"hideBorder":true,"hideLabel":true}]}]',
},
}

View File

@ -14,4 +14,5 @@ crm.patches.v1_0.update_layouts_to_new_format
crm.patches.v1_0.move_twilio_agent_to_telephony_agent
crm.patches.v1_0.create_default_scripts # 13-06-2025
crm.patches.v1_0.update_deal_status_probabilities
crm.patches.v1_0.update_deal_status_type
crm.patches.v1_0.update_deal_status_type
crm.patches.v1_0.create_default_lost_reasons

View File

@ -0,0 +1,5 @@
from crm.install import add_default_lost_reasons
def execute():
add_default_lost_reasons()

@ -1 +1 @@
Subproject commit b295b54aaa3a2a22f455df819d87433dc6b9ff6a
Subproject commit 136f2715c2bd22b7390a2a02f1849a147d16b191

View File

@ -143,8 +143,9 @@ import ColumnsIcon from '@/components/Icons/ColumnsIcon.vue'
import EditIcon from '@/components/Icons/EditIcon.vue'
import DragIcon from '@/components/Icons/DragIcon.vue'
import ReloadIcon from '@/components/Icons/ReloadIcon.vue'
import Autocomplete from '@/components/frappe-ui/Autocomplete.vue'
import { isTouchScreenDevice } from '@/utils'
import { Autocomplete, Popover } from 'frappe-ui'
import { Popover } from 'frappe-ui'
import Draggable from 'vuedraggable'
import { computed, ref } from 'vue'
import { watchOnce } from '@vueuse/core'
@ -209,6 +210,7 @@ const fields = computed(() => {
})
function addColumn(c) {
if (!c) return
let align = ['Float', 'Int', 'Percent', 'Currency'].includes(c.type)
? 'right'
: 'left'

View File

@ -52,10 +52,10 @@
>
</div>
</div>
<div class="w-12">
<div class="flex items-center justify-center w-12">
<Button
:tooltip="__('Edit grid fields')"
class="flex w-full items-center justify-center rounded !bg-surface-gray-2 border-0 !text-ink-gray-5"
class="rounded !bg-surface-gray-2 border-0 !text-ink-gray-5"
variant="outline"
icon="settings"
@click="showGridFieldsEditorModal = true"
@ -275,10 +275,10 @@
/>
</div>
</div>
<div class="edit-row w-12">
<div class="edit-row flex items-center justify-center w-12">
<Button
:tooltip="__('Edit row')"
class="flex w-full items-center justify-center rounded border-0 !text-ink-gray-7"
class="rounded border-0 !text-ink-gray-7"
variant="outline"
:icon="EditIcon"
@click="showRowList[index] = true"

View File

@ -36,7 +36,7 @@
</div>
</div>
<div class="px-4 pt-4 pb-7 sm:px-6">
<div class="space-y-2">
<div class="flex justify-end gap-2">
<Button
class="w-full"
v-for="action in dialogOptions.actions"
@ -60,7 +60,7 @@ import { showQuickEntryModal, quickEntryProps } from '@/composables/modals'
import { getRandom } from '@/utils'
import { capture } from '@/telemetry'
import { useDocument } from '@/data/document'
import { FeatherIcon, createResource, ErrorMessage, Badge } from 'frappe-ui'
import { createResource, ErrorMessage, Badge } from 'frappe-ui'
import { ref, nextTick, computed, onMounted } from 'vue'
const props = defineProps({

View File

@ -1,17 +1,5 @@
<template>
<Dialog
v-model="show"
:options="{
size: 'xl',
actions: [
{
label: editMode ? __('Update') : __('Create'),
variant: 'solid',
onClick: () => updateNote(),
},
],
}"
>
<Dialog v-model="show" :options="{ size: 'xl' }">
<template #body-title>
<div class="flex items-center gap-3">
<h3 class="text-2xl font-semibold leading-6 text-ink-gray-9">
@ -58,6 +46,15 @@
<ErrorMessage class="mt-4" v-if="error" :message="__(error)" />
</div>
</template>
<template #actions>
<div class="flex justify-end">
<Button
:label="editMode ? __('Update') : __('Create')"
variant="solid"
@click="updateNote"
/>
</div>
</template>
</Dialog>
</template>

View File

@ -1,17 +1,5 @@
<template>
<Dialog
v-model="show"
:options="{
size: 'xl',
actions: [
{
label: editMode ? __('Update') : __('Create'),
variant: 'solid',
onClick: () => updateTask(),
},
],
}"
>
<Dialog v-model="show" :options="{ size: 'xl' }">
<template #body-title>
<div class="flex items-center gap-3">
<h3 class="text-2xl font-semibold leading-6 text-ink-gray-9">
@ -90,13 +78,15 @@
</Tooltip>
</template>
</Link>
<DateTimePicker
class="datepicker w-36"
v-model="_task.due_date"
:placeholder="__('01/04/2024 11:30 PM')"
:formatter="(date) => getFormat(date, '', true, true)"
input-class="border-none"
/>
<div class="w-36">
<DateTimePicker
class="datepicker"
v-model="_task.due_date"
:placeholder="__('01/04/2024 11:30 PM')"
:formatter="(date) => getFormat(date, '', true, true)"
input-class="border-none"
/>
</div>
<Dropdown :options="taskPriorityOptions(updateTaskPriority)">
<Button :label="_task.priority" class="justify-between w-full">
<template #prefix>
@ -108,6 +98,15 @@
<ErrorMessage class="mt-4" v-if="error" :message="__(error)" />
</div>
</template>
<template #actions>
<div class="flex justify-end">
<Button
:label="editMode ? __('Update') : __('Create')"
variant="solid"
@click="updateTask"
/>
</div>
</template>
</Dialog>
</template>

View File

@ -84,7 +84,7 @@
<template #target="{ isOpen, togglePopover }">
<Button
:label="doc[field.fieldname]"
class="dropdown-button flex w-full items-center justify-between rounded border border-gray-100 bg-surface-gray-2 px-2 py-1.5 text-base text-ink-gray-8 placeholder-ink-gray-4 transition-colors hover:border-outline-gray-modals hover:bg-surface-gray-3 focus:border-outline-gray-4 focus:bg-surface-white focus:shadow-sm focus:outline-none focus:ring-0 focus-visible:ring-2 focus-visible:ring-outline-gray-3"
class="dropdown-button flex items-center justify-between bg-surface-white !px-2.5 py-1.5 text-base text-ink-gray-8 placeholder-ink-gray-4 transition-colors hover:bg-surface-white focus:bg-surface-white focus:shadow-sm focus:outline-none focus:ring-0"
@click="togglePopover"
>
<div

View File

@ -65,55 +65,59 @@
>
<div class="flex flex-1 items-center overflow-hidden pl-1 gap-2">
<FadedScrollableDiv
class="flex items-center gap-2 overflow-x-auto -ml-1"
class="flex overflow-x-auto -ml-1"
orientation="horizontal"
>
<Draggable
class="flex gap-2"
class="flex w-full gap-2 items-center"
:list="newQuickFilters"
group="filters"
item-key="fieldname"
>
<template #item="{ element: filter }">
<Button class="group whitespace-nowrap cursor-grab">
<template #default>
<Tooltip :text="filter.fieldname">
<span>{{ filter.label }}</span>
</Tooltip>
</template>
<template #suffix>
<FeatherIcon
class="h-3.5 cursor-pointer group-hover:flex hidden"
name="x"
@click.stop="removeQuickFilter(filter)"
/>
</template>
</Button>
<div class="group whitespace-nowrap cursor-grab">
<Button class="cursor-grab">
<template #default>
<Tooltip :text="filter.fieldname">
<span>{{ filter.label }}</span>
</Tooltip>
</template>
<template #suffix>
<FeatherIcon
class="h-3.5 cursor-pointer group-hover:flex hidden"
name="x"
@click.stop="removeQuickFilter(filter)"
/>
</template>
</Button>
</div>
</template>
</Draggable>
</FadedScrollableDiv>
<Autocomplete
value=""
:options="quickFilterOptions"
@change="(e) => addQuickFilter(e)"
>
<template #target="{ togglePopover }">
<Button
class="whitespace-nowrap mr-2"
variant="ghost"
:label="__('Add filter')"
iconLeft="plus"
@click="togglePopover()"
/>
</template>
<template #item-label="{ option }">
<Tooltip :text="option.value" :hover-delay="1">
<div class="flex-1 truncate text-ink-gray-7">
{{ option.label }}
</div>
</Tooltip>
</template>
</Autocomplete>
<div>
<Autocomplete
value=""
:options="quickFilterOptions"
@change="(e) => addQuickFilter(e)"
>
<template #target="{ togglePopover }">
<Button
class="whitespace-nowrap mr-2"
variant="ghost"
:label="__('Add filter')"
iconLeft="plus"
@click="togglePopover()"
/>
</template>
<template #item-label="{ option }">
<Tooltip :text="option.value" :hover-delay="1">
<div class="flex-1 truncate text-ink-gray-7">
{{ option.label }}
</div>
</Tooltip>
</template>
</Autocomplete>
</div>
</div>
<div class="-ml-2 h-[70%] border-l" />
<div class="flex gap-1">

View File

@ -362,7 +362,7 @@ const breadcrumbs = computed(() => {
const title = computed(() => {
let t = doctypeMeta['CRM Lead']?.title_field || 'name'
return doc?.[t] || props.leadId
return doc.value?.[t] || props.leadId
})
const statuses = computed(() => {