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 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...
随机推荐
- php判断是不是ajax访问
<?php // php 判断是否为 ajax 请求 if(isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strto ...
- 如何解决 SogouIinput not enough space for thread data ?? 虚拟内存
问题:总是提示没有足够的空间读写数据 上图: 原因: 可能是虚拟内存设置了过大了[我不知道明白是不是也是这样,我出现这个问题就是因为我把虚拟内存设置成了4G,我的物理内存是2G的] 具体问题具体分析, ...
- Kruskal算法模拟讲解
Kruskal 算法是一个求最小生成树的算法,即求最小的开销等 算法可以这样,要求得最小生成树,那么n个节点只能包括n-1条边 所以我们应该转换为寻找这最短的n-1条边,因此,可以先对所有的 边进行从 ...
- python装饰实现线程同步
import threading def tryfinally(finallyf): u"returns a decorator that adds try/finally behavi ...
- android 45 通知
package com.sxt.day07_01; import android.app.Activity; import android.app.Notification; import andro ...
- Hive数据导入
可以通过多种方式将数据导入hive表 1.通过外部表导入 用户在hive上建external表,建表的同时指定hdfs路径,在数据拷贝到指定hdfs路径的同时,也同时完成数据插入external表. ...
- python版本简历
- jquery parseInt()的问题
对于parseInt("01")到parseInt("07");都能得到正确的结果,但如果是parseInt("08") 或parseInt ...
- 响应式WEB设计
近期在学习有关响应式设计的内容,对此做了些整理,图片来源于网络,附上自己做的简单demo,没有js,只用CSS做了简单的搭建http://y.zhso.net/. 1.为什么需要响应式web设计 出于 ...
- NC V6 nchome文件目录及其作用介绍
NC V6发布一段时间了,各个NC6.0 nchome文件夹下各个子文件夹内容和作用 ant:存放Apache Ant,用来执行EJB的构建. bin: 存放nc部署和系统监控等命令.configsy ...