Skip to content

Commit bd32354

Browse files
authored
Merge pull request #1734 from frappe/main-hotfix
chore: Minor Release v1.59.0
2 parents f913e5b + f472912 commit bd32354

File tree

104 files changed

+7517
-2719
lines changed

Some content is hidden

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

104 files changed

+7517
-2719
lines changed

crm/api/assignment_rule.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ def get_assignment_rules_list():
2424

2525

2626
@frappe.whitelist()
27-
def duplicate_assignment_rule(docname, new_name):
27+
def duplicate_assignment_rule(docname: str, new_name: str):
2828
doc = frappe.get_doc("Assignment Rule", docname)
2929
doc.name = new_name
3030
doc.assignment_rule_name = new_name

crm/api/comment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ def extract_mentions(html):
6666

6767

6868
@frappe.whitelist()
69-
def add_comment(reference_doctype, reference_name, content, attachments=None):
69+
def add_comment(reference_doctype: str, reference_name: str, content: str, attachments: list | None = None):
7070
"""Add a comment to the given document
7171
7272
:param reference_doctype: Reference Doctype

crm/api/contact.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ def update_deals_email_mobile_no(doc):
2727

2828

2929
@frappe.whitelist()
30-
def get_linked_deals(contact):
30+
def get_linked_deals(contact: str):
3131
"""Get linked deals for a contact"""
3232

3333
if not frappe.has_permission("Contact", "read", contact):
34-
frappe.throw("Not permitted", frappe.PermissionError)
34+
frappe.throw(_("Not permitted"), frappe.PermissionError)
3535

3636
deal_names = frappe.get_all(
3737
"CRM Contacts",
@@ -64,10 +64,10 @@ def get_linked_deals(contact):
6464

6565

6666
@frappe.whitelist()
67-
def create_new(contact, field, value):
67+
def create_new(contact: str, field: str, value: str):
6868
"""Create new email or phone for a contact"""
6969
if not frappe.has_permission("Contact", "write", contact):
70-
frappe.throw("Not permitted", frappe.PermissionError)
70+
frappe.throw(_("Not permitted"), frappe.PermissionError)
7171

7272
contact = frappe.get_cached_doc("Contact", contact)
7373

@@ -78,17 +78,17 @@ def create_new(contact, field, value):
7878
mobile_no = {"phone": value, "is_primary_mobile_no": 1 if len(contact.phone_nos) == 0 else 0}
7979
contact.append("phone_nos", mobile_no)
8080
else:
81-
frappe.throw("Invalid field")
81+
frappe.throw(_("Invalid field"))
8282

8383
contact.save()
8484
return True
8585

8686

8787
@frappe.whitelist()
88-
def set_as_primary(contact, field, value):
88+
def set_as_primary(contact: str, field: str, value: str):
8989
"""Set email or phone as primary for a contact"""
9090
if not frappe.has_permission("Contact", "write", contact):
91-
frappe.throw("Not permitted", frappe.PermissionError)
91+
frappe.throw(_("Not permitted"), frappe.PermissionError)
9292

9393
contact = frappe.get_doc("Contact", contact)
9494

@@ -106,7 +106,7 @@ def set_as_primary(contact, field, value):
106106
else:
107107
phone.set(name, 0)
108108
else:
109-
frappe.throw("Invalid field")
109+
frappe.throw(_("Invalid field"))
110110

111111
contact.save()
112112
return True

0 commit comments

Comments
 (0)