fix: Check only Read and Write Permission in Update Items

This commit is contained in:
marination 2020-09-29 18:16:45 +05:30
parent c33fbd7e52
commit 661bf64bba

View File

@ -1242,7 +1242,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
try: try:
doc.check_permission(perm_type) doc.check_permission(perm_type)
except frappe.PermissionError: except frappe.PermissionError:
actions = { 'create': 'add', 'write': 'update', 'cancel': 'remove' } actions = { 'create': 'add', 'write': 'update'}
frappe.throw(_("You do not have permissions to {} items in a {}.") frappe.throw(_("You do not have permissions to {} items in a {}.")
.format(actions[perm_type], parent_doctype), title=_("Insufficient Permissions")) .format(actions[perm_type], parent_doctype), title=_("Insufficient Permissions"))
@ -1285,7 +1285,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
sales_doctypes = ['Sales Order', 'Sales Invoice', 'Delivery Note', 'Quotation'] sales_doctypes = ['Sales Order', 'Sales Invoice', 'Delivery Note', 'Quotation']
parent = frappe.get_doc(parent_doctype, parent_doctype_name) parent = frappe.get_doc(parent_doctype, parent_doctype_name)
check_doc_permissions(parent, 'cancel') check_doc_permissions(parent, 'write')
validate_and_delete_children(parent, data) validate_and_delete_children(parent, data)
for d in data: for d in data: