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: Validate if item exists on uploading items in stock reco #27538

Merged
merged 2 commits into from Sep 16, 2021

Conversation

marination
Copy link
Collaborator

Issue:
Uploading (via Upload button) non existent item in stock reco and then changing warehouse or batch (trigger JS action) gave an error:

  File ".../stock_reconciliation/stock_reconciliation.py", line 590, in get_stock_balance_for
    with_serial_no = True if item_dict.get("has_serial_no") else False

  AttributeError: 'NoneType' object has no attribute 'get'

PS: Maybe some basic checks can be added during data upload itself to not manually check these. Will check framework

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item
@codecov

This comment has been minimized.

Copy link
Member

@ankush ankush left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

We can think of adding link field validations during/post CSV imports?

@ankush ankush merged commit 9b38888 into frappe:develop Sep 16, 2021
frappe-pr-bot pushed a commit to frappe-pr-bot/erpnext that referenced this pull request Sep 16, 2021
…#27538)

* fix: Validate if item exists on uploading items in stock reco

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item

* chore: translation

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 9b38888)
@marination
Copy link
Collaborator Author

@ankush yes that will be good and also maybe a hook that can enable us to write custom checks too ? Because unlike data import this import doesn't give that error traceback bit (if i'm not wrong),and causes a lot of type issues too (historically) like comparison between str and int.

@ankush
Copy link
Member

ankush commented Sep 20, 2021

@Mergifyio backport version-12-hotfix

mergify bot pushed a commit that referenced this pull request Sep 20, 2021
* fix: Validate if item exists on uploading items in stock reco

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item

* chore: translation

Co-authored-by: Ankush Menat <ankushmenat@gmail.com>
(cherry picked from commit 9b38888)
@mergify
Copy link
Contributor

mergify bot commented Sep 20, 2021

Command backport version-12-hotfix: success

Backports have been created

ankush pushed a commit that referenced this pull request Sep 20, 2021
#27593)

* fix: Validate if item exists on uploading items in stock reco

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item

* chore: translation

Co-authored-by: Marica <maricadsouza221197@gmail.com>
asoral pushed a commit to asoral/erpnext that referenced this pull request Nov 12, 2021
…#27538)

* fix: Validate if item exists on uploading items in stock reco

- Uploading non existent item in stock reco and then changing warehouse or batch gave an error
- Check for non existent item

* chore: translation

Co-authored-by: Ankush Menat <ankushmenat@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

3 participants