GNOME Bugzilla – Bug 511006
Commodity creation skipped due to saved mappings
Last modified: 2018-06-29 22:00:02 UTC
Please describe the problem: When QIF securities are imported, new GnuCash commodities may need to be created. However, commodity creation is skipped for those QIF securities that have ever been imported in the past - even if they were originally imported into a different GnuCash data file. Steps to reproduce: 1. Make a backup your qif-accounts-map file, then remove the original. 2. Start GnuCash with --nofile. 3. Import a QIF file containing a transaction that involves a QIF security, such as the example attached. 4. Notice that a new GnuCash commodity was created during by the importer. 5. Restart GnuCash, again with --nofile. 6. Import the same QIF file. 7. Notice that no GnuCash commodity gets created by the importer. Actual results: The QIF importer does not create a commodity. Expected results: The QIF importer should create a commodity, and that commodity should be used for the GnuCash account that holds the shares. Does this happen every time? Yes. Other information: The problem occurs because the QIF importer assumes that any QIF security that has been imported in the past will already exist as a commodity in the GnuCash data file. This is not a valid assumption for users that switch between multiple GnuCash data files.
Created attachment 103332 [details] QIF file demonstrating the bug
Created attachment 103401 [details] [review] Proposed patch With this patch, the importer verifies that each previously imported QIF security actually exists as a commodity in GnuCash, rather than assuming so.
I've tested this on my data and it did fix the problem where commodity accounts were not created when the commodity section of qif-accounts-map already had entries for the securities.
trunk@16909, awaiting backport for 2.2.4. Thanks!
Applied to branches/2.2 as r16920 for GnuCash 2.2.4. Thanks a lot!
GnuCash bug tracking has moved to a new Bugzilla host. This bug has been copied to https://bugs.gnucash.org/show_bug.cgi?id=511006. Please update any external references or bookmarks.