function field , store={}...
def _get_product_state(self,cr,uid,ids,fields,arg=None,context=None):
res={}
dic=dict( self.pool.get('product.product')._columns['state'].selection )
for sol in self.browse(cr,uid,ids,):
if sol.product_id.state in dic:
res[sol.id]=dic[sol.product_id.state]
else:
res[sol.id]='N/A'
return res
def _get_sol_by_product(self,cr,uid,ids,context=None):
sol_ids = self.pool.get('sale.order.line').search(cr,uid,[('product_id','in',ids),])
return sol_ids
_columns={
'product_state':fields.function(_get_product_state,arg=None, type='char', string='Product State',readonly=True, store={
'product.product': (_get_sol_by_product, ['state',], 20),
'sale.order.line': (lambda self, cr, uid, ids, c={}: ids, ['product_id'], 20),
}),
store={ 'model.name': ( function_return_ids, fieds_name_list, 20 ),}
when model.name's field(include by fields_name_list) change, the function_return_ids will return the ids ,
those ids will re-counter the function field and store it.
function field , store={}...的更多相关文章
- lucene中Field.Index,Field.Store详解
lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...
- 【转载】lucene中Field.Index,Field.Store详解
lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...
- lucene中Field.Index,Field.Store的一些设置
lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...
- Lucene.NET中Field.Index 和 Field.Store的几种属性的用法
转载自 http://blog.csdn.net/yja886/article/details/6612069 lucene在doc.add(new Field("content" ...
- Lucene——Field.Store(存储域选项)及Field.Index(索引选项)
Field.Store.YES或者NO(存储域选项) 设置为YES表示或把这个域中的内容完全存储到文件中,方便进行文本的还原 设置为NO表示把这个域的内容不存储到文件中,但是可以被索引,此时内容无法完 ...
- ES field store yes no 区别——可以设置为false,如果_source有的话
store By default, field values are indexed to make them searchable, but they are not stored. This me ...
- ES索引瘦身 禁用_source后需要设置field store才能获取数据 否则无法显示搜索结果
在默认情况下,开启_all和_source 这样索引下来,占用空间很大. 根据我们单位的情况,我觉得可以将需要的字段保存在_all中,然后使用IK分词以备查询,其余的字段,则不存储. 并且禁用_sou ...
- Lucene使用IKAnalyzer分词实例 及 IKAnalyzer扩展词库
文章转载自:http://www.cnblogs.com/dennisit/archive/2013/04/07/3005847.html 方案一: 基于配置的词典扩充 项目结构图如下: IK分词器还 ...
- 解决vue不相关组件之间的数据传递----vuex的学习笔记,解决报错this.$store.commit is not a function
Vue的项目中,如果项目简单, 父子组件之间的数据传递可以使用 props 或者 $emit 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...
随机推荐
- [置顶] MyEclipse下安装插件方法(properties文件编辑器Propedit为例)
网上流传了很多安装插件的方法.在这里我只讲解一种方法. 因为我认为这种方法有以下两个优点:第一.简单,方便安装:第二.对于自己安装的插件易于管理. 我的myeclipse版本号为10.5,操作系统为w ...
- mongodb基本概念解析
MongoDB 概念解析 不管我们学习什么数据库都应该学习其中的基础概念,在mongodb中基本的概念是文档.集合.数据库,下面我们挨个介绍. 下表将帮助您更容易理解Mongo中的一些概念: SQL术 ...
- XSS 简单理解
什么是XSS? XSS(Cross Site Scripting),即跨站脚本攻击,是一种常见于web application中的计算机安全漏洞.XSS通过在用户端注入恶意的可运行脚本,若服务器端对用 ...
- vijos1055 奶牛浴场
挺好的一道题呢 O(n^2)或者O(wh) #include<cstdio> #include<cstring> #include<cstdlib> #includ ...
- asp 验证
<% dim redirectUrl,checkState checkState=0 MyArray = Array("127","Feb"," ...
- winform设置DataGridView样式 (蓝色)
本文转载:http://www.cnblogs.com/hailexuexi/archive/2012/04/23/2466398.html 代码: #region DataGridVeiw Styl ...
- Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(Bundle) instead
“Avoid non-default constructors in fragments: use a default constructor plus Fragment#setArguments(B ...
- 【课程分享】Oracle数据库系统project师
对这个课程有兴趣的朋友能够加我的QQ2059055336和我联系 一.本课程是怎么样的一门课程 1.1.课程的背景 该课程是Oracle数据库系统project师培训课程 Oracle Databas ...
- [AngularJS + Webpack] Uglifying your JavaScript
Angular requires some careful consideration when uglifying your code because of how angular's depend ...
- 只有在配置文件中或 Page 说明会 enableSessionState 至 true 时刻,能够使用会话状态。另外,还要确保应用程序配置 // 段包含 System.Web.SessionSta
首先,弄清楚我们的目的,我的目标是验证用户登录.那是,Session["userName"]!=null 在ok该 起初,我是这么写的,结果给出,提示如果上述错误标题,在调查的很长 ...