← Back to team overview

openerp-expert-framework team mailing list archive

Re: Removing context

 

Hi,


I vote for Albert suggestion about session ! We'll probably avoid lots of bugs... the change can be done even if it look like lots of work...

We (at Camptocamp) are also working on a simple and generic module to handle user session into openobject.

Our goal is to provide one general module to handle session login, and an other to provide OTP (One Time Password) implementation:

https://blueprints.launchpad.net/openerp/+spec/session-and-otp

I think we should write a blueprint for that, what do you think ?


Regards,


Joël




Le 13 janv. 2010 à 19:56, Albert Cervera i Areny a écrit :

> [Following with my  series of sensationalist subjects]
> 
> In the partners mailing list, I've read that Fabien mentions the new release 
> of OpenERP as 5.2 or 6.0. If that was to be called 6.0 I think more things 
> should be fixed so let me make a proposal which will most probably be rejected 
> ;-)
> 
> The proposal is to change the usual structure:
> 
> def function(self, cr, uid, .... context=None):
> 
> with
> 
> def function(self, session, ...):
> 
> This session variable could have at least three members: 
> 
> session.cr
> session.uid
> session.context
> 
> It could provide some facilities such as:
> 
> newsession = session.copy()
> 
> or
> 
> # copy updating context
> newsession = session.copy({
> 	'lang': 'ca_ES'
> })
> 
> I know that sounds like a big change but I can't avoid thinking on how many 
> bug reports we would have avoided (and will avoid) just because developers 
> keep forgeting passing context argument. 
> 
> It's true that there're lots of modules out there but most of them could be 
> updated with simple regular expressions.
> 
> Of course, it also provides cleaner code and avoids typing a little bit of 
> code :P
> 
> -- 
> Albert Cervera i Areny
> http://www.NaN-tic.com
> Mòbil: +34 669 40 40 18
> 
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-expert-framework
> Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-expert-framework
> More help   : https://help.launchpad.net/ListHelp

-- 

Joël Grand-Guillaume 
OpenERP Consultant
Business Solutions

Camptocamp SA
PSE A, CH-1015 Lausanne
 www.camptocamp.com 

Phone: +41 21 619 10 28
Office: +41 21 619 10 10
Fax: +41 21 619 10 00
Email: joel.grandguillaume@xxxxxxxxxxxxxx
http://www.camptocamp.com/fr/business-solutions/formations


Follow ups

References