← Back to team overview

openerp-expert-framework team mailing list archive

object namespaces

 

Related to the 'removing context' issue:
In a later version, would it be possible to replace all the self.pool.get("xxx").blabla(...) by just xxx.blabla(...) ?
I mean using regular python object namespaces rather than pool.get?
It would reduce the required typing...

Thanks,
--
David Janssens
Almacom (Thailand) Ltd.
http://almacom.co.th/



Raphaël Valyi wrote:
Hello,

I tend to think Albert's session's idea is great. However, I'm afraid, lot's of change for 5.2, and there are lot's of more urgent things already (we can work around this one, we can't work around a lot of other things like limations of osv_memory wizards, non-overridable fat methods) ...
I'm not against it, but I think Tiny is not going to make it for 5.2...
Still, in the meantime, they could use a derivative of the regexp you are talking about to check in their module quality tests that methods always pass the context.

Also, I think that the one time logging is very much required. Currently, If you use something like Aircrack http://www.aircrack-ng.org/ to hack the wifi of somebody you believe will connect to OpenERP, it's just too easy to find out the password in clear. The less you pass the clear password over insecure HTTP, the better it is.

Raphaël Valyi
http://www.akretion.com


2010/1/14 Joël Grand-Guillaume <joel.grandguillaume@xxxxxxxxxxxxxx <mailto:joel.grandguillaume@xxxxxxxxxxxxxx>>

    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 <http://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
    <https://launchpad.net/%7Eopenerp-expert-framework>
    Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
    <mailto:openerp-expert-framework@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~openerp-expert-framework
    <https://launchpad.net/%7Eopenerp-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 <http://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
    <mailto:joel.grandguillaume@xxxxxxxxxxxxxx>
    http://www.camptocamp.com/fr/business-solutions/formations


    _______________________________________________
    Mailing list: https://launchpad.net/~openerp-expert-framework
    <https://launchpad.net/%7Eopenerp-expert-framework>
    Post to     : openerp-expert-framework@xxxxxxxxxxxxxxxxxxx
    <mailto:openerp-expert-framework@xxxxxxxxxxxxxxxxxxx>
    Unsubscribe : https://launchpad.net/~openerp-expert-framework
    <https://launchpad.net/%7Eopenerp-expert-framework>
    More help   : https://help.launchpad.net/ListHelp


------------------------------------------------------------------------

_______________________________________________
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



References