Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Raise exception while deleting an item which is a product bundle #5286

Merged

Conversation

shreyashah115
Copy link
Contributor

Exception is not raised while deleting an item which is also a product bundle item as the docname of product bundle is same as the item name. So, also check if the doctype being deleted is not same as the linked doctype.
Issue:
delete-product-bundle-item-fix
Fix:
delete-product-bundle-item-issue

Closes: frappe/erpnext#13027

rmehta
rmehta previously requested changes Apr 6, 2018
@@ -193,7 +193,7 @@ def check_if_doc_is_linked(doc, method="Delete"):
# don't check for communication and todo!
continue

if item and ((item.parent or item.name) != doc.name) \
if item and (link_dt != doc.doctype or ((item.parent or item.name) != doc.name)) \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this condition is too complex! please break it down

@shreyashah115 shreyashah115 force-pushed the raise-exception-for-product-bundle branch from 17e824a to 864b4c9 Compare April 9, 2018 11:02
@shreyashah115 shreyashah115 force-pushed the raise-exception-for-product-bundle branch from 6898c41 to c3a5911 Compare April 11, 2018 11:51
@rmehta rmehta merged commit fc7de01 into frappe:hotfix Apr 16, 2018
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants