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: SO ordered qty on PO item removal #38378

Merged

Conversation

GursheenK
Copy link
Member

Bug
When a PO is submitted against a SO, the ordered_qty gets updated for each item in the SO. However, if items are removed from an already submitted PO using Update Items, the ordered_qty is not reduced from the linked SO. This causes the system to throw an error with the message " Purchase Order already created for all Sales Order items " and a new PO with the removed item cannot be created.

Fix
When items are updated in the PO, reduce the ordered quantity for all deleted rows.

@github-actions github-actions bot added accounts needs-tests This PR needs automated unit-tests. labels Nov 28, 2023
@GursheenK GursheenK marked this pull request as ready for review November 28, 2023 08:13
@deepeshgarg007 deepeshgarg007 merged commit 9087e14 into frappe:develop Dec 2, 2023
1 check passed
mergify bot pushed a commit that referenced this pull request Dec 2, 2023
* fix: update ordered_qty for SO when PO items removed

* refactor: use cached value

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 9087e14)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py
deepeshgarg007 pushed a commit that referenced this pull request Dec 4, 2023
* fix: SO ordered qty on PO item removal (#38378)

* fix: update ordered_qty for SO when PO items removed

* refactor: use cached value

---------

Co-authored-by: Deepesh Garg <deepeshgarg6@gmail.com>
(cherry picked from commit 9087e14)

# Conflicts:
#	erpnext/buying/doctype/purchase_order/purchase_order.py

* chore: resolve conflicts

---------

Co-authored-by: Gursheen Kaur Anand <40693548+GursheenK@users.noreply.github.com>
frappe-pr-bot pushed a commit that referenced this pull request Dec 5, 2023
# [14.53.0](v14.52.1...v14.53.0) (2023-12-05)

### Bug Fixes

* `OperationalError` while selecting Serial No in `Warranty Claim` (backport [#38394](#38394)) ([#38413](#38413)) ([49296cd](49296cd))
* better overlap logic for job card (backport [#38432](#38432)) ([#38521](#38521)) ([6db63c9](6db63c9))
* consider the `Valuation Method` while picking incorrect SLE (backport [#38592](#38592)) ([#38594](#38594)) ([01b2a1f](01b2a1f))
* debit credit mismatch in multi-currecy asset purchase receipt ([#38342](#38342)) ([fd6a23c](fd6a23c))
* don't consider cancelled entries ([#38401](#38401)) ([9345334](9345334))
* don't show non-stock items in Stock Analytics report (backport [#38543](#38543)) ([#38544](#38544)) ([2e333e6](2e333e6))
* don't update previous doc on rate change (backport [#38493](#38493)) ([#38523](#38523)) ([b88c7d6](b88c7d6))
* exclude `invoice_doctypes` from party advance ([1042d4c](1042d4c))
* exploded items in Subcontracting Receipt (backport [#38441](#38441)) ([#38444](#38444)) ([2908d96](2908d96))
* get dynamic link with parenttype contact ([12d3cda](12d3cda))
* incorrect customer outstanding amount ([#38475](#38475)) ([c07723d](c07723d))
* incorrect material request quantity in Production Plan (backport [#38566](#38566)) ([#38578](#38578)) ([70965ef](70965ef))
* incorrect ordered qty for Subcontracting Order ([#38415](#38415)) ([8e37087](8e37087))
* incorrect requested quantity for the subcontracting order (backport [#38455](#38455)) ([#38471](#38471)) ([497049b](497049b))
* item group filter in sales person wise report ([eee9062](eee9062))
* make create button translatable ([#38165](#38165)) ([c71b31e](c71b31e))
* no fstring in translation ([#38381](#38381)) ([cec2574](cec2574))
* **pe:** show split alert only on splitting ([8d6d74c](8d6d74c))
* **regional:** use net figures for sales calc ([#38260](#38260)) ([d337533](d337533))
* remove hardcoded, implicit rounding loss allowance ([419943a](419943a))
* set cwip account before asset tests ([ecde1d5](ecde1d5))
* show item name as title instead of item group in BOM (backport [#38478](#38478)) ([#38480](#38480)) ([0df52d2](0df52d2))
* SO ordered qty on PO item removal ([#38378](#38378)) ([b7fe163](b7fe163))
* sql error while filtering on finance book in GL ([25ec1fc](25ec1fc))
* unset discount amount based on coupon code ([7fa97fa](7fa97fa))
* use `docstatus` instead of `status` (backport [#38439](#38439)) ([#38442](#38442)) ([2dc4b02](2dc4b02))
* use predefined onload property `load_after_mapping` (backport [#38209](#38209)) ([#38518](#38518)) ([9f23b7e](9f23b7e))
* **ux:** make valuation field read only when it can't be modified (backport [#38450](#38450)) ([#38463](#38463)) ([bec7fb5](bec7fb5))
* validate finance_books table length in asset ([#38584](#38584)) ([14b908f](14b908f))

### Features

* `Company` filter in `Stock Ledger Variance` report (backport [#38553](#38553)) ([#38573](#38573)) ([6c89f35](6c89f35))
* shift depreciation for assets [v14] [backport of [#38327](#38327)] ([#38404](#38404)) ([d8c3935](d8c3935))
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 1, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accounts backport version-14-hotfix backport to version 14 backport version-15-hotfix needs-tests This PR needs automated unit-tests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants