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: barcode is always deleted and inserted each time an item is saved #29411

Merged
merged 1 commit into from
Jan 23, 2022

Conversation

britlog
Copy link
Contributor

@britlog britlog commented Jan 22, 2022

Hi,

Problem : the barcode is always deleted and inserted each time an item is saved.

Why : the test if item_barcode.barcode != item_barcode.name: is always false because item_barcode.name is a hash.

Origin : it was done for #21661 but it is no more valid because the name for the child table Item Barcode is now a hash and no more based on the fieldname, it is forced in set_new_name() :

elif getattr(doc.meta, "istable", False): doc.name = make_autoname("hash", doc.doctype)

Tests

select * from `tabItem Barcode`
namecreationmodifiedmodified_byownerdocstatusparentparentfieldparenttypeidxbarcode
20f80379a32022-01-21 14:54:15.3692022-01-22 12:37:09.940AdministratorAdministrator075163barcodesItem1abc
6957c39bac2022-01-21 12:33:57.1472022-01-22 12:36:50.126AdministratorAdministrator0TEST ITEMbarcodesItem1123

@ankush
Copy link
Member

ankush commented Jan 23, 2022

@Mergifyio backport develop

@mergify
Copy link
Contributor

mergify bot commented Jan 23, 2022

backport develop

✅ Backports have been created

ankush pushed a commit that referenced this pull request Jan 23, 2022
(cherry picked from commit 096e7b9)

Co-authored-by: Britlog <info@britlog.com>
@ankush ankush added the Skip Manual Testing The changes in this PR does not require manual testing label Jan 24, 2022
KrithiRamani pushed a commit to KrithiRamani/erpnext that referenced this pull request Mar 14, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jan 15, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Skip Manual Testing The changes in this PR does not require manual testing
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants