I got this code from stock.py file and line number 163
'complete_name': fields.function(_complete_name, type='char', size=256, string="Location Name",
store={'stock.location': (_get_sublocations, ['name', 'location_id'], 10)}),
please give me a explanation about below store attribute in above field.
can we use fields.function(
with type='many2one' ?
if can please give me a reference sample code or sample model class in openerp 7
'store'=True will store the value of the field in database. Once stored then the functional fields function will not be executed again.
But if the value of 'store' is a dictionary then (key of the dictionary will be a model name and value will a tuple with list of ids, list of field name and 10-i dont know:-(
) any change/update in the model specified as the key of the dictionary and change/ update is in the ids specified in the tuple and change or update is in the field names specified in the list then the function of the functional field will be loaded and new data will be saved in database
You can get information about fields.function
from here:
You can find many examples in addons.
Hope this will help you.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With