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 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...
随机推荐
- ecshop获取浏览器各个版本
<?php /** * 获得浏览器名称和版本 * * @access public * @return string */ function get_user_browser() { if (e ...
- Java生成缩略图Thumbnailator(转载)
转自(http://rensanning.iteye.com/blog/1545708) Thumbnailator 是一个为Java界面更流畅的缩略图生成库.从API提供现有的图像文件和图像对象的缩 ...
- web socket 心跳包的实现方案
web socket 心跳包的实现方案05/30/2010 现在网络环境错综复杂,socket心跳包是获得健康强壮的连接的有效解决方案,今天,我们就在web socket中实现心跳包方案,是的,尽管我 ...
- ural 1018 Binary Apple Tree(树形dp | 经典)
本文出自 http://blog.csdn.net/shuangde800 ------------------------------------------------------------ ...
- AndroidStudio 快捷键使用
经常使用快捷键使用搜集 1. Ctrl+D: 集合了复制和粘贴两个操作,假设有选中的部分就复制选中的部分.并在选中部分的后面粘贴出来,假设没有选中的部分.就复制光标所在的行.并在此行的以下粘贴出来. ...
- systemtap分析软raid io拆分问题
http://www.sysnote.org/2014/05/01/systemtap-analysis-mdraid-io/
- APUE16章的运行示例16-14
参考文章:http://blog.csdn.net/andyxie407/article/details/1672325 今天在运行在APUE第16章的16-14(客户端)和16-15(服务端)遇到了 ...
- UITableView beginUpdate和endUpdate使用的前提
转载地址:http://blog.csdn.net/vieri_ch/article/details/46893023 UITableView有两个方法,用于单元格动画变化的方法,beginUpdat ...
- xcode升级或者重新安装后不能编译的解决方法
昨天由于xcode有一些问题,因此进行了重新安装,结果安装好后进行编译,没有进行任何改动的代码出现了两个fatal error 查看错误信息为什么的header has allready build, ...
- CentOS LNMP安装phpMyAdmin
假设: 已经配置好LNMP环境,并且Nginx的网页目录在/usr/local/nginx/html 1.下载phpMyAdmin wget https://files.phpmyadmin.net/ ...