@@ -110,7 +110,7 @@ def add_default_communication_statuses():
110
110
doc .insert ()
111
111
112
112
def add_default_fields_layout ():
113
- layouts = {
113
+ quick_entry_layouts = {
114
114
"CRM Lead-Quick Entry" : {
115
115
"doctype" : "CRM Lead" ,
116
116
"layout" : '[{"label":"Person","fields":["salutation","first_name","last_name","email","mobile_no", "gender"],"hideLabel":true},{"label":"Organization","fields":["organization","website","no_of_employees","territory","annual_revenue","industry"],"hideLabel":true,"hideBorder":false},{"label":"Other","columns":2,"fields":["status","lead_owner"],"hideLabel":true,"hideBorder":false}]'
@@ -129,14 +129,35 @@ def add_default_fields_layout():
129
129
},
130
130
}
131
131
132
- for layout in layouts :
132
+ sidebar_fields_layouts = {
133
+ "CRM Lead-Side Panel" : {
134
+ "doctype" : "CRM Lead" ,
135
+ "layout" : '[{"label": "Details", "name": "details", "opened": true, "fields": ["organization", "website", "territory", "industry", "job_title", "source", "lead_owner"]}, {"label": "Person", "name": "person_tab", "opened": true, "fields": ["salutation", "first_name", "last_name", "email", "mobile_no"]}]'
136
+ },
137
+ "CRM Deal-Side Panel" : {
138
+ "doctype" : "CRM Deal" ,
139
+ "layout" : '[{"label":"Contacts","name":"contacts_section","opened":true,"editable":false,"contacts":[]},{"label":"Organization Details","name":"organization_tab","opened":true,"fields":["organization","website","territory","annual_revenue","close_date","probability","next_step","deal_owner"]}]'
140
+ },
141
+ }
142
+
143
+ for layout in quick_entry_layouts :
133
144
if frappe .db .exists ("CRM Fields Layout" , layout ):
134
145
continue
135
146
136
147
doc = frappe .new_doc ("CRM Fields Layout" )
137
148
doc .type = "Quick Entry"
138
- doc .dt = layouts [layout ]["doctype" ]
139
- doc .layout = layouts [layout ]["layout" ]
149
+ doc .dt = quick_entry_layouts [layout ]["doctype" ]
150
+ doc .layout = quick_entry_layouts [layout ]["layout" ]
151
+ doc .insert ()
152
+
153
+ for layout in sidebar_fields_layouts :
154
+ if frappe .db .exists ("CRM Fields Layout" , layout ):
155
+ continue
156
+
157
+ doc = frappe .new_doc ("CRM Fields Layout" )
158
+ doc .type = "Side Panel"
159
+ doc .dt = sidebar_fields_layouts [layout ]["doctype" ]
160
+ doc .layout = sidebar_fields_layouts [layout ]["layout" ]
140
161
doc .insert ()
141
162
142
163
def add_property_setter ():
0 commit comments