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

feat: support product bundles in picklist #30762

Merged
merged 19 commits into from
Apr 27, 2022
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Apr 20, 2022

Currently if you import sales order which has product bundle it does nothing and gives rather useless message "bundle item not in stock". This is because product bundles aren't supported by picklist.

  • Add check to avoid importing product bundle items in picklist.
  • Import packed item list for the bundle in picklist instead.
  • On submit/cancel update picking status back to the original bundle (based on max possible bundle qty)
  • While creating DN add the original bundle item back in DN items.
  • Update stock info (like warehouse) on DN packed items.
  • Tests

Unrelated changes:

  • Faster picked qty updates
  • Fix pick list and SO form fields for tracking qty
  • hide picklist button when it's not possible.
  • Fix pick list validation (against stock qty instead of SO qty)
  • Consider already picked qty while preparing new picklist.

no-docs

note to reviewers: commits are mostly atomic, so easier to read the diff commit-by-commit.

@ankush ankush force-pushed the bunle_pickng branch 3 times, most recently from b36ae4a to 764ff18 Compare April 25, 2022 08:17
@marination marination self-assigned this Apr 25, 2022
@ankush ankush requested a review from marination April 25, 2022 12:06
@codecov
Copy link

codecov bot commented Apr 25, 2022

Codecov Report

Merging #30762 (ebd5f0b) into develop (dcc2243) will increase coverage by 0.10%.
The diff coverage is 96.18%.

@@             Coverage Diff             @@
##           develop   #30762      +/-   ##
===========================================
+ Coverage    61.44%   61.55%   +0.10%     
===========================================
  Files         1079     1079              
  Lines        69613    69700      +87     
===========================================
+ Hits         42776    42906     +130     
+ Misses       26837    26794      -43     
Impacted Files Coverage Δ
erpnext/stock/doctype/pick_list/pick_list.py 76.76% <95.19%> (+4.66%) ⬆️
erpnext/selling/doctype/sales_order/sales_order.py 80.46% <100.00%> (+2.06%) ⬆️
erpnext/stock/doctype/packed_item/packed_item.py 87.21% <100.00%> (+0.19%) ⬆️
...t/product_bundle_balance/product_bundle_balance.py 79.54% <0.00%> (-15.91%) ⬇️
...rpnext/accounts/doctype/shareholder/shareholder.py 80.00% <0.00%> (-10.00%) ⬇️
...saction/incorrect_balance_qty_after_transaction.py 88.37% <0.00%> (-9.31%) ⬇️
...value/warehouse_wise_item_balance_age_and_value.py 89.02% <0.00%> (-2.44%) ⬇️
erpnext/stock/reorder_item.py 75.21% <0.00%> (-0.86%) ⬇️
...ype/account/chart_of_accounts/chart_of_accounts.py 76.87% <0.00%> (-0.69%) ⬇️
erpnext/accounts/doctype/pricing_rule/utils.py 69.84% <0.00%> (-0.52%) ⬇️
... and 28 more

@ankush
Copy link
Member Author

ankush commented Apr 25, 2022

Future scope of improvement while picking: instead of mapping fully qty open a multi-select dialog box with a field to specify how much qty to pick.

ankush added 13 commits April 27, 2022 12:05
- make tracking fields read only and no-copy 🤦
- collapse print settings section, most users configure it once and
  forget about it, not need to show this.
- call pick list grouping function directly
- use get_descendants_of instead of obscure db function
- rename badly named variables
- support updated packed items
For each SO item the sales order picking status was being updated, this
isn't required and wasteful.
also remove misleading docstring
This is to accomodate bundles that might allow floating point qty.
Other changes:

- only allow whole number of bundles to get picked
@ankush
Copy link
Member Author

ankush commented Apr 27, 2022

TODO:

  • consider pending qty = qty - max(delivered, picked)
  • dont map picked qty from packing list to PL

Co-Authored-By: marination <maricadsouza221197@gmail.com>
@marination
Copy link
Collaborator

@ankush Dont show "make Pick List" if 100% picked
Rest LGTM

@ankush
Copy link
Member Author

ankush commented Apr 27, 2022

@marination done. Skipping CI (only small JS change)

@marination marination merged commit 2fffc68 into frappe:develop Apr 27, 2022
@ankush ankush deleted the bunle_pickng branch April 27, 2022 10:51
ankush added a commit that referenced this pull request Apr 27, 2022
* refactor: misc pick list refactors

- make tracking fields read only and no-copy 🤦
- collapse print settings section, most users configure it once and
  forget about it, not need to show this.
- call pick list grouping function directly
- use get_descendants_of instead of obscure db function

(cherry picked from commit 5c3f901)

* test: bundles in picklist

(cherry picked from commit 7d56820)

# Conflicts:
#	erpnext/stock/doctype/pick_list/test_pick_list.py

* feat: Pick list from SO with Product Bundle

(cherry picked from commit 36c5e8a)

* refactor: sales order status update

- rename badly named variables
- support updated packed items

(cherry picked from commit e64cc66)

# Conflicts:
#	erpnext/stock/doctype/pick_list/pick_list.py

* perf: single update per Sales Order.

