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

fix: don't allow BOM's item code at any level of child items (backport #27157) #44020

Closed

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Nov 8, 2024

Steps to reproduce:

  1. Create BOM for Item A.
  2. In child item, again add Item A.
  3. Save.

Observed:
BOM gets saved.

Expected:
validation error.

Solution:
Never allow BOM's item at any level of exploded child items.

closes #26747


This is an automatic backport of pull request #27157 done by Mergify.

* refactor: bom recursion checking

* fix: dont allow bom recursion

if same item_code is added in child items at any level, it shouldn't be allowed.

* test: add test for bom recursion

* test: fix broken prodplan test using recursive bom

* test: fix recursive bom in tests

(cherry picked from commit c07dce9)

# Conflicts:
#	erpnext/manufacturing/doctype/bom/bom.py
#	erpnext/manufacturing/doctype/production_plan/test_production_plan.py
#	erpnext/manufacturing/doctype/work_order/test_work_order.py
@mergify mergify bot requested a review from rohitwaghchaure as a code owner November 8, 2024 00:13
@mergify mergify bot added the conflicts label Nov 8, 2024
@mergify mergify bot requested a review from s-aga-r as a code owner November 8, 2024 00:13
@mergify mergify bot assigned ankush Nov 8, 2024
Copy link
Contributor Author

mergify bot commented Nov 8, 2024

Cherry-pick of c07dce9 has failed:

On branch mergify/bp/version-13-hotfix/pr-27157
Your branch is up to date with 'origin/version-13-hotfix'.

You are currently cherry-picking commit c07dce940e.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   erpnext/manufacturing/doctype/bom/test_bom.py

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   erpnext/manufacturing/doctype/bom/bom.py
	both modified:   erpnext/manufacturing/doctype/production_plan/test_production_plan.py
	both modified:   erpnext/manufacturing/doctype/work_order/test_work_order.py

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants