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: Pull only Items that are in Job Card in a Stock Entry against Job Card #28228

Merged
merged 10 commits into from
Nov 16, 2021

Conversation

marination
Copy link
Collaborator

@marination marination commented Nov 3, 2021

Issue:

  • While creating Stock Entry for Material Transfer from Job Card, it is possible that user wants to transfer for half the qty of finished Goods
  • While changing the For Quantity, all the required items are fetched from the Work Order
  • The items in the Job card are not considered as this Stock Entry is against the Job Card

Fix:

To Test:

  • Create BOM with Items A, B and C. And also with operations C and D

  • Add Operation C against Items A and B, and Operation D against item C

  • Create a Work Order (for 2 qty) against this BOM > Set Material Transfer against as Job Card

  • Submit Work Order. Go to Job Card of operation C.

  • Click on Material Transfer. Stock Entry is created for 2 FG qty. Items table has items A and B

  • Edit the For Quantity field to 1 (partial transfer), the Items table has items A, B and C

  • Expected: Edit the For Quantity field to 1 (partial transfer), the Items table has items A and B

  • Test BUG - Job Card Item Transferred Qty is not assigned #27887 as well

- Check if items pulled in stock entry are present in Job Card
- Code cleanup and removed redundant checks

Co-authored-by: Gavin D'souza <gavin18d@gmail.com>
@marination marination added the needs-tests This PR needs automated unit-tests. label Nov 3, 2021
@ankush
Copy link
Member

ankush commented Nov 3, 2021

This simplifies solution for #27887 😄 Just need to fetch name and map it to job_card_item.

@codecov
Copy link

codecov bot commented Nov 3, 2021

Codecov Report

Merging #28228 (612bb5c) into develop (6bd0c1d) will increase coverage by 0.11%.
The diff coverage is 90.38%.

@@             Coverage Diff             @@
##           develop   #28228      +/-   ##
===========================================
+ Coverage    55.14%   55.25%   +0.11%     
===========================================
  Files         1119     1119              
  Lines        66571    66594      +23     
===========================================
+ Hits         36709    36796      +87     
+ Misses       29862    29798      -64     
Impacted Files Coverage Δ
...production_plan_summary/production_plan_summary.py 0.00% <0.00%> (ø)
erpnext/stock/doctype/stock_entry/stock_entry.py 79.94% <95.45%> (+0.18%) ⬆️
erpnext/manufacturing/doctype/job_card/job_card.py 64.93% <100.00%> (+0.26%) ⬆️
.../hr/doctype/upload_attendance/upload_attendance.py 44.69% <0.00%> (-1.52%) ⬇️
erpnext/controllers/stock_controller.py 89.70% <0.00%> (-1.06%) ⬇️
erpnext/support/doctype/issue/issue.py 63.41% <0.00%> (-0.98%) ⬇️
erpnext/stock/stock_ledger.py 85.45% <0.00%> (-0.91%) ⬇️
erpnext/accounts/deferred_revenue.py 75.11% <0.00%> (-0.89%) ⬇️
...ice_creation_tool/opening_invoice_creation_tool.py 60.13% <0.00%> (-0.70%) ⬇️
.../report/accounts_receivable/accounts_receivable.py 67.83% <0.00%> (-0.44%) ⬇️
... and 12 more

@marination marination removed the needs-tests This PR needs automated unit-tests. label Nov 9, 2021
- Fixed transferred qty not back updating on JC if partial transfer
- Partial transfer not mapping pending qty from JC correctly in SE
- tests for above cases
- minor code cleanup
- `get_cached_value` throws a DoesNotExistError if non-existent value, used `get_value` instead
- accomodate production plan items that dont have WO/PO against them as well (blank values)
- added some None value handling to avoid AttributeError
- make `tests_that_skip_setup` a tuple (added comma)
- remove manual teardown in `test_job_card_material_transfer_correctness` to avoid premature committing
- transfer_material_against = "Job Card" while making BOM with mulitple operations
- Use a specific BOM for JC tests
- Utility to create said BOM
- Sider: unused variable
@marination marination merged commit 0c9acc7 into frappe:develop Nov 16, 2021
@marination
Copy link
Collaborator Author

@Mergifyio backport version-13-hotfix

@mergify
Copy link
Contributor

mergify bot commented Nov 16, 2021

backport version-13-hotfix

✅ Backports have been created

marination added a commit that referenced this pull request Nov 16, 2021
…-28228

fix: Pull only Items that are in Job Card in a Stock Entry against Job Card (backport #28228)
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.

BUG - Job Card Item Transferred Qty is not assigned
2 participants