On 15/08/13 14:52 +0200, Guillem Barba Domingo wrote:
> 2013/8/15 Demoy Blake <[email protected]>
> 
> > I am making a script to import remote data then create patient records
> > from data.
> > the scripts are working individually but called from a tryton wizard I
> > receive these errors.
> >
> >   File "/trytond/modules/aa/aa.py", line 110, in map_Mdata
> >     with Transaction().start(dbname, 0, context=CONTEXT):
> >   File "/trytond/transaction.py", line 70, in start
> >     assert self.user is None
> > AssertionError
> >
> > here is line 110 in map_Mdata mentioned above
> >
> >     dbname = 'admin'
> >     CONTEXT={}
> >
> >     Pool.start()
> >     pool = Pool(dbname)
> >     Cache.clean(dbname)
> >
> >     # Line 110
> >     with Transaction().start(dbname, 0, context=CONTEXT):
> >         pool.init()
> >
> >     with Transaction().start(dbname, 0, context=CONTEXT):
> >         user_obj = pool.get('res.user')
> >         user = user_obj.search([('login', '=', 'admin')], limit=1)[0]
> >         user_id = user.id
> >
> 
> the second parameter of Transaction.start() is the user. You set it as 0 =>
> no user.

This is not the problem, it is that he starts a transaction inside a
transaction.

-- 
Cédric Krier

B2CK SPRL
Rue de Rotterdam, 4
4000 Liège
Belgium
Tel: +32 472 54 46 59
Email/Jabber: [email protected]
Website: http://www.b2ck.com/

Attachment: pgpFeTbazSpft.pgp
Description: PGP signature

Reply via email to