This question has been flagged
1 Reply
2753 Views

anyone know how to put a method in domain act_window using functional field ? what's the different between fnct and fnct_search ? what should i put in both of them ?

i already read this documentation https://doc.odoo.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html/ but still confused. Thanks in advance

 

Avatar
Discard
Best Answer

fnct is the function to compute the value of the field. It returns a dictionary of {id: value} if multi=False or {id: {field: value}} if multi=True.

 

fnct_search is the function to get a search domain from a search query. The args parameter contains a search domain, which will normally contain something like [('your_field', '=', 'some_value')]. You are responsible for providing, as a result, a search domain for which that domain will be valid. A lot of search functions will simply return [('id', 'in', tuple(ids))], where ids are the ids of all the matching records.

Avatar
Discard