OpenERPfields.function()的说明 [英] OpenERP fields.function() explanation

查看:55
本文介绍了OpenERPfields.function()的说明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我从stock.py文件和行号163获得了此代码

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.

我们可以将fields.function(与type ='many2one'一起使用吗? 如果可以的话,请给我提供参考样本代码或openerp 7中的样本模型类.

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将字段的值存储在数据库中.一旦存储,则功能字段功能将不再执行.

'store'=True will store the value of the field in database. Once stored then the functional fields function will not be executed again.

但是如果'store'的值是一个字典,则(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:-()在指定为字典的键的模型中进行的任何更改/更新都将在元组中指定的id中进行更改或更新.在列表中指定的字段名称中,然后将加载功能字段的功能并将新数据保存在数据库中

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

这篇关于OpenERPfields.function()的说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