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 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...
随机推荐
- Java GC 专家系列5:Java应用性能优化的原则
本文是GC专家系列中的第五篇.在第一篇理解Java垃圾回收中我们学习了几种不同的GC算法的处理过程,GC的工作方式,新生代与老年代的区别.所以,你应该已经了解了JDK 7中的5种GC类型,以及每种GC ...
- nyoj 239 月老的难题【匈牙利算法+邻接表】
月老的难题 时间限制:1000 ms | 内存限制:65535 KB 难度:4 描述 月老准备给n个女孩与n个男孩牵红线,成就一对对美好的姻缘. 现在,由于一些原因,部分男孩与女孩可能结成幸福 ...
- Linux的定时任务
分两种:一次性的定时任务.周期性的定时任务. 一次性的定时任务,又称at定时任务,命令为atd ,这里d是deamon的首字母,守护的意思,指守护进程:其实很多程序都是以d结尾,如httpd.memc ...
- php判断是不是ajax访问
<?php // php 判断是否为 ajax 请求 if(isset($_SERVER["HTTP_X_REQUESTED_WITH"]) && strto ...
- JAVA IO详解
[案例1]创建一个新文件 1 2 3 4 5 6 7 8 9 10 11 import java.io.*; class hello{ public static void main(Stri ...
- 一个可视化的retrospective网站
IdeaBoardz - Brainstorm, Retrospect, Collaborate是一个可视化的retrospective,brainstorm的网站,比较简单易用,可以导出pdf和ex ...
- my.cnf已经存在,影响安装--mysql
Found existing config file ./my.cnf on the system. Because this file might be in use, it was not rep ...
- Unix网络编程代码 第13章 守护进程和inetd超级服务器
1. 概述 守护进程是在后台运行且不与任何控制终端关联的进程.unix系统通常有很多守护进程在后台运行,执行不同的管理任务. 守护进程没有控制终端通常源于它们由系统初始化脚本启动.然而守护进程也 ...
- Xcode6 viewDidLoad 中View的subviews 为空
Xcode 6 中勾选using size Classes 方法,在ViewDidLoad 方法中调用outlet 的一个myView.subviews 会为空,而myView 不会为空. stor ...
- C语言循环的嵌套
注:参考网络资源拟制,如雷同请见谅循环的嵌套:一个循环体语句中又包含另一个循环语句,称为循环嵌套.嵌套注意事项:1.使用循环嵌套时,内层循环和外层循环的循环控制变量不能相同.2.循环嵌套结构的书写,最 ...