Merge pull request #23457 from marination/update-items-perm

fix: Check only Read and Write Permission in Update Items
This commit is contained in:
Marica 2020-09-30 12:55:06 +05:30 committed by GitHub
commit 6dc940fdb8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1242,7 +1242,7 @@ def update_child_qty_rate(parent_doctype, trans_items, parent_doctype_name, chil
try:
doc.check_permission(perm_type)
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 {}.")
.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']
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)
for d in data: