[tryton] proteus - change current company

2012-04-09 Thread kostas
Hello,
I am using the proteus library in python scripts in order to import
and export data from a trytond server.
for example:

from proteus import config, Model

def main(args):
  ... do something ...

if __name__ == '__main__':
  config.set_trytond(user='admin', password='admin',
database_name='trytondb')
  main(sys.argv)

The above script works for the current company of user 'admin'.
How can I change the current company in the proteus script ?

-- 
tryton@googlegroups.com mailing list


Re: [tryton] proteus - change current company

2012-04-09 Thread Cédric Krier
On 09/04/12 04:28 -0700, kostas wrote:
 The above script works for the current company of user 'admin'.
 How can I change the current company in the proteus script ?

Since 2.2, the current company can be changed with the context.
In proteus, the context is defined on the config object but it is
management could be improved (a little bit like Transaction).

-- 
Cédric Krier

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


pgpv56v1EL9Bh.pgp
Description: PGP signature