Skip to content

Commit fb5e866

Browse files
fix: PostgreSQL — demo data case sensitivity + add Lost Reason fixtures
Two fixes for v17/develop with PostgreSQL backend: 1. Demo data used 'Budget constraints' but the actual Lost Reason record is named 'Budget Constraints' (uppercase C). PostgreSQL string comparison is case-sensitive by default, while MariaDB uses case-insensitive collation. Fixed to match exact record name. 2. CRM Lost Reasons are required by demo data but were only defined in test_records.json (loaded during tests). Added them as app fixtures so they are created during bench install-app crm, ensuring demo data works on fresh installations. Both fixes are backwards-compatible with MariaDB.
1 parent 255d6e4 commit fb5e866

3 files changed

Lines changed: 30 additions & 1 deletion

File tree

crm/demo/deals.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def create_demo_deals(lead_names, demo_users):
6161
"deal_value": 55000,
6262
"probability": 0,
6363
"deal_owner": session_user,
64-
"lost_reason": "Budget constraints",
64+
"lost_reason": "Budget Constraints",
6565
"lost_notes": "Q2 budget was cut. Leo said they would revisit in Q4 once headcount hiring is complete. Added to nurture sequence.",
6666
},
6767
)

crm/fixtures/crm_lost_reason.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[
2+
{
3+
"doctype": "CRM Lost Reason",
4+
"name": "Price too high",
5+
"lost_reason": "Price too high"
6+
},
7+
{
8+
"doctype": "CRM Lost Reason",
9+
"name": "Competition",
10+
"lost_reason": "Competition"
11+
},
12+
{
13+
"doctype": "CRM Lost Reason",
14+
"name": "Budget Constraints",
15+
"lost_reason": "Budget Constraints"
16+
},
17+
{
18+
"doctype": "CRM Lost Reason",
19+
"name": "No response",
20+
"lost_reason": "No response"
21+
},
22+
{
23+
"doctype": "CRM Lost Reason",
24+
"name": "Not interested",
25+
"lost_reason": "Not interested"
26+
}
27+
]

crm/hooks.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
app_name = "crm"
22
app_title = "Frappe CRM"
33
app_publisher = "Frappe Technologies Pvt. Ltd."
4+
fixtures = ["CRM Lost Reason"]
5+
46
app_description = "Kick-ass Open Source CRM"
57
app_email = "shariq@frappe.io"
68
app_license = "AGPLv3"

0 commit comments

Comments
 (0)