Bug 514987

Summary: Incorrect New Sub-Category Form Fill
Product: [Applications] kmymoney Reporter: pc <junk_2010>
Component: generalAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: RESOLVED FIXED    
Severity: normal    
Priority: NOR    
Version First Reported In: 5.2.1   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed/Implemented In: 5.2.2
Sentry Crash Report:
Attachments: screenshots to show issue

Description pc 2026-01-23 18:46:33 UTC
Created attachment 188829 [details]
screenshots to show issue

SUMMARY
If in the ledger form view you wish to create a new sub-category for a new item you are entering, KMyMoney appears to allow you to do this in the same way as you would select an existing sub-category by using the:
Category:Sub-category
syntax. However, the resulting "Create a new Category - KMyMoney" form that opens does not have it data fields correctly populated to achieve this. It appears that the ":" character is not recognised as the delimiter between the category and sub-category names. I believe that the ":" character is not allowed in a category name?

I will attach a PDF with screenshots for a new sub-category creation using the "Categories" tab, that works as expected, and one from the "Ledgers" tab that does not work as expected. 

STEPS TO REPRODUCE
1. Create a new expense entry in an account in the "Ledger" view
2. Create a new sub-category by entering for example "Insurance:Cycle Insurance"

OBSERVED RESULT
The "Create a new Category - KMyMoney" form that opens does not have its "General Tab"-"Name field" filled in correctly and the "Hierarchy Tab"-"Selection" is incorrect.

EXPECTED RESULT
The "General Tab"-"Name field data and "Hierarchy Tab"-"Selection" should be set as expected to created the required new sub-category.


SOFTWARE/OS VERSIONS
Linux: Ubuntu 24.04.3 LTS
AppImage file: kmymoney-5.2-5096-linux-gcc-x86_64.AppImage
KMyMoney Version 5.2.1-c9efa7a

ADDITIONAL INFORMATION
Comment 1 Thomas Baumgart 2026-01-25 16:43:05 UTC
Git commit 3cc2f567cf3443a00dc9d668872115bc7f04c2f4 by Thomas Baumgart.
Committed on 25/01/2026 at 16:40.
Pushed by tbaumgart into branch 'master'.

Allow direct creation of sub-categories
FIXED-IN: 5.2.2

M  +53   -14   kmymoney/dialogs/accountcreator.cpp
M  +15   -0    kmymoney/mymoney/storage/accountsmodel.cpp
M  +11   -0    kmymoney/mymoney/storage/accountsmodel.h
M  +1    -1    kmymoney/views/investtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/3cc2f567cf3443a00dc9d668872115bc7f04c2f4
Comment 2 Thomas Baumgart 2026-01-25 16:44:40 UTC
Git commit 6e268435539a849714c831bc27ed682c0a358daa by Thomas Baumgart.
Committed on 25/01/2026 at 16:43.
Pushed by tbaumgart into branch '5.2'.

Allow direct creation of sub-categories
FIXED-IN: 5.2.2
(cherry picked from commit 3cc2f567cf3443a00dc9d668872115bc7f04c2f4)

M  +53   -14   kmymoney/dialogs/accountcreator.cpp
M  +15   -0    kmymoney/mymoney/storage/accountsmodel.cpp
M  +11   -0    kmymoney/mymoney/storage/accountsmodel.h
M  +1    -1    kmymoney/views/investtransactioneditor.cpp

https://invent.kde.org/office/kmymoney/-/commit/6e268435539a849714c831bc27ed682c0a358daa