Comment by [email protected]:

There is no commit in the V1.8 example above, but wouldn't it be necessary so the new party.party record is written permanently?

{{{
with Transaction().start(DBNAME, user, None):
    # No password is needed, because we are working directly with the
    # API, bypassing any networking stuff.
    party_obj = POOL.get('party.party')
    new_party_id = party_obj.create({'name': 'New party'})
    # This line has to be added:
    Transaction().cursor.commit()

print new_party_id
}}}

See http://groups.google.com/group/tryton/browse_thread/thread/2e14710a0bde165c?hl=en

For more information:
http://code.google.com/p/tryton/wiki/HowToUseTrytondAsAModule

--
[email protected] mailing list

Reply via email to