Merge pull request #790 from nabinhait/hotfix

dont allow to edit read only fields through report view
This commit is contained in:
Pratik Vyas 2014-08-22 14:59:45 +05:30
commit f710bb8a08
2 changed files with 6 additions and 2 deletions

View file

@ -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()

View file

@ -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 %}