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: Return Qty in PR/DN for legacy data #27001

Merged
merged 2 commits into from
Aug 18, 2021

Conversation

marination
Copy link
Collaborator

Case:

Legacy PR with the following items:
Item: A | Qty: 100 | Row Name: abcde123
Item: A | Qty: 400 | Row Name: fghij567

Legacy PR Return with the following items:
Item: A | Qty: 300 | Against PR Item Row Name: abcde123 [Over return against first row]

In version 12, since there was no back updation from Returned PR to its original PR, and no linking between the child rows, over return against a row was not an issue

Since version 13 we check returned qty against each row. So when this patch runs to back update the returned qty, for some legacy documents, it will break throwing OverAllowanceError

Fix:

  • Ignore such legacy documents, they will not have Returned % updated that's it, since they are not compliant with the current row to row mapping.
  • Commit after each doc finishes its back updation, and rollback in case of OverAllowanceError

@ankush ankush merged commit 112fc88 into frappe:develop Aug 18, 2021
frappe-pr-bot pushed a commit to frappe-pr-bot/erpnext that referenced this pull request Aug 18, 2021
ankush pushed a commit that referenced this pull request Aug 18, 2021
(cherry picked from commit 112fc88)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
KrithiRamani pushed a commit to KrithiRamani/erpnext that referenced this pull request Mar 14, 2022
(cherry picked from commit 112fc88)

Co-authored-by: Marica <maricadsouza221197@gmail.com>
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.

None yet

2 participants