Bulk transaction move

Wm wm+gnc at tarrcity.demon.co.uk
Thu Dec 25 19:43:22 EST 2014


Wed, 24 Dec 2014 12:49:26 
<CAB2pxDvMxLNLW7EDRbAkiJPPpeTX=VrJJbWjvEU8qP_kova=3Q at mail.gmail.com> 
Sébastien de Menten <sdementen at gmail.com>

>With the recently released piecash (python interface to gnucash), if your
>gnucash file is in the sqlite format, you could do this with the following
>script:
>
>from piecash import open_book
>
>with open_book("sample1.gnucash",readonly=False) as s:
>    misc_acc = s.accounts.get(name="Miscellaneous")
>    new_acc = s.accounts.get(name="Other account")
>    for spl in misc_acc.splits:
>        if spl.transaction.description = "some descrption":
>            spl.account = new_acc
>    s.save()

I have a problem with you not giving other people a warning, Sebastian.

I'm a grown up, I make backups, I test before using code like yours. 
Other people may not.  Until it is known your code is safe, have the 
decency to warn people about writing back as you (as far as I can tell) 
have not and can not tell all of the internal checks that gnc does.

I agree it would be better if the checks were known to all so they could 
be made by more than one set of code.  I understand your apparent 
irritation at not knowing what the checks are, has it occurred to you no 
single person knows?  It is OK for you and me ON OUR OWN RESPONSIBILITY 
to write back to our files but I'm not convinced it is right for people 
that are struggling with the basics of assets and income to be moving 
stuff about.

Cool it, please.

-- 
Wm...



More information about the gnucash-user mailing list