Bug 441381

Summary: When configuring an investment, we should check if identifier required by Online Source is filled-in
Product: [Applications] kmymoney Reporter: Dawid Wróbel <me>
Component: ux-uiAssignee: KMyMoney Devel Mailing List <kmymoney-devel>
Status: REPORTED ---    
Severity: normal    
Priority: NOR    
Version: 5.1.2   
Target Milestone: ---   
Platform: Other   
OS: Other   
Latest Commit: Version Fixed In:
Attachments: "[No Identifier]" error

Description Dawid Wróbel 2021-08-22 17:16:31 UTC
Created attachment 140953 [details]
"[No Identifier]" error

SUMMARY
Some online sources depend on the ticker, while some other on the identification number (ISIN) (see `WebPriceQuoteSource::identifyBy` references in webpricequote.cpp).

The wizard should be performing a validation of whether the required field was filled in before allowing to add an investment. Otherwise we end up with a mis-configured investment that will manifest itself with a "[No Identifier]" error in "Update Stock and Currency Prices" dialog (see screenshot attached)


STEPS TO REPRODUCE
1. Add an investment and provide a ticker only, but not the identification number
2. Configure it to use an online source that requires identification number (which was not provided in 1.)
3. Open the "Update Stock and Currency Prices" dialog

OBSERVED RESULT
Notice the "[No Identifier]" error in dialog (see screenshot attached)

EXPECTED RESULT
It should not be possible to add an investment that has a missing field
Comment 1 Thomas Baumgart 2021-08-23 07:55:54 UTC
I agree with the above, nevertheless the situation described can still occur when the online quote source is changed after the creation of the investment from ticker to identification number and the ID field is left blank during the creation of the investment. In this case, a tooltip may provide a hint how to solve the problem (add the ID to the investment)
Comment 2 Dawid Wróbel 2021-08-23 11:07:09 UTC
Yes, I thought about it, too. In this case the mere "[No identifier]" could be more elaborate, but also this could be reported to a user during the "Consistency check" upon saving of the book file.