[GNC] How To Get Job Object?

Robert Simmons rsimmons0 at gmail.com
Wed Aug 10 20:42:06 EDT 2022


I have created a number of Jobs. Now I want to associate an invoice with
one of the jobs. I can see there is a function "book.JobLookup()" but the
argument this takes is GncGUID. I don't know how to create this GUID
object, and the only way I can see to get the GUID is to just do a SQL
query directly to the DB.

The other way that I have found to get to those job objects is to go from a
customer to the associated jobs using cust.GetJoblist(). This does return a
list of objects "<Swig Object of type 'GncJob *' at 0x7fd8ccd2bb40>".
Looking at the object's directory, there are not the expected methods for
showing the Job name or other attributes:

['__class__',
 '__delattr__',
 '__dir__',
 '__doc__',
 '__eq__',
 '__format__',
 '__ge__',
 '__getattribute__',
 '__gt__',
 '__hash__',
 '__init__',
 '__init_subclass__',
 '__int__',
 '__le__',
 '__lt__',
 '__ne__',
 '__new__',
 '__reduce__',
 '__reduce_ex__',
 '__repr__',
 '__setattr__',
 '__sizeof__',
 '__str__',
 '__subclasshook__',
 'acquire',
 'append',
 'disown',
 'next',
 'own']

Can someone point out how to either make a GncGUID object or to get from
those GniJob objects to the job name?


More information about the gnucash-user mailing list