erpnext icon indicating copy to clipboard operation
erpnext copied to clipboard

feat(delivery): add cutoff item date for so delivery items

Open blaggacao opened this issue 1 year ago • 12 comments

#38053 still addresses a very common use case and a current flaw in the end-2-end buisness workflow.

no-docs

blaggacao avatar Dec 04 '23 12:12 blaggacao

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

stale[bot] avatar Dec 20 '23 01:12 stale[bot]

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

stale[bot] avatar Jan 05 '24 14:01 stale[bot]

This pull request has been automatically marked as inactive because it has not had recent activity. It will be closed within 3 days if no further activity occurs, but it only takes a comment to keep a contribution alive :) Also, even if it is closed, you can always reopen the PR when you're ready. Thank you for contributing.

stale[bot] avatar Jan 21 '24 08:01 stale[bot]

@deepeshgarg007 @ruthra-kumar Could we look together at this use case and get work together towards a merge? This is, as described in the linked item, a pretty critical feature in any scaled dispatch operations of more than a handful deliveries. We're currently managing roughly 200 daily and without this feature, operations would collapse.

blaggacao avatar Jan 21 '24 14:01 blaggacao

Codecov Report

Attention: Patch coverage is 11.76471% with 15 lines in your changes are missing coverage. Please review.

Project coverage is 60.20%. Comparing base (bdca718) to head (9a70516). Report is 296 commits behind head on develop.

:exclamation: Current head 9a70516 differs from pull request most recent head b8dac84. Consider uploading reports for the commit b8dac84 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #38561      +/-   ##
===========================================
- Coverage    60.20%   60.20%   -0.01%     
===========================================
  Files          757      757              
  Lines        70811    70822      +11     
===========================================
+ Hits         42635    42636       +1     
- Misses       28176    28186      +10     
Files Coverage Δ
erpnext/selling/doctype/sales_order/sales_order.py 68.29% <33.33%> (-0.28%) :arrow_down:
erpnext/utilities/bulk_transaction.py 0.00% <0.00%> (ø)

codecov[bot] avatar Jan 23 '24 17:01 codecov[bot]

@ruthra-kumar commit history is now clean. Though, I've not found any existing test infrastructure for bulk transactions, albeit I was full of enthusiasm to write one. :smile: I checked manually though in a testing database and delivery notes are created as expected and only with the items expected.

blaggacao avatar Jan 23 '24 17:01 blaggacao

@Mergify update

blaggacao avatar Jan 30 '24 09:01 blaggacao

update

✅ Branch has been successfully updated

mergify[bot] avatar Jan 30 '24 09:01 mergify[bot]

@blaggacao If there are no items within the cut-off date, then a delivery note with empty items table is created. User can unintentionally create lot of junk delivery notes.

so_to_delivery_note.webm

ruthra-kumar avatar Jan 30 '24 11:01 ruthra-kumar

@ruthra-kumar Thanks a lot for the friendly QA! I worked around this issue in the case of a bulk transaction with the amendment in https://github.com/frappe/erpnext/pull/38561/commits/9a705169fd3916342c14be693ab7a0da2f188fff.

I've tested in on a local database and it appears to behave as intended, now. :handshake:

I thought it might be good for performance on large bulk transactions to not depend on the python GC, hence: del obj (cc @ankush for my education: is manually freeing memory a valid thought, at all?)

blaggacao avatar Jan 30 '24 12:01 blaggacao

@ruthra-kumar I've been busy myself this week, but maybe we shouldn't let this dry out? I think it's ready.

blaggacao avatar Feb 09 '24 14:02 blaggacao

Will take a look at it this week.

ruthra-kumar avatar Feb 12 '24 07:02 ruthra-kumar

@ruthra-kumar maybe we can get this merged this week, still? :pray:

blaggacao avatar Feb 28 '24 14:02 blaggacao

@blaggacao Code looks ok. No junk Delivery notes now.

I think, making this a toggleable feature would be better. Add an option in Selling Settings and give the cut-off date popup only if enabled(?)

ruthra-kumar avatar Feb 29 '24 10:02 ruthra-kumar

@ruthra-kumar added in: b8dac84a9014a66a1acd662d8245c4c2e8bc1823

blaggacao avatar Mar 01 '24 11:03 blaggacao

semgrep failure is unrelated.Ignoring.

ruthra-kumar avatar Mar 02 '24 07:03 ruthra-kumar

When backporting include https://github.com/frappe/erpnext/pull/40509

ruthra-kumar avatar Mar 22 '24 04:03 ruthra-kumar