Hi,

Here's my small problem in Tryton 4.2, i want to filter products on a 
specific product category. I define those category as a property in a 
configuration.

My code is here: https://pastebin.com/wDF8qGtX

So in my main class (PrinterModel), i define a function field on product 
category to get the default category stored in configuration... 
(printer_category).

This function field is used in my domain for the product to get only 
products from a specific category (and children too)  (printer_model field)

My code wasn't working until i define a default_printer_category... code is 
redundant but it's working.

My question: is it necessary to use a function field for the domain or can 
i evaluate a function in domain ? If not, how to avoid code redundancy for 
default_ method and get_ method for the function field ? 
Is there a better way to implement this "filter" ? i'm looking for examples 
in code but unsuccessfully.

Thanks for help!


-- 
You received this message because you are subscribed to the Google Groups 
"tryton-dev" group.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/tryton-dev/04e9f629-df6f-4e0d-b4b9-77f0f88aad19%40googlegroups.com.

Reply via email to