Skip to content

Commit

Permalink
Merge pull request #349 from frappe/develop
Browse files Browse the repository at this point in the history
chore: Merge develop to main
  • Loading branch information
shariquerik authored Sep 13, 2024
2 parents 236aae9 + 681c0a8 commit 014a550
Show file tree
Hide file tree
Showing 60 changed files with 443 additions and 37 deletions.
3 changes: 3 additions & 0 deletions crm/api/doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,9 @@ def get_fields(doctype: str, allow_all_fieldtypes: bool = False):
"mandatory": field.reqd,
"read_only": field.read_only,
"hidden": field.hidden,
"depends_on": field.depends_on,
"mandatory_depends_on": field.mandatory_depends_on,
"read_only_depends_on": field.read_only_depends_on,
})

return _fields
Expand Down
22 changes: 22 additions & 0 deletions crm/fcrm/doctype/crm_form_script/crm_form_script.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,29 @@ frappe.ui.form.on("CRM Form Script", {
istable: 0,
},
});

if (frm.doc.is_standard && !frappe.boot.developer_mode) {
frm.disable_form();
frappe.show_alert(
__(
"Standard Form Scripts can not be modified, duplicate the Form Script instead."
)
);
}

frm.trigger("add_enable_button");
},

add_enable_button(frm) {
frm.add_custom_button(
frm.doc.enabled ? __("Disable") : __("Enable"),
() => {
frm.set_value("enabled", !frm.doc.enabled);
frm.save();
}
);
},

view(frm) {
let has_form_boilerplate = frm.doc.script.includes(
"function setupForm("
Expand Down
10 changes: 9 additions & 1 deletion crm/fcrm/doctype/crm_form_script/crm_form_script.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
"view",
"column_break_gboh",
"enabled",
"is_standard",
"section_break_xeox",
"script"
],
Expand Down Expand Up @@ -52,11 +53,18 @@
"label": "Apply To",
"options": "Form\nList",
"set_only_once": 1
},
{
"default": "0",
"fieldname": "is_standard",
"fieldtype": "Check",
"label": "Is Standard",
"no_copy": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-04-10 18:27:17.617602",
"modified": "2024-09-11 12:56:09.288849",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Form Script",
Expand Down
17 changes: 16 additions & 1 deletion crm/fcrm/doctype/crm_form_script/crm_form_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,26 @@
# For license information, please see license.txt

import frappe
from frappe import _
from frappe.model.document import Document


class CRMFormScript(Document):
pass
def validate(self):
in_user_env = not (
frappe.flags.in_install
or frappe.flags.in_patch
or frappe.flags.in_test
or frappe.flags.in_fixtures
)
if in_user_env and self.is_standard and not frappe.conf.developer_mode:
# only enabled can be changed for standard form scripts
if self.has_value_changed("enabled"):
enabled_value = self.enabled
self.reload()
self.enabled = enabled_value
else:
frappe.throw(_("You need to be in developer mode to edit a Standard Form Script"))

def get_form_script(dt, view="Form"):
"""Returns the form script for the given doctype"""
Expand Down
11 changes: 9 additions & 2 deletions crm/fcrm/doctype/crm_organization/crm_organization.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
"column_break_pnpp",
"website",
"territory",
"industry"
"industry",
"address"
],
"fields": [
{
Expand Down Expand Up @@ -68,12 +69,18 @@
"fieldtype": "Link",
"label": "Currency",
"options": "Currency"
},
{
"fieldname": "address",
"fieldtype": "Link",
"label": "Address",
"options": "Address"
}
],
"image_field": "organization_logo",
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-06-20 12:59:55.297752",
"modified": "2024-09-13 15:52:05.106389",
"modified_by": "Administrator",
"module": "FCRM",
"name": "CRM Organization",
Expand Down
8 changes: 6 additions & 2 deletions crm/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ def add_default_fields_layout():
},
"Contact-Quick Entry": {
"doctype": "Contact",
"layout": '[{"label":"Salutation","columns":1,"fields":["salutation"],"hideLabel":true},{"label":"Full Name","columns":2,"hideBorder":true,"fields":["first_name","last_name"],"hideLabel":true},{"label":"Email","columns":1,"hideBorder":true,"fields":["email_id"],"hideLabel":true},{"label":"Mobile No. & Gender","columns":2,"hideBorder":true,"fields":["mobile_no","gender"],"hideLabel":true},{"label":"Organization","columns":1,"hideBorder":true,"fields":["company_name"],"hideLabel":true},{"label":"Designation","columns":1,"hideBorder":true,"fields":["designation"],"hideLabel":true}]'
"layout": '[{"label":"Salutation","columns":1,"fields":["salutation"],"hideLabel":true},{"label":"Full Name","columns":2,"hideBorder":true,"fields":["first_name","last_name"],"hideLabel":true},{"label":"Email","columns":1,"hideBorder":true,"fields":["email_id"],"hideLabel":true},{"label":"Mobile No. & Gender","columns":2,"hideBorder":true,"fields":["mobile_no","gender"],"hideLabel":true},{"label":"Organization","columns":1,"hideBorder":true,"fields":["company_name"],"hideLabel":true},{"label":"Designation","columns":1,"hideBorder":true,"fields":["designation"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["address"],"hideLabel":true}]'
},
"CRM Organization-Quick Entry": {
"doctype": "CRM Organization",
"layout": '[{"label":"Organization Name","columns":1,"fields":["organization_name"],"hideLabel":true},{"label":"Website & Revenue","columns":2,"hideBorder":true,"fields":["website","annual_revenue"],"hideLabel":true},{"label":"Territory","columns":1,"hideBorder":true,"fields":["territory"],"hideLabel":true},{"label":"No of Employees & Industry","columns":2,"hideBorder":true,"fields":["no_of_employees","industry"],"hideLabel":true}]'
"layout": '[{"label":"Organization Name","columns":1,"fields":["organization_name"],"hideLabel":true},{"label":"Website & Revenue","columns":2,"hideBorder":true,"fields":["website","annual_revenue"],"hideLabel":true},{"label":"Territory","columns":1,"hideBorder":true,"fields":["territory"],"hideLabel":true},{"label":"No of Employees & Industry","columns":2,"hideBorder":true,"fields":["no_of_employees","industry"],"hideLabel":true},{"label":"Address","columns":1,"hideBorder":true,"fields":["address"],"hideLabel":true}]'
},
"Address-Quick Entry": {
"doctype": "Address",
"layout": '[{"label":"Address","columns":1,"fields":["address_title","address_type","address_line1","address_line2","city","state","country","pincode"],"hideLabel":true}]'
},
}

