Greetings to the community,

I've come across the same problem as I am trying to set current
company.
Digging inside the config.py the _context variable is formed as an
output of the function:
self.server.model.res.user.get_preferences(True, {}).

Inside the server file trytond/res/user.py there is also a function
set_preferences but allows you to set only the values of:

self._preferences_fields = [
            'name',
            'password',
            'email',
            'signature',
            'menu',
            'action',
            'status_bar',
            'warnings',
        ]
and
        self._context_fields = [
            'language',
            'language_direction',
            'timezone',
            'groups',
        ]


How can I change the current company?


On Apr 9, 5:57 pm, Cédric Krier <[email protected]> wrote:
> 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: [email protected]
> Website:http://www.b2ck.com/
>
>  application_pgp-signature_part
> < 1KViewDownload

-- 
[email protected] mailing list

Reply via email to