Thanks Cédric for your response. > if it is stored, it is no more a function field :-) Yes i agree but i'd like to search records with that field whitch is not possible if a function field (depending on my experiences), moreover sometimes i like to store in the database to do some complexe reporting attacking directly the database.
> And finally, I find it is simpler to create a real field and update it when > needed by overriding the create and write functions of each models that are > linked to the field computation. It seems interesting ! do you have a example of a sutch implementation. I have tried to update a real filed with function field but the data do not synchronize correctly. >> PS: this kind of discussion should go on tryton-dev. Yes i agree, no it is too late for this post, next time ill remember it. On 12 oct, 08:58, Cédric Krier <[email protected]> wrote: > On 11/10/09 18:18 -0700, Salim wrote: > > > > > Hi, > > I have one question regarding storing a function field on database. > > how could i do that ? > > Am not talking a bout writing in a function field but persist its > > content on the database. is there a argument like (store=True) for > > instance ? > > There is no strore=True because: > > - if it is stored, it is no more a function field :-) > - implementing this (like OpenERP) make things more difficult and increase the > bug probability (desynchronisation of data). If there is a bug in the > mecanism, you don't know which data needs to be recomputed. > - it needs an mecanism to force the re-computation of function field that > needs to run on every write/create and looks to every fields if it needs to > recompute. The way OpenERP handles this is not easy to override. > > And finally, I find it is simpler to create a real field and update it when > needed by overriding the create and write functions of each models that are > linked to the field computation. > > PS: this kind of discussion should go on tryton-dev. > > -- > Cédric Krier > > B2CK SPRL > Rue de Rotterdam, 4 > 4000 Liège > Belgium > Tel: +32 472 54 46 59 > Email: [email protected] > Jabber: [email protected] > Website:http://www.b2ck.com/ > > application_pgp-signature_part > < 1 000AfficherTélécharger --~--~---------~--~----~------------~-------~--~----~ [email protected] mailing list -~----------~----~----~----~------~----~------~--~---
