On 21 May 12:10, Илья Мельников wrote:
> 21.05.2015 11:54, Cédric Krier wrote:
> > To express the "AND" you will have to write the domain yourself.
> 
> Where I can write domain? In custom view? Do I have to make different
> views for all combination of search categories, or search criteria can
> be entered somehow?

The current domain is:

    [('categories', 'child_of', [Eval('active_id')], 'parent')]

it could be changed into:

    [('categories', 'child_of', Eval('active_ids'), 'parent')]

but it will not be an 'AND' as you want but an 'OR'. Any way, it will
probably be a good improvement (in combination with the one at the
bottom).

In your case, it should be something like:

    [('categories', 'child_of', <id1>, 'parent'),
    ('categories', 'child_of', <id2>, 'parent'),
    ...]

but this can not be written in a static way in an act_window.

So you have to use a wizard to construct the right domain.

> > The client doesn't support child_of operator and the default relate is
> > only on the active category (the one clicked).
> 
> Is it possible to make client use all selected categories?
> * user selects many categories in "Category tree"
> * user hits Enter
> * Tryton opens "Parties by category" with parties matching all selected

I don't think it is possible and it is probably linked to
https://bugs.tryton.org/issue2198

Any way, in addition to tree_open, I think we should also add a relate.
And I think this could be done automatically just like we add buttons as
wizard action in the client.

-- 
Cédric Krier - B2CK SPRL
Email/Jabber: [email protected]
Tel: +32 472 54 46 59
Website: http://www.b2ck.com/

Attachment: pgpo_m3cyP4bv.pgp
Description: PGP signature

Reply via email to