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 validate FG in repack entry #29271

Merged
merged 3 commits into from
Jan 13, 2022

Conversation

marination
Copy link
Collaborator

@marination marination commented Jan 13, 2022

#28555 missed the case of multiple FGs being possible in repack entries.

  • An item could repacked into 3/4 smaller items
  • In this case 3/4 rows will have is_finished_item auto checked
  • This should be allowed in case of repack

Fix:

  • The only check for repack should be if theres no row with is_finished_item checked, throw an error
  • multiple fg should be allowed

To test:

  • case 1: test repack entry with one item consumed and one item created (one has source wh and second row has target)
  • case 2: test repack entry with one item consumed and 3 other items created (one item of say 90 qty is repacked into 3 items of 30 qty each)
  • Check impact on cost
  • Check if is_finished_item checked is checked on the right rows

@github-actions github-actions bot added the needs-tests This PR needs automated unit-tests. label Jan 13, 2022
@marination marination changed the title fix: Allow multiple FG in repack entry fix: Don't validate FG in repack entry Jan 13, 2022
@marination marination added this to the v13.19 milestone Jan 13, 2022
- Also run fg validation and fg marking after checking purpose, avoid unnecessary calls
@marination marination removed the needs-tests This PR needs automated unit-tests. label Jan 13, 2022
@codecov
Copy link

codecov bot commented Jan 13, 2022

Codecov Report

Merging #29271 (c49dff3) into develop (82b2d22) will decrease coverage by 0.21%.
The diff coverage is 94.44%.

@@             Coverage Diff             @@
##           develop   #29271      +/-   ##
===========================================
- Coverage    57.96%   57.74%   -0.22%     
===========================================
  Files         1110     1110              
  Lines        68005    68005              
===========================================
- Hits         39420    39271     -149     
- Misses       28585    28734     +149     
Impacted Files Coverage Δ
erpnext/stock/doctype/stock_entry/stock_entry.py 80.77% <94.44%> (+0.17%) ⬆️
...unts/report/purchase_register/purchase_register.py 32.19% <0.00%> (-41.10%) ⬇️
...tch_item_expiry_status/batch_item_expiry_status.py 69.23% <0.00%> (-25.00%) ⬇️
...wise_balance_history/batch_wise_balance_history.py 68.96% <0.00%> (-24.14%) ⬇️
...ext/accounts/report/balance_sheet/balance_sheet.py 36.36% <0.00%> (-21.82%) ⬇️
...e_purchase_register/item_wise_purchase_register.py 58.00% <0.00%> (-17.00%) ⬇️
...payroll/doctype/income_tax_slab/income_tax_slab.py 83.33% <0.00%> (-16.67%) ⬇️
...it_and_loss_statement/profit_and_loss_statement.py 71.42% <0.00%> (-3.90%) ⬇️
...eport/item_variant_details/item_variant_details.py 84.33% <0.00%> (-3.62%) ⬇️
erpnext/education/doctype/student/student.py 73.68% <0.00%> (-3.16%) ⬇️
... and 27 more

@marination marination merged commit 343f517 into frappe:develop Jan 13, 2022
@marination
Copy link
Collaborator Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Jan 13, 2022

backport version-13-hotfix

✅ Backports have been created

marination added a commit that referenced this pull request Jan 13, 2022
…-29271

fix: Don't validate FG in repack entry (backport #29271)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant