fix: corrected the function get_url (#13330)
* Removed /Form from the function get_url As per issue #12820, I think /Form was causing a problem so I removed it. Now the get_url returns URL in the format: "app/doctype/name". * fix: Change to f-strings * Implement slug on get_url * Removed slug for names
This commit is contained in:
parent
8ebc251394
commit
b0f1bbc378
1 changed files with 3 additions and 2 deletions
|
|
@ -17,6 +17,7 @@ from frappe.model.workflow import set_workflow_state_on_action
|
|||
from frappe.utils.global_search import update_global_search
|
||||
from frappe.integrations.doctype.webhook import run_webhooks
|
||||
from frappe.desk.form.document_follow import follow_document
|
||||
from frappe.desk.utils import slug
|
||||
from frappe.core.doctype.server_script.server_script_utils import run_server_script_for_doc_event
|
||||
|
||||
# once_only validation
|
||||
|
|
@ -1202,8 +1203,8 @@ class Document(BaseDocument):
|
|||
doc.set(fieldname, flt(doc.get(fieldname), self.precision(fieldname, doc.parentfield)))
|
||||
|
||||
def get_url(self):
|
||||
"""Returns Desk URL for this document. `/app/Form/{doctype}/{name}`"""
|
||||
return "/app/Form/{doctype}/{name}".format(doctype=self.doctype, name=self.name)
|
||||
"""Returns Desk URL for this document. `/app/{doctype}/{name}`"""
|
||||
return f"/app/{slug(self.doctype)}/{self.name}"
|
||||
|
||||
def add_comment(self, comment_type='Comment', text=None, comment_email=None, link_doctype=None, link_name=None, comment_by=None):
|
||||
"""Add a comment to this document.
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue