Skip to content

Commit 7419634

Browse files
authored
Merge pull request #1828 from frappe/main-hotfix
2 parents c080f32 + 24c2023 commit 7419634

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+339
-121
lines changed

crm/api/activities.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from frappe import _
66
from frappe.desk.form.load import get_docinfo
77
from frappe.query_builder import JoinType
8+
from frappe.translate import get_translated_doctypes
89

910
from crm.fcrm.doctype.crm_call_log.crm_call_log import parse_call_log
1011

@@ -20,6 +21,9 @@ def get_activities(name: str):
2021

2122

2223
def get_deal_activities(name: str):
24+
if not frappe.has_permission("CRM Deal", "read", name):
25+
frappe.throw(_("Not permitted"), frappe.PermissionError)
26+
2327
get_docinfo("", "CRM Deal", name)
2428
docinfo = frappe.response["docinfo"]
2529
deal_meta = frappe.get_meta("CRM Deal")
@@ -98,6 +102,12 @@ def get_deal_activities(name: str):
98102
"value": change[1],
99103
}
100104

105+
if data.get("value") and field_option and is_translatable(field_option):
106+
data["value"] = _(data["value"])
107+
108+
if data.get("old_value"):
109+
data["old_value"] = _(data["old_value"])
110+
101111
activity = {
102112
"activity_type": activity_type,
103113
"creation": version.creation,
@@ -165,6 +175,9 @@ def get_deal_activities(name: str):
165175

166176

167177
def get_lead_activities(name: str):
178+
if not frappe.has_permission("CRM Lead", "read", name):
179+
frappe.throw(_("Not permitted"), frappe.PermissionError)
180+
168181
get_docinfo("", "CRM Lead", name)
169182
docinfo = frappe.response["docinfo"]
170183
lead_meta = frappe.get_meta("CRM Lead")
@@ -230,6 +243,12 @@ def get_lead_activities(name: str):
230243
"value": change[1],
231244
}
232245

246+
if data.get("value") and field_option and is_translatable(field_option):
247+
data["value"] = _(data["value"])
248+
249+
if data.get("old_value"):
250+
data["old_value"] = _(data["old_value"])
251+
233252
activity = {
234253
"activity_type": activity_type,
235254
"creation": version.creation,
@@ -498,3 +517,7 @@ def parse_attachment_log(html: str, type: str):
498517
"file_url": a_tag["href"],
499518
"is_private": is_private,
500519
}
520+
521+
522+
def is_translatable(doctype: str) -> bool:
523+
return doctype in get_translated_doctypes()

crm/api/doc.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -858,6 +858,9 @@ def remove_linked_doc_reference(items: str | list, remove_contact: bool = False,
858858
if not item.get("doctype") or not item.get("docname"):
859859
continue
860860

861+
if not frappe.has_permission(item["doctype"], "write", item["docname"]):
862+
continue
863+
861864
try:
862865
if remove_contact:
863866
remove_contact_link(item["doctype"], item["docname"])

crm/fcrm/doctype/crm_deal/crm_deal.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -274,7 +274,8 @@ def default_list_data():
274274
},
275275
{
276276
"label": "Status",
277-
"type": "Select",
277+
"type": "Link",
278+
"options": "CRM Deal Status",
278279
"key": "status",
279280
"width": "10rem",
280281
},

crm/fcrm/doctype/crm_deal_status/crm_deal_status.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,8 @@
5858
"grid_page_length": 50,
5959
"index_web_pages_for_search": 1,
6060
"links": [],
61-
"modified": "2026-01-28 17:06:07.371048",
62-
"modified_by": "shariq@frappe.io",
61+
"modified": "2026-03-05 12:42:47.973700",
62+
"modified_by": "Administrator",
6363
"module": "FCRM",
6464
"name": "CRM Deal Status",
6565
"naming_rule": "By fieldname",
@@ -105,5 +105,6 @@
105105
"row_format": "Dynamic",
106106
"sort_field": "modified",
107107
"sort_order": "DESC",
108-
"states": []
108+
"states": [],
109+
"translated_doctype": 1
109110
}