For each SO item the sales order picking status was being updated, this
isn't required and wasteful.

(cherry picked from commit c3fc0a4)

* feat: back-update min picked qty for a bundle

(cherry picked from commit 60bc26f)

* refactor: simplify needlessly complicated code

(cherry picked from commit 3ddad68)

* refactor: groupby using keys instead of int index

(cherry picked from commit 277b51b)

* refactor: simpler check for non-SO items

(cherry picked from commit f574121)

* feat: create DN from pick list with bundle items

(cherry picked from commit 23cb0d6)

* refactor: remove unnecssary vars

also remove misleading docstring

(cherry picked from commit 25485ed)

* fix: round off bundle qty

This is to accomodate bundles that might allow floating point qty.

(cherry picked from commit 41aa4b3)

* feat: transfer picklist stock info to packing list

(cherry picked from commit 1ac275c)

* test: product bundle fixture

(cherry picked from commit ee54ece)

* test: test bundle - picklist behaviour

(cherry picked from commit 9e60acd)

# Conflicts:
#	erpnext/stock/doctype/pick_list/test_pick_list.py

* fix: compare against stock qty while validating

Other changes:

- only allow whole number of bundles to get picked

(cherry picked from commit 8207697)

* fix: dont map picked qty and consider pick qty for new PL

Co-Authored-By: marination <maricadsouza221197@gmail.com>
(cherry picked from commit 47e1a01)

* fix(UX): only show pick list when picking is pending

[skip ci]

(cherry picked from commit 9a8e3ef)

* chore: make picked qty read only

(cherry picked from commit ebd5f0b)

* chore: conflicts and py3.7 compatibilty

