Merge pull request #313 from shariquerik/pinned-public-view

fix: pinned view should become unpinned when made public
This commit is contained in:
Shariq Ansari 2024-08-16 12:31:35 +05:30 committed by GitHub
commit abf3ea729b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -92,6 +92,8 @@ def public(name, value):
frappe.throw("Not permitted", frappe.PermissionError)
doc = frappe.get_doc("CRM View Settings", name)
if doc.pinned:
doc.pinned = False
doc.public = value
doc.user = "" if value else frappe.session.user
doc.save()