When a functional field is computed?

Asked by Damián Soriano

In OpenERP 6.1 I have a functional field in product that is displayed in it's tree view. When I see the tree view it takes a lot of time to display since it computes all the fields for all the products in the view and this is quite anoying.

Because of this I decided to put "store=True" on the function field so it will not recompute the values when I open the tree view. I also check that the values are stored in the database. Still, when I open the product tree view the values are recomputed once again. So I want to know when the function fields are computed in general? and when are computed with the "store=True" option.

Question information

Language:
English Edit question
Status:
Solved
For:
Odoo Server (MOVED TO GITHUB) Edit question
Assignee:
No assignee Edit question
Solved by:
Numérigraphe
Solved:
Last query:
Last reply:
Revision history for this message
Best Numérigraphe (numerigraphe) said :
#1

Your best move is to use store={...} instead of store=True, to indicate yourself when the value must be recalculated.
http://doc.openerp.com/v6.0/developer/2_5_Objects_Fields_Methods/field_type.html#store-parameter
Lionel Sausin.

Revision history for this message
Damián Soriano (damiansoriano) said :
#2

Thanks Numérigraphe, that solved my question.

Revision history for this message
Damián Soriano (damiansoriano) said :
#3

And which is the default?

Revision history for this message
Numérigraphe (numerigraphe) said :
#4

If you don't provide a store parameter the value is computed every time someone uses it (example: contextualized stock quantities). What store=True exactly does undocumented: you'll have to dig the server code, sorry.
Lionel.

Revision history for this message
Damián Soriano (damiansoriano) said :
#5

Thanks for the clarification =]