Expand Down
2 changes: 1 addition & 1 deletion crm/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ crm.patches.v1_0.move_crm_note_data_to_fcrm_note
[post_model_sync]
# Patches added in this section will be executed after doctypes are migrated
crm.patches.v1_0.create_email_template_custom_fields
crm.patches.v1_0.create_default_fields_layout
crm.patches.v1_0.create_default_fields_layout #13/09/2024
crm.patches.v1_0.create_default_sidebar_fields_layout
crm.patches.v1_0.update_deal_quick_entry_layout
Binary file modified crm/public/manifest/apple-icon-180.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1125-2436.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1136-640.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1170-2532.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1179-2556.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1242-2208.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1242-2688.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1284-2778.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1290-2796.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1334-750.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1488-2266.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1536-2048.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1620-2160.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1640-2360.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1668-2224.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1668-2388.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-1792-828.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2048-1536.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2048-2732.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2160-1620.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2208-1242.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2224-1668.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2266-1488.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2360-1640.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2388-1668.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified crm/public/manifest/apple-splash-2436-1125.jpg
Binary file modified crm/public/manifest/apple-splash-2532-1170.jpg
Binary file modified crm/public/manifest/apple-splash-2556-1179.jpg
Binary file modified crm/public/manifest/apple-splash-2688-1242.jpg
Binary file modified crm/public/manifest/apple-splash-2732-2048.jpg
Binary file modified crm/public/manifest/apple-splash-2778-1284.jpg
Binary file modified crm/public/manifest/apple-splash-2796-1290.jpg
Binary file modified crm/public/manifest/apple-splash-640-1136.jpg
Binary file modified crm/public/manifest/apple-splash-750-1334.jpg
Binary file modified crm/public/manifest/apple-splash-828-1792.jpg
Binary file modified crm/public/manifest/manifest-icon-192.maskable.png
Binary file modified crm/public/manifest/manifest-icon-512.maskable.png
39 changes: 27 additions & 12 deletions frontend/src/components/Fields.vue
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@
<div v-for="field in section.fields" :key="field.name">
<div
v-if="
field.type == 'Check' ||
(field.read_only && data[field.name]) ||
!field.read_only || !field.hidden
(field.type == 'Check' ||
(field.read_only && data[field.name]) ||
!field.read_only ||
!field.hidden) &&
(!field.depends_on || field.display_depends_on)
"
>
<div
Expand Down Expand Up @@ -74,15 +76,27 @@
<span class="text-red-500" v-if="field.mandatory">*</span>
</label>
</div>
<Link
v-else-if="field.type === 'Link'"
class="form-control"
:value="data[field.name]"
:doctype="field.options"
@change="(v) => (data[field.name] = v)"
:placeholder="__(field.placeholder || field.label)"
:onCreate="field.create"
/>
<div class="flex gap-1" v-else-if="field.type === 'Link'">
<Link
class="form-control flex-1"
:value="data[field.name]"
:doctype="field.options"
@change="(v) => (data[field.name] = v)"
:placeholder="__(field.placeholder || field.label)"
:onCreate="field.create"
/>
<Button
v-if="data[field.name] && field.edit"
class="shrink-0"
:label="__('Edit')"
@click="field.edit(data[field.name])"
>
<template #prefix>
<EditIcon class="h-4 w-4" />
</template>
</Button>
</div>

