El 06/02/18 a les 11:11, Khurram Shahzad ha escrit:
> Hi all,
>
> We have received a pretty strange but sensible requirement regarding
> searching in Products from our warehouse/procurement department. I will
> try to explain it using an example.
>
> We have defined a product category being 'Paper for printing' and
> defined following products in it:
>
> Paper A4
> A5
> A6 Paper
> Legal Size Paper
> Paper Executive Size
>
> Now while searching, if they enter 'A5', they should be able to see all
> products whose name match with 'A5' and also those products whose
> product category matches with product 'A5' category. Thus they will be
> able to select from the list of all 5 products mentioned above and they
> typed anyone of those.
You should override the rec_name searcher on the product model to
include also the name from the products of the same category. Haven't
tested but this can be done with a domain like:
[('categories.product.rec_name',) + tuple(clause[1:])]
Hope it helps.
--
Sergi Almacellas Abellana
www.koolpi.com
Twitter: @pokoli_srk
--
You received this message because you are subscribed to the Google Groups
"tryton" group.
To view this discussion on the web visit
https://groups.google.com/d/msgid/tryton/0b43b95f-9052-4c7c-0354-3199791a1de6%40koolpi.com.