Deleting an account referenced by other objects
John Ralls
jralls at ceridwen.us
Wed Mar 10 10:05:07 EST 2010
On Mar 10, 2010, at 6:56 AM, Derek Atkins wrote:
> And that's exactly why I didn't tackle the problem. I didn't want to
> make an Account knowledgeable about an Invoice or GncEntry. So I
> basically left it with a "just don't do that". Which is where we are
> now.
>
> Fixing this..... Would probably be hard. The EASIEST way I can think
> of to do it would be to extend QOF events and let an event handler send
> a response back that can prevent an action from occuring. E.g., you
> could do something like:
>
> if (send_event(QOF_INSTANCE(this_obj), QOF_EVENT_PRE_DELETE) == in_use)
> {
> display_dialog (Sorry, you cannot delete this object; it's in use)
> return;
> }
>
> Of course the follow-up bug will be "what's using it?".. So perhaps the
> dialog should be put up by the denier?
>
> Like I said, it's a HARD problem, and one I didn't want to try to
> solve. It's also why I didn't implement "delete" for the biz objects.
Could the QOF event include sender information, which the handler could use to populate a list?
Regards,
John Ralls
More information about the gnucash-devel
mailing list