Lots and SQL backend

Phil Longstaff plongstaff at rogers.com
Sun Sep 7 14:15:54 EDT 2008


I don't know enough about how lots are used in the system.

There is a problem with the SQL backend when you unpost an invoice.  The problem is that the lot table is defined to disallow a null value for the account.  However, when you unpost an unpaid invoice, the posting transaction is deleted, so all splits associated with the lot are deleted.  In gnc_lot_remove_split(), when the last split is removed from the lot, the lot is removed from the account and lot->account is set to NULL.  The lot is then saved.  This causes the SQL UPDATE to fail because the account can't be NULL.

I assume it would be OK to delete the lot at this point.  Derek?  You know the business stuff best.

Phil


More information about the gnucash-devel mailing list