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

fixes #8941: Better error message for duplicate items #8968

Merged
merged 3 commits into from
Jun 13, 2017

Conversation

tundebabzy
Copy link
Contributor

No description provided.

@mbauskar
Copy link
Contributor

mbauskar commented May 25, 2017

@tundebabzy,

can you add the before and after screenshot? It will be easier to review the PR, Please check
https://github.com/frappe/erpnext/wiki/Contribution-Guidelines

try:
item = get_duplicates(lst).next()
if item:
return item
Copy link
Contributor

Choose a reason for hiding this comment

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

instead of returning single item return list of duplicate items, e.g. if raw material has items A, B, B, C, C then return list [B, C] as multiple items

@tundebabzy
Copy link
Contributor Author

@mbauskar Sorry about that. Noted.
Before
screenshot from 2017-05-25 11-47-20

After
screenshot from 2017-05-25 11-46-24

@tundebabzy
Copy link
Contributor Author

Changed to show all duplicates. They are displayed in an ol.
** Before**
screenshot from 2017-05-25 11-47-20

After
screenshot from 2017-05-25 12-25-20

if duplicate_items:
li = []
for i in duplicate_items:
li.append("<li>{0} on row {1}".format(i.item_code, i.idx))
Copy link
Contributor

@mbauskar mbauskar Jun 6, 2017

Choose a reason for hiding this comment

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

close the li tag <li>{0} on row {1}</li>

Also can we keep the message simple? Just join the list of items with <br>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok. That means no need for the <li> tags?

@tundebabzy
Copy link
Contributor Author

screenshot from 2017-06-06 23-09-32

@mbauskar mbauskar merged commit 26a3961 into frappe:develop Jun 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants