[GNC] Linked Documents on Import

Robert Simmons rsimmons0 at gmail.com
Sun Jul 24 16:58:44 EDT 2022


Please forgive me if this is the wrong place to ask this question. I
searched the list and did not see this discussed, so if it was discussed,
also please forgive my searching mistake.

I have built a Jupyter notebook that parses incoming bills in various forms
(some are PDF, some are CSV, and some are just saved HTML). The output is
the correct CSV for gnucash. After importing the data from this CSV, I have
almost everything I need except for one data point: the linked document.
After the import process, I have to go one by one to each imported bill or
invoice and link the document manually in gnucash's UI.

I opened the database and looked around and I can see that the linked
documents are stored in the "slots" table with the "name" column set to
"assoc_uri" set to the relative path to the document. The "slot_type" is 4
and the "obj_guid" I assume points to the invoice or whatever the document
is associated with. This is all very straightforward. I absolutely don't
want to make changes from Jupyter directly to the database even though I
could probably reverse engineer the database queries that are being made by
reading the source code.

I have looked through the Python bindings and I don't see any references to
linking documents.

Is there a way to include the document URI in the import CSV?

Or

Is there a Python binding that I'm missing or isn't documented that will
allow me to link a document?

Finally:

Is adding a field for a linked document to the importer UI component a
valid feature request?


More information about the gnucash-user mailing list