-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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 #27157
Conversation
if same item_code is added in child items at any level, it shouldn't be allowed.
Why so many tests use same item in raw material for BOM 🤦 |
…27157) * 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/test_bom.py # erpnext/manufacturing/doctype/production_plan/test_production_plan.py # erpnext/manufacturing/doctype/work_order/test_work_order.py
…27157) * 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)
…#27176) * 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) Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
* fix: don't allow BOM's item code at any level of child items (#27157) * 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/test_bom.py # erpnext/manufacturing/doctype/production_plan/test_production_plan.py # erpnext/manufacturing/doctype/work_order/test_work_order.py * fix: resolve conflicts [skip ci] * fix: conflicts [skip ci] * fix: resolve conflicts Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
…27157) * 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
Why this validation ? |
…27157) (frappe#27176) * 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) Co-authored-by: Ankush Menat <ankush@iwebnotes.com>
@guilmori those scenarios were usually solvable by adding an intermediate stage of item. Beer - unprocessed etc. However, since this keeps popping up and increases work for those who don't want traceability at different stages, I've just removed this validation for cases where child items do not have BOM (further explosion) ref: #31175 |
Steps to reproduce:
Observed:
BOM gets saved.
Expected:
validation error.
Solution:
Never allow BOM's item at any level of exploded child items.
closes #26747