Skip to content

fix: preventing naming gaps now validates each series individually#103

Merged
barredterra merged 4 commits into
alyf-de:version-15from
worcworc:fix-naming-series-validation-on-delete
Jan 30, 2026
Merged

fix: preventing naming gaps now validates each series individually#103
barredterra merged 4 commits into
alyf-de:version-15from
worcworc:fix-naming-series-validation-on-delete

Conversation

@worcworc

Copy link
Copy Markdown
Contributor

…when using more than one naming series such as "RE-" and "GU-" for sales invoice.

When using more than one naming series (for example, "RE-" and "GU-") for Sales Invoices, the “prevent gaps in transaction naming” validation previously blocked deletion of newer documents even if they belonged to different naming series.

With this update, the validation now checks for gaps within each naming series independently — allowing you to delete the newest document of a given series, even if there are newer documents with another prefix.

Example:

RE-0005

GU-0007

Previously, if RE-0005 was newer, you couldn’t delete GU-0007.

Now, each series (RE- and GU-) is validated separately, so you can safely delete the newest document of either series.

@worcworc

Copy link
Copy Markdown
Contributor Author

👀

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This pull request fixes a validation issue in the transaction deletion prevention logic. Previously, when "prevent gaps in transaction naming" was enabled, the validation checked for newer documents globally across all naming series, incorrectly blocking deletion of documents from one series if a newer document existed in a different series. Now, the validation is performed independently for each naming series, allowing proper deletion of the most recent document within its own series.

Changes:

  • Modified is_not_latest function to is_not_latest_in_series to filter by naming series
  • Added naming_series parameter to the validation logic
  • Updated error message to clarify that validation is per-series

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread erpnext_germany/custom/sales.py Outdated
@barredterra barredterra merged commit fe3d314 into alyf-de:version-15 Jan 30, 2026
6 checks passed
@barredterra

Copy link
Copy Markdown
Member

🎉 This PR is included in version 15.22.1 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@barredterra

Copy link
Copy Markdown
Member

@Mergifyio backport version-16-hotfix

@mergify

mergify Bot commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

backport version-16-hotfix

✅ Backports have been created

Details

mergify Bot pushed a commit that referenced this pull request Jan 30, 2026
)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
(cherry picked from commit fe3d314)
barredterra added a commit that referenced this pull request Jan 30, 2026
)

Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
barredterra added a commit that referenced this pull request Jan 30, 2026
) (#113)

Co-authored-by: worcworc <34313456+worcworc@users.noreply.github.com>
Co-authored-by: barredterra <14891507+barredterra@users.noreply.github.com>
mahsem pushed a commit to mahsem/erpnext_sweden that referenced this pull request Jan 30, 2026
## [15.22.1](alyf-de/erpnext_germany@v15.22.0...v15.22.1) (2026-01-30)

### Bug Fixes

* preventing naming gaps now validates each series individually ([alyf-de#103](alyf-de#103)) ([fe3d314](alyf-de@fe3d314))
mahsem pushed a commit to mahsem/erpnext_sweden that referenced this pull request Jan 30, 2026
# [15.23.0](alyf-de/erpnext_germany@v15.22.1...v15.23.0) (2026-01-30)

### Bug Fixes

* **Business Trip Region:** import current data (backport [alyf-de#111](alyf-de#111)) ([alyf-de#112](alyf-de#112)) ([7d446ff](alyf-de@7d446ff))
* **Business Trip:** filter by valid_from ([alyf-de#109](alyf-de#109)) ([8022ff2](alyf-de@8022ff2))
* preventing naming gaps now validates each series individually ([alyf-de#103](alyf-de#103)) ([12c945c](alyf-de@12c945c))

### Features

* **Business Trip Region:** adjust the data structure to retrieve date specific allowance rates ([alyf-de#106](alyf-de#106)) ([4b09b64](alyf-de@4b09b64))
fixundfertig123 pushed a commit to fixundfertig123/erpnext_germany that referenced this pull request Jul 3, 2026
# [16.1.0](alyf-de/erpnext_germany@v16.0.0...v16.1.0) (2026-01-30)

### Bug Fixes

* **Business Trip Region:** import current data ([alyf-de#111](alyf-de#111)) ([609d5c9](alyf-de@609d5c9))
* **Business Trip:** no allowance for single-day trip with less than 8h ([alyf-de#114](alyf-de#114)) ([579e360](alyf-de@579e360))
* preventing naming gaps now validates each series individually ([alyf-de#103](alyf-de#103)) ([alyf-de#113](alyf-de#113)) ([2763b17](alyf-de@2763b17))

### Features

* **Business Trip Region:** adjust the data structure to retrieve date specific allowance rates (backport [alyf-de#106](alyf-de#106)) ([alyf-de#108](alyf-de#108)) ([7193b3f](alyf-de@7193b3f))
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.

3 participants