<Link
v-else-if="field.type === 'User'"
class="form-control"
Expand Down Expand Up @@ -196,6 +210,7 @@
</template>

<script setup>
import EditIcon from '@/components/Icons/EditIcon.vue'
import NestedPopover from '@/components/NestedPopover.vue'
import DropdownItem from '@/components/DropdownItem.vue'
import IndicatorIcon from '@/components/Icons/IndicatorIcon.vue'
Expand Down
14 changes: 7 additions & 7 deletions frontend/src/components/Icons/CRMLogo.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<template>
<svg
width="118"
height="118"
viewBox="0 0 118 118"
width="300"
height="300"
viewBox="0 0 300 300"
fill="none"
xmlns="http://www.w3.org/2000/svg"
>
<path
d="M93.7101 0H23.8141C10.7986 0 0.247559 10.5511 0.247559 23.5665V93.4626C0.247559 106.478 10.7986 117.029 23.8141 117.029H93.7101C106.726 117.029 117.277 106.478 117.277 93.4626V23.5665C117.277 10.5511 106.726 0 93.7101 0Z"
fill="#DB4EE0"
d="M214.286 0H85.7143C38.3756 0 0 38.3756 0 85.7143V214.286C0 261.624 38.3756 300 85.7143 300H214.286C261.624 300 300 261.624 300 214.286V85.7143C300 38.3756 261.624 0 214.286 0Z"
fill="#EF0BF5"
/>
<path
d="M21.2487 27.5115V38.0121H85.7749V45.8875L62.5161 68.4638V80.9999H54.9556V68.4638C54.9556 68.4638 41.1474 55.0755 36.3171 50.3503H21.3013L42.6174 71.0889C43.825 72.244 44.5076 73.8716 44.5076 75.5517V87.9424L73.0167 88.0474V75.5517C73.0167 73.8716 73.6992 72.244 74.9068 71.0889L96.2755 50.2978V27.5115H21.2487Z"
fill="#F1FCFF"
d="M64.2858 90.9642V112.393H214.286V140.571L160.179 193.178V208.929L139.714 208.821V193.178L85.7143 140.571H64.2858V149.571L118.286 202.179V230.035L181.607 230.571V202.179L235.714 149.571V90.9642H64.2858Z"
fill="white"
/>
</svg>
</template>
2 changes: 1 addition & 1 deletion frontend/src/components/Kanban/KanbanView.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template>
<div class="flex overflow-x-auto">
<div class="flex overflow-x-auto h-full">
<Draggable
v-if="columns"
:list="columns"
Expand Down
Loading

0 comments on commit 014a550

Please sign in to comment.