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: broken save on empty row existance #35216

Merged
merged 1 commit into from
May 9, 2023

Conversation

rtdany10
Copy link
Contributor

@rtdany10 rtdany10 commented May 8, 2023

Peek.2023-05-08.17-07.mp4

Problem:
Unable to save the document if the first save action was initiated with an empty row. Why leave the first row empty? Cause of multi select.

Cause:

  • remove_empty_rows uses get_all_docs to fetch the child table rows.
  • get_all_docs loops the document and if any key(field) is an array, treats it as a table
  • _calculate_taxes_and_totals adds a new key _items to the doc.
  • _items is not an actual table, but a clone of the actual items field.
  • get_all_docs treats _items and items as different table causing duplicated rows
  • Trying to clear this duplicate empty row throws an error and takes away the user's ability to save.

@rtdany10
Copy link
Contributor Author

rtdany10 commented May 8, 2023

Introduced via: #33874

@rtdany10
Copy link
Contributor Author

rtdany10 commented May 8, 2023

@ruthra-kumar ruthra-kumar self-assigned this May 9, 2023
@ruthra-kumar ruthra-kumar self-requested a review May 9, 2023 11:37
@ruthra-kumar
Copy link
Member

LGTM

@ruthra-kumar ruthra-kumar added the backport version-14-hotfix backport to version 14 label May 9, 2023
@ruthra-kumar ruthra-kumar merged commit b8971c7 into frappe:develop May 9, 2023
ruthra-kumar added a commit that referenced this pull request May 10, 2023
…-35216

fix: broken save on empty row existance (backport #35216)
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 12, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
backport version-14-hotfix backport to version 14
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants