Merge pull request #790 from nabinhait/hotfix
dont allow to edit read only fields through report view
This commit is contained in:
commit
f710bb8a08
2 changed files with 6 additions and 2 deletions
|
|
@ -42,7 +42,11 @@ def set_value(doctype, name, fieldname, value):
|
|||
child.set(fieldname, value)
|
||||
else:
|
||||
doc = frappe.get_doc(doctype, name)
|
||||
doc.set(fieldname, value)
|
||||
df = doc.meta.get_field(fieldname)
|
||||
if df.fieldtype == "Read Only" or df.read_only:
|
||||
frappe.throw(_("Can not edit Read Only fields"))
|
||||
else:
|
||||
doc.set(fieldname, value)
|
||||
|
||||
doc.save()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
{% set parents = doc.get_parents() if doc else [] %}
|
||||
{% set parents = doc.get_parents() if (doc and hasattr(doc, "get_parents")) else [] %}
|
||||
<ul class="breadcrumb">
|
||||
{% if parents|length > 0 %}
|
||||
{% for parent in parents %}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue