mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 08:24:47 +00:00
validate permissions before delete
This commit is contained in:
@@ -24,8 +24,6 @@ from webnotes import msgprint
|
|||||||
|
|
||||||
sql = webnotes.conn.sql
|
sql = webnotes.conn.sql
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DocType:
|
class DocType:
|
||||||
def __init__(self,doc,doclist=[]):
|
def __init__(self,doc,doclist=[]):
|
||||||
self.doc = doc
|
self.doc = doc
|
||||||
@@ -37,7 +35,6 @@ class DocType:
|
|||||||
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
ret = {'customer': cust and cust[0][0] or '', 'customer_name': cust and cust[0][1] or ''}
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
# TODO: Remove these? as the field customer doesn't exists
|
|
||||||
def get_customer_details(self):
|
def get_customer_details(self):
|
||||||
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
cust = sql("select customer_name from `tabCustomer` where name=%s", self.doc.customer)
|
||||||
if cust:
|
if cust:
|
||||||
|
|||||||
@@ -2,27 +2,18 @@
|
|||||||
{
|
{
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"docstatus": 0,
|
"docstatus": 0,
|
||||||
"creation": "2012-09-18 11:05:48",
|
"creation": "2012-10-29 14:30:00",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"modified": "2012-10-29 14:24:55"
|
"modified": "2012-12-24 10:46:06"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"section_style": "Tray",
|
|
||||||
"allow_attach": 1,
|
|
||||||
"tag_fields": "status",
|
|
||||||
"module": "Projects",
|
|
||||||
"server_code_error": " ",
|
|
||||||
"allow_trash": 1,
|
|
||||||
"doctype": "DocType",
|
|
||||||
"document_type": "Master",
|
|
||||||
"subject": "%(subject)s",
|
|
||||||
"autoname": "TASK.#####",
|
"autoname": "TASK.#####",
|
||||||
"name": "__common__",
|
"allow_attach": 1,
|
||||||
"colour": "White:FFF",
|
"doctype": "DocType",
|
||||||
"_last_update": "1324880734",
|
"module": "Projects",
|
||||||
"show_in_menu": 0,
|
|
||||||
"max_attachments": 5,
|
"max_attachments": 5,
|
||||||
"version": 1
|
"document_type": "Master",
|
||||||
|
"name": "__common__"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "__common__",
|
"name": "__common__",
|
||||||
@@ -74,13 +65,13 @@
|
|||||||
"reqd": 0
|
"reqd": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"search_index": 1,
|
"oldfieldtype": "Date",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Expected End Date",
|
"label": "Expected End Date",
|
||||||
"oldfieldname": "exp_end_date",
|
"oldfieldname": "exp_end_date",
|
||||||
"fieldname": "exp_end_date",
|
"fieldname": "exp_end_date",
|
||||||
"fieldtype": "Date",
|
"fieldtype": "Date",
|
||||||
"oldfieldtype": "Date",
|
"search_index": 1,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"in_filter": 1
|
"in_filter": 1
|
||||||
},
|
},
|
||||||
@@ -93,11 +84,9 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"oldfieldtype": "Link",
|
"oldfieldtype": "Link",
|
||||||
"colour": "White:FFF",
|
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Project",
|
"label": "Project",
|
||||||
"oldfieldname": "project",
|
"oldfieldname": "project",
|
||||||
"trigger": "Client",
|
|
||||||
"fieldname": "project",
|
"fieldname": "project",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"options": "Project"
|
"options": "Project"
|
||||||
@@ -105,23 +94,21 @@
|
|||||||
{
|
{
|
||||||
"no_copy": 1,
|
"no_copy": 1,
|
||||||
"oldfieldtype": "Select",
|
"oldfieldtype": "Select",
|
||||||
"colour": "White:FFF",
|
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Status",
|
"label": "Status",
|
||||||
"oldfieldname": "status",
|
"oldfieldname": "status",
|
||||||
"trigger": "Client",
|
|
||||||
"fieldname": "status",
|
"fieldname": "status",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"options": "Open\nWorking\nPending Review\nClosed\nCancelled"
|
"options": "Open\nWorking\nPending Review\nClosed\nCancelled"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"search_index": 1,
|
"oldfieldtype": "Select",
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Priority",
|
"label": "Priority",
|
||||||
"oldfieldname": "priority",
|
"oldfieldname": "priority",
|
||||||
"fieldname": "priority",
|
"fieldname": "priority",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"oldfieldtype": "Select",
|
"search_index": 1,
|
||||||
"reqd": 0,
|
"reqd": 0,
|
||||||
"options": "Low\nMedium\nHigh\nUrgent",
|
"options": "Low\nMedium\nHigh\nUrgent",
|
||||||
"in_filter": 1
|
"in_filter": 1
|
||||||
@@ -217,13 +204,12 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
|
"label": "More Details",
|
||||||
"fieldname": "more_details",
|
"fieldname": "more_details",
|
||||||
"fieldtype": "Section Break",
|
"fieldtype": "Section Break"
|
||||||
"label": "More Details"
|
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"oldfieldtype": "Date",
|
"oldfieldtype": "Date",
|
||||||
"colour": "White:FFF",
|
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Review Date",
|
"label": "Review Date",
|
||||||
"oldfieldname": "review_date",
|
"oldfieldname": "review_date",
|
||||||
@@ -234,7 +220,6 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"oldfieldtype": "Date",
|
"oldfieldtype": "Date",
|
||||||
"colour": "White:FFF",
|
|
||||||
"doctype": "DocField",
|
"doctype": "DocField",
|
||||||
"label": "Closing Date",
|
"label": "Closing Date",
|
||||||
"oldfieldname": "closing_date",
|
"oldfieldname": "closing_date",
|
||||||
@@ -260,7 +245,7 @@
|
|||||||
"permlevel": 0
|
"permlevel": 0
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"permlevel": 1,
|
"doctype": "DocPerm",
|
||||||
"doctype": "DocPerm"
|
"permlevel": 1
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
Reference in New Issue
Block a user