← Back to team overview

openerp-community team mailing list archive

Re: set context depending on the current record in ir.actions.act_window

 

Hello Fabien,

off-topic but related: today the following test [('foo_ids', 'contains',
'bar')] works with a name based on the name_search stuff. However, from my
quick tests if I remember properly, it doesn't work with an id such as
[('foo_ids',
'contains', id)]. Any chance when an id is provided it would then try to
match the id? That would be more precise because names can be duplicated
eventually or a name could also be included in some other larger name. What
I propose might however conflicts with searching a name containing some
number. Any specific syntax we could adopt to have this working? Thoughts?

Thanks.

On Thu, Aug 4, 2011 at 7:19 PM, Fabien Pinckaers <fp@xxxxxxxxxxx> wrote:

> Hello,
>
> [('product_id.category_id','=','Computers')] should work as the many2one
> fields calls name_search to detect the ID when it detects a string.
>
>
> Thanks,
>
> Ovnicraft wrote:
> >
> >
> > 2011/8/2 Jerzy Orłowski <jerzy.orlowski@xxxxxxxxxxxx
> > <mailto:jerzy.orlowski@xxxxxxxxxxxx>>
> >
> >     Is it possible tu use "django way" values in searches and domai
> >     values. Something like [('product_id.category_id.name
> >     <http://product_id.category_id.name>__','=','Computers')]?
> >
> >
> > In fact in openerp i cant see the case when you do that, yo possibly do:
> >
> > [('product_id.category_id
> > <http://product_id.category_id.name/>','=',category_id)]
> >
> > when category_id is a field in your wizard or object.
> >
> > So you can give us more info about what you want to do and we can help
> > you in openobject way. :)
> >
> > Regards,
> >
> >
> >
> >
> >     On 08/02/2011 07:18 PM, Fabien Pinckaers wrote:
> >
> >         Hello,
> >
> >         There is no easy way to put values of the model instance being
> >         loaded
> >         but the ID of the model instance (and IDS if you select
> >         severals) are
> >         provided in the context (active_id and active_ids). So you can
> >         load the
> >         values in your action.
> >
> >         Viktor Nagy wrote:
> >
> >             hi,
> >
> >             I would like to set the context of an action given in a
> >             record xml tag
> >             depending on some value of the model instance being loaded
> >
> >             is this possible?
> >
> >             Viktor
> >
> >
> >
> ------------------------------__------------------------------__------------
> >
> >             _________________________________________________
> >             Mailing list: https://launchpad.net/~__openerp-community
> >             <https://launchpad.net/~openerp-community>
> >             Post to     : openerp-community@lists.__launchpad.net
> >             <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
> >             Unsubscribe : https://launchpad.net/~__openerp-community
> >             <https://launchpad.net/~openerp-community>
> >             More help   : https://help.launchpad.net/__ListHelp
> >             <https://help.launchpad.net/ListHelp>
> >
> >
> >
> >
> >     --
> >     Pozdrawiam serdecznie,
> >
> >     Jerzy Orłowski
> >
> >     Lacan Technologies Group
> >     Członek Zarządu ds. technologii
> >     Al. Stanów Zjednoczonych 53
> >     04-028 Warszawa
> >     tel. +48 (22) 266 01 02 <tel:%2B48%20%2822%29%20266%2001%2002>
> >     tel. +48 (22) 292 16 16 <tel:%2B48%20%2822%29%20292%2016%2016>
> >     kom. 668 151 245
> >     www.lacan.com.pl <http://www.lacan.com.pl>
> >     www.erpsystems.com.pl <http://www.erpsystems.com.pl>
> >     www.serwerownie.com <http://www.serwerownie.com>
> >
> >
> >     Lacan Technologies Sp. z o.o. Sąd Rejonowy dla m.st <http://m.st>.
> >     Warszawy w Warszawie, XIII Wydział Gospodarczy Krajowego Rejestru
> >     Sądowego, KRS: 0000319673, NIP: 521-351-01-01
> >
> >     Kapitał zakładowy: 50.000 PLN
> >
> >
> >
> >     _________________________________________________
> >     Mailing list: https://launchpad.net/~__openerp-community
> >     <https://launchpad.net/~openerp-community>
> >     Post to     : openerp-community@lists.__launchpad.net
> >     <mailto:openerp-community@xxxxxxxxxxxxxxxxxxx>
> >     Unsubscribe : https://launchpad.net/~__openerp-community
> >     <https://launchpad.net/~openerp-community>
> >     More help   : https://help.launchpad.net/__ListHelp
> >     <https://help.launchpad.net/ListHelp>
> >
> >
> >
> >
> > --
> > Cristian Salamea
> > @ovnicraft
> >
> >
> > ------------------------------------------------------------------------
> >
> > _______________________________________________
> > Mailing list: https://launchpad.net/~openerp-community
> > Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
> > Unsubscribe : https://launchpad.net/~openerp-community
> > More help   : https://help.launchpad.net/ListHelp
>
>
> --
> Fabien Pinckaers
> CEO OpenERP
> Chaussée de Namur 40
> B-1367 Grand-Rosière
> Belgium
> Phone: +32.81.81.37.00
> Fax: +32.81.73.35.01
> Web: http://openerp.com
>
> _______________________________________________
> Mailing list: https://launchpad.net/~openerp-community
> Post to     : openerp-community@xxxxxxxxxxxxxxxxxxx
> Unsubscribe : https://launchpad.net/~openerp-community
> More help   : https://help.launchpad.net/ListHelp
>

Follow ups

References