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: use old serial / batch fields to make serial batch bundle #39718

Merged

Conversation

rohitwaghchaure
Copy link
Collaborator

@rohitwaghchaure rohitwaghchaure commented Feb 4, 2024

Stock Settings

Added "Use Serial / Batch Fields" checkbox in the Stock Settings

image

Added "Use Serial / Batch Fields" checkbox in the Delivery Note Item, Purchase Receipt Item, Stock Entry Detail etc.

If the user has enabled the "Use Serial / Batch Fields" checkbox in the stock settings then system keep default "Use Serial / Batch Fields" checkbox enabled in the stock transactions.

Stock Transaction (Delivery Note)

If the "Use Serial / Batch Fields" has enabled then user can use the Serial and Batch fields to make stock transactions against the Serial / Batches. On submission of the stock transaction system will auto create the Serial and Batch bundle

use_old_serial_batch_fields

Disable 'Use Serial / Batch Fields'

If user wants to use the serial and batch bundle then they have to disable the checkbox "Use Serial / Batch Fields" in the line item
use_old_serial_batch_fields_inward

@github-actions github-actions bot added needs-tests This PR needs automated unit-tests. stock labels Feb 4, 2024
@rohitwaghchaure rohitwaghchaure force-pushed the create-bundle-using-old-fields branch 4 times, most recently from ae5b432 to 381a2bc Compare February 5, 2024 09:46
@TurkerTunali
Copy link
Contributor

Does it completely ignore SBB or creates SBB on the fly?

@rohitwaghchaure
Copy link
Collaborator Author

Does it completely ignore SBB or creates SBB on the fly?

It won't ignore SBB, if the user has used old fields to enter serial / batches then system will create the SBB in the backend on the submission of the respective stock transaction.

Valuation and quantity calculation will be based on the SBB, while the old serial/batch fields are retained to solve UX issues .

Copy link

codecov bot commented Feb 6, 2024

Codecov Report

Attention: 23 lines in your changes are missing coverage. Please review.

Comparison is base (d9a72c1) 60.12% compared to head (0165012) 60.21%.
Report is 42 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #39718      +/-   ##
===========================================
+ Coverage    60.12%   60.21%   +0.08%     
===========================================
  Files          758      758              
  Lines        70971    71141     +170     
===========================================
+ Hits         42674    42834     +160     
- Misses       28297    28307      +10     
Files Coverage Δ
...ounts/doctype/purchase_invoice/purchase_invoice.py 70.04% <100.00%> (+0.03%) ⬆️
...xt/accounts/doctype/sales_invoice/sales_invoice.py 74.39% <100.00%> (+0.01%) ⬆️
...ctype/asset_capitalization/asset_capitalization.py 83.52% <100.00%> (+0.03%) ⬆️
erpnext/selling/doctype/sales_order/sales_order.py 68.64% <100.00%> (+0.08%) ⬆️
...pnext/stock/doctype/delivery_note/delivery_note.py 66.44% <100.00%> (+0.05%) ⬆️
...stock/doctype/purchase_receipt/purchase_receipt.py 73.07% <100.00%> (+0.25%) ⬆️
erpnext/stock/doctype/serial_no/serial_no.py 39.15% <100.00%> (ø)
erpnext/stock/doctype/stock_entry/stock_entry.py 79.35% <100.00%> (+0.01%) ⬆️
...ext/stock/doctype/stock_entry/stock_entry_utils.py 90.58% <100.00%> (+0.22%) ⬆️
erpnext/stock/utils.py 71.62% <100.00%> (+0.66%) ⬆️
... and 19 more

... and 16 files with indirect coverage changes

@rohitwaghchaure rohitwaghchaure merged commit 4671f65 into frappe:develop Feb 6, 2024
19 checks passed
rohitwaghchaure added a commit that referenced this pull request Feb 6, 2024
…-39718

fix: use old serial / batch fields to make serial batch bundle (backport #39718)
@barredterra
Copy link
Collaborator

@rohitwaghchaure It would be useful to have a patch which enables this option for all existing records that are using the serial_no/batch_no fields. Otherwise, the existing information will become invisible.

@@ -105,6 +106,7 @@ erpnext.TransactionController = class TransactionController extends erpnext.taxe

frappe.ui.form.on(this.frm.doctype + " Item", {
items_add: function(frm, cdt, cdn) {
debugger
Copy link
Collaborator

Choose a reason for hiding this comment

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

@rohitwaghchaure you missed removing a debugger here ;)

Copy link
Contributor

Choose a reason for hiding this comment

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

The doctor left a knife in the patient's heart :)

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-15-hotfix needs-tests This PR needs automated unit-tests. stock
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants