On 18/10/10 00:40 -0700, Mohammad wrote: > Hi everyone, > New question on how to implement search in Treeview for not a field, > and not for a relational field. But for a field within 3rd lever > relation. > imagine we would like to define a pricelist, within a pricelist we > have many contracts, within contracts we have many product line. Now > in product line of course we have a product field (product.product > relation) and some other staff which works as additional properties. > Now we would like to implement standard search ( search boxes above > the Treeview by select="1") . > The question is how to implement it more beautiful.
First I don't think there is a beautiful way to do it because it is not a
natural behavior. You want to search on something that is not displayed.
> As it might be very applicable in other modules it's useful for me to
> give other members advises.
> I myself start with some rofth ideas:
>
> 1. Implement a functional field within the parent (pricelist) model
> trying to extract products which are related to this pricelist
> 1.1. through navigaiton
> 1.2 using domains
It is a possible way which is quite elegant.
> 2. make a direct relation again to the child of the child field
> to have something in the main Treeview to add "select=1" to it :) .
> just because the feather of search child fields is not available !
> sounds not logical.
I'm not sure but it is perhaps a many2many.
> i found an internal mechanism used by Tryton to hide search in
> Treeview when we are using it not as a main Treeview, But as child
> Treeview within the main Fromview. this mechanism hides search fields
> which is selected as a main search option during model definition
> ( for instance fields.char("sample", select="1") ).
>
> The idea of implementing this mechanism is obvious. It exist because
> we need to have a nice user interface, and search within child fields
> is not necessary in many situation. but according to some developments
> it looks critical.
>
> Therefore this mechanism (to hide searchbox above child treeview
> within form view) should exist, but we have to take control of it.
No it is not logical to search this way on a one2many or many2many because
they represent a selection of data.
If you need to search inside the values of a one2many or many2many you must
create a relate button to open this lines in its own tabs and then you can
search on it because they are now independant from the parent.
--
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/
pgpDVKN2zlTOB.pgp
Description: PGP signature