Co-authored-by: Ankush Menat <ankush@frappe.io>
frappe-pr-bot pushed a commit that referenced this pull request May 3, 2022
# [13.28.0](v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](5df5058))
* convert default_item_manufacturer to link field ([#30835](#30835)) ([#30866](#30866)) ([37fad7e](37fad7e))
* Cost center filter on payment reconciliation ([22e7f03](22e7f03))
* filters not working in Shift Assignment Calendar view ([#30822](#30822)) ([3cdbb65](3cdbb65))
* Ignore custom field validation while setup ([ee54bf7](ee54bf7))
* **india:** e-invoice generation for registered composition gst category type ([#30814](#30814)) ([#30877](#30877)) ([246869d](246869d))
* Multi currency opening invoices ([2e62d51](2e62d51))
* payment days calculation for employees joining/leaving mid-month ([#30863](#30863)) ([#30883](#30883)) ([a1b0813](a1b0813))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([#30865](#30865)) ([5a5b49b](5a5b49b))
* **pos:** number pad translations ([b01f855](b01f855))
* **pos:** search field doesn't reset on checkout ([edbf551](edbf551))
* Supply type for overseas invoices with payment of tax ([fdcc591](fdcc591))
* supply type for sez invoices with payment of tax ([cf08710](cf08710))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](93482f3))
* **UX:** misleading stock entry lables ([#30870](#30870)) ([#30871](#30871)) ([57b03f0](57b03f0))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([#30846](#30846)) ([f7bf4a3](f7bf4a3))
* Vat Audit report fixes ([d5319a4](d5319a4))

### Features

* Copy task color from project template (backport [#30857](#30857)) ([#30859](#30859)) ([7ee18e8](7ee18e8))
* support product bundles in picklist (backport [#30762](#30762)) ([#30826](#30826)) ([645ee2d](645ee2d))
deepeshgarg007 pushed a commit to deepeshgarg007/erpnext that referenced this pull request May 13, 2022
# [13.28.0](frappe/erpnext@v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](frappe@5df5058))
* convert default_item_manufacturer to link field ([frappe#30835](frappe#30835)) ([frappe#30866](frappe#30866)) ([37fad7e](frappe@37fad7e))
* Cost center filter on payment reconciliation ([22e7f03](frappe@22e7f03))
* filters not working in Shift Assignment Calendar view ([frappe#30822](frappe#30822)) ([3cdbb65](frappe@3cdbb65))
* Ignore custom field validation while setup ([ee54bf7](frappe@ee54bf7))
* **india:** e-invoice generation for registered composition gst category type ([frappe#30814](frappe#30814)) ([frappe#30877](frappe#30877)) ([246869d](frappe@246869d))
* Multi currency opening invoices ([2e62d51](frappe@2e62d51))
* payment days calculation for employees joining/leaving mid-month ([frappe#30863](frappe#30863)) ([frappe#30883](frappe#30883)) ([a1b0813](frappe@a1b0813))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([frappe#30865](frappe#30865)) ([5a5b49b](frappe@5a5b49b))
* **pos:** number pad translations ([b01f855](frappe@b01f855))
* **pos:** search field doesn't reset on checkout ([edbf551](frappe@edbf551))
* Supply type for overseas invoices with payment of tax ([fdcc591](frappe@fdcc591))
* supply type for sez invoices with payment of tax ([cf08710](frappe@cf08710))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](frappe@93482f3))
* **UX:** misleading stock entry lables ([frappe#30870](frappe#30870)) ([frappe#30871](frappe#30871)) ([57b03f0](frappe@57b03f0))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([frappe#30846](frappe#30846)) ([f7bf4a3](frappe@f7bf4a3))
* Vat Audit report fixes ([d5319a4](frappe@d5319a4))

### Features

* Copy task color from project template (backport [frappe#30857](frappe#30857)) ([frappe#30859](frappe#30859)) ([7ee18e8](frappe@7ee18e8))
* support product bundles in picklist (backport [frappe#30762](frappe#30762)) ([frappe#30826](frappe#30826)) ([645ee2d](frappe@645ee2d))
mergify bot pushed a commit that referenced this pull request May 15, 2022
# [13.28.0](v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](5df5058))
* convert default_item_manufacturer to link field ([#30835](#30835)) ([#30866](#30866)) ([37fad7e](37fad7e))
* Cost center filter on payment reconciliation ([22e7f03](22e7f03))
* filters not working in Shift Assignment Calendar view ([#30822](#30822)) ([3cdbb65](3cdbb65))
* Ignore custom field validation while setup ([ee54bf7](ee54bf7))
* **india:** e-invoice generation for registered composition gst category type ([#30814](#30814)) ([#30877](#30877)) ([246869d](246869d))
* Multi currency opening invoices ([2e62d51](2e62d51))
* payment days calculation for employees joining/leaving mid-month ([#30863](#30863)) ([#30883](#30883)) ([a1b0813](a1b0813))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([#30865](#30865)) ([5a5b49b](5a5b49b))
* **pos:** number pad translations ([b01f855](b01f855))
* **pos:** search field doesn't reset on checkout ([edbf551](edbf551))
* Supply type for overseas invoices with payment of tax ([fdcc591](fdcc591))
* supply type for sez invoices with payment of tax ([cf08710](cf08710))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](93482f3))
* **UX:** misleading stock entry lables ([#30870](#30870)) ([#30871](#30871)) ([57b03f0](57b03f0))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([#30846](#30846)) ([f7bf4a3](f7bf4a3))
* Vat Audit report fixes ([d5319a4](d5319a4))

### Features

* Copy task color from project template (backport [#30857](#30857)) ([#30859](#30859)) ([7ee18e8](7ee18e8))
* support product bundles in picklist (backport [#30762](#30762)) ([#30826](#30826)) ([645ee2d](645ee2d))

(cherry picked from commit 8cc2ea0)

# Conflicts:
#	erpnext/__init__.py
hrwX pushed a commit to hrwX/erpnext that referenced this pull request May 20, 2022
# [13.28.0](frappe/erpnext@v13.27.1...v13.28.0) (2022-05-03)

### Bug Fixes

* Consistent accounting dimensions across Sales and Purchase docs ([5df5058](frappe@5df5058))
* convert default_item_manufacturer to link field ([frappe#30835](frappe#30835)) ([frappe#30866](frappe#30866)) ([37fad7e](frappe@37fad7e))
* Cost center filter on payment reconciliation ([22e7f03](frappe@22e7f03))
* filters not working in Shift Assignment Calendar view ([frappe#30822](frappe#30822)) ([3cdbb65](frappe@3cdbb65))
* Ignore custom field validation while setup ([ee54bf7](frappe@ee54bf7))
* **india:** e-invoice generation for registered composition gst category type ([frappe#30814](frappe#30814)) ([frappe#30877](frappe#30877)) ([246869d](frappe@246869d))
* Multi currency opening invoices ([2e62d51](frappe@2e62d51))
* payment days calculation for employees joining/leaving mid-month ([frappe#30863](frappe#30863)) ([frappe#30883](frappe#30883)) ([a1b0813](frappe@a1b0813))
* Period Closing Voucher is considering GL entries with is_cancelled=1 ([frappe#30865](frappe#30865)) ([5a5b49b](frappe@5a5b49b))
* **pos:** number pad translations ([b01f855](frappe@b01f855))
* **pos:** search field doesn't reset on checkout ([edbf551](frappe@edbf551))
* Supply type for overseas invoices with payment of tax ([fdcc591](frappe@fdcc591))
* supply type for sez invoices with payment of tax ([cf08710](frappe@cf08710))
* Use `account_type == 'Stock'` to filter stock accounts ([93482f3](frappe@93482f3))
* **UX:** misleading stock entry lables ([frappe#30870](frappe#30870)) ([frappe#30871](frappe#30871)) ([57b03f0](frappe@57b03f0))
* **UX:** record reason for skipping attendance or marking absent for auto attendance ([frappe#30846](frappe#30846)) ([f7bf4a3](frappe@f7bf4a3))
* Vat Audit report fixes ([d5319a4](frappe@d5319a4))

### Features

* Copy task color from project template (backport [frappe#30857](frappe#30857)) ([frappe#30859](frappe#30859)) ([7ee18e8](frappe@7ee18e8))
* support product bundles in picklist (backport [frappe#30762](frappe#30762)) ([frappe#30826](frappe#30826)) ([645ee2d](frappe@645ee2d))

(cherry picked from commit 8cc2ea0)

# Conflicts:
#	erpnext/__init__.py
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants