El 06/02/18 a les 11:51, Khurram Shahzad ha escrit:
> Dear Sergi,
> 
> On Tue, Feb 6, 2018 at 3:33 PM, Sergi Almacellas Abellana
> <se...@koolpi.com <mailto:se...@koolpi.com>> wrote:
> 
>     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:])]
> 
> 
> Thank you so much for the prompt response. But, is 'categories' filed
> defined in product? Or it is sort of implicit field available?
> 

The field is defined on template but it's replicated as Function field
on product. This function field is searchable and will pick the values
of the template.

This makes possible (by customization modules) to move attributes from
template to product with not so much effort and make all the existing
code work without changes.

-- 
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/987e8b86-87f9-7905-2e42-a2e223e080e5%40koolpi.com.

Reply via email to