Re: [tryton] Search by multiple categories
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: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpo_m3cyP4bv.pgp Description: PGP signature
[tryton] Search by multiple categories
Hello. How I can search by multiple categories? Categories: * Cat-A * Cat-A1 * Cat-A2 * Cat-B * Cat-B1 * Cat-B2 Parties: * Party1: Cat-A1 * Party2: Cat-A1, Cat-B1 * Party3: Cat-B1 Opening Categories tree and clicking on Cat-A1 will show Parties: 1, 2 Opening Categories tree and clicking on Cat-B1 will show Parties: 2, 3 But the task is: find parties with both Cat-A1 and Cat-B1. (Only Party2) -- Ilya Melnikov 2015-05-21, 10:14:30 +0500 signature.asc Description: OpenPGP digital signature
Re: [tryton] Search by multiple categories
On 21 May 10:26, Илья Мельников wrote: Hello. How I can search by multiple categories? Categories: * Cat-A * Cat-A1 * Cat-A2 * Cat-B * Cat-B1 * Cat-B2 Parties: * Party1: Cat-A1 * Party2: Cat-A1, Cat-B1 * Party3: Cat-B1 Opening Categories tree and clicking on Cat-A1 will show Parties: 1, 2 Opening Categories tree and clicking on Cat-B1 will show Parties: 2, 3 But the task is: find parties with both Cat-A1 and Cat-B1. (Only Party2) To express the AND you will have to write the domain yourself. The client doesn't support child_of operator and the default relate is only on the active category (the one clicked). -- Cédric Krier - B2CK SPRL Email/Jabber: cedric.kr...@b2ck.com Tel: +32 472 54 46 59 Website: http://www.b2ck.com/ pgpgMYw5odRUn.pgp Description: PGP signature
Re: [tryton] Search by multiple categories
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 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 -- Ilya Melnikov 2015-05-21, 12:02:02 +0500 signature.asc Description: OpenPGP digital signature