GnuCash
Contact   Instructions
Bug 796756 - OFX import fails to recognize associated income accounts
Summary: OFX import fails to recognize associated income accounts
Status: RESOLVED FIXED
Alias: None
Product: GnuCash
Classification: Unclassified
Component: Engine (show other bugs)
Version: 3.2
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: core
QA Contact: core
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-13 13:49 EDT by David
Modified: 2018-07-13 14:48 EDT (History)
4 users (show)

See Also:


Attachments
git format-patch of my correction. (977 bytes, patch)
2018-07-13 13:49 EDT, David
jralls: rejected+
Details

Description David 2018-07-13 13:49:32 EDT
Created attachment 372917 [details]
git format-patch of my correction.

When importing standard ofx files from my broker OFX_INCOME transactions repeatedly ask for an associated income account, even after creating one.
This is a change in behavior from 2.6.18.
When this occurs there are a gobject error messages:
sys:1: Warning: g_object_get_is_valid_property: object class 'Account' has no property named 'ofx/associated-income-account'

After investigation I think I have found the problem.
In Account.cpp the property name is ofx-income-account but the kvp path definition in Account.cpp is ofx/associated-income-account. (This path is also the one used in the gnc-ofx-kvp.c in the import-export/ofx folder).

The gobject property name for this kvp path should be ofx-associated-income-account according to G_PARAM_SPEC rules.

I have been using a patched version of gnucash with this change which now imports such files as before.

Patch attached.
Comment 1 John Ralls 2018-07-13 14:48:10 EDT
Thanks for the report and the astute diagnosis, but your patch goes to the wrong end of the interaction. It's the calls to qof_instance_get/set in gnucash/import-export/ofx/gnc-ofx-kvp.c that need to use the property name instead of the KVP slot name.

Since we really want to hide the existence of KVP from outside of libgnucash I've gone further and refactored that file away, making the functions static inside gnc-ofx-import.c and renaming them as well as changing the constant, both name and value, to the property that they access.

Fixed for GnuCash 3.3.

Note You need to log in before you can comment on or make changes to this bug.