crm/fcrm/doctype/crm_industry/crm_industry.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
],
2222
"index_web_pages_for_search": 1,
2323
"links": [],
24-
"modified": "2026-01-28 17:08:15.456168",
25-
"modified_by": "shariq@frappe.io",
24+
"modified": "2026-03-05 12:44:24.510102",
25+
"modified_by": "Administrator",
2626
"module": "FCRM",
2727
"name": "CRM Industry",
2828
"naming_rule": "By fieldname",
@@ -69,5 +69,6 @@
6969
"row_format": "Dynamic",
7070
"sort_field": "modified",
7171
"sort_order": "DESC",
72-
"states": []
72+
"states": [],
73+
"translated_doctype": 1
7374
}

crm/fcrm/doctype/crm_lead/crm_lead.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,8 @@ def default_list_data():
398398
},
399399
{
400400
"label": "Status",
401-
"type": "Select",
401+
"type": "Link",
402+
"options": "CRM Lead Status",
402403
"key": "status",
403404
"width": "8rem",
404405
},

crm/fcrm/doctype/crm_lead_source/crm_lead_source.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
"grid_page_length": 50,
3131
"index_web_pages_for_search": 1,
3232
"links": [],
33-
"modified": "2026-02-23 12:31:29.037317",
33+
"modified": "2026-03-05 13:05:26.007219",
3434
"modified_by": "Administrator",
3535
"module": "FCRM",
3636
"name": "CRM Lead Source",
@@ -75,5 +75,6 @@
7575
"row_format": "Dynamic",
7676
"sort_field": "modified",
7777
"sort_order": "DESC",
78-
"states": []
78+
"states": [],
79+
"translated_doctype": 1
7980
}

crm/fcrm/doctype/crm_lead_status/crm_lead_status.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
],
5252
"index_web_pages_for_search": 1,
5353
"links": [],
54-
"modified": "2026-02-05 17:16:11.897087",
55-
"modified_by": "shariq@frappe.io",
54+
"modified": "2026-03-05 12:42:24.932212",
55+
"modified_by": "Administrator",
5656
"module": "FCRM",
5757
"name": "CRM Lead Status",
5858
"naming_rule": "By fieldname",
@@ -98,5 +98,6 @@
9898
"row_format": "Dynamic",
9999
"sort_field": "modified",
100100
"sort_order": "DESC",
101-
"states": []
101+
"states": [],
102+
"translated_doctype": 1
102103
}

crm/fcrm/doctype/crm_lost_reason/crm_lost_reason.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"grid_page_length": 50,
2828
"index_web_pages_for_search": 1,
2929
"links": [],
30-
"modified": "2026-02-23 12:22:29.080355",
30+
"modified": "2026-03-05 13:04:31.907824",
3131
"modified_by": "Administrator",
3232
"module": "FCRM",
3333
"name": "CRM Lost Reason",
@@ -75,5 +75,6 @@
7575
"row_format": "Dynamic",
7676
"sort_field": "creation",
7777
"sort_order": "DESC",
78-
"states": []
78+
"states": [],
79+
"translated_doctype": 1
7980
}

crm/fcrm/doctype/crm_product/crm_product.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
"index_web_pages_for_search": 1,
7373
"links": [],
7474
"make_attachments_public": 1,
75-
"modified": "2026-02-23 12:25:52.420632",
75+
"modified": "2026-03-05 13:04:42.045313",
7676
"modified_by": "Administrator",
7777
"module": "FCRM",
7878
"name": "CRM Product",
@@ -125,5 +125,6 @@
125125
"sort_order": "DESC",
126126
"states": [],
127127
"title_field": "product_name",
128-
"track_changes": 1
128+
"track_changes": 1,
129+
"translated_doctype": 1
129130
}

0 commit comments

Comments
 (0)