function field , store={}...

时间:2022-06-22 00:51:02
     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={}...的更多相关文章

  1. lucene中Field.Index,Field.Store详解

    lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...

  2. 【转载】lucene中Field.Index,Field.Store详解

    lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...

  3. lucene中Field.Index,Field.Store的一些设置

    lucene在doc.add(new Field("content",curArt.getContent(),Field.Store.NO,Field.Index.TOKENIZE ...

  4. Lucene.NET中Field.Index 和 Field.Store的几种属性的用法

    转载自 http://blog.csdn.net/yja886/article/details/6612069 lucene在doc.add(new Field("content" ...

  5. Lucene——Field.Store(存储域选项)及Field.Index(索引选项)

    Field.Store.YES或者NO(存储域选项) 设置为YES表示或把这个域中的内容完全存储到文件中,方便进行文本的还原 设置为NO表示把这个域的内容不存储到文件中,但是可以被索引,此时内容无法完 ...

  6. 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 ...

  7. ES索引瘦身 禁用_source后需要设置field store才能获取数据 否则无法显示搜索结果

    在默认情况下,开启_all和_source 这样索引下来,占用空间很大. 根据我们单位的情况,我觉得可以将需要的字段保存在_all中,然后使用IK分词以备查询,其余的字段,则不存储. 并且禁用_sou ...

  8. Lucene使用IKAnalyzer分词实例 及 IKAnalyzer扩展词库

    文章转载自:http://www.cnblogs.com/dennisit/archive/2013/04/07/3005847.html 方案一: 基于配置的词典扩充 项目结构图如下: IK分词器还 ...

  9. 解决vue不相关组件之间的数据传递----vuex的学习笔记,解决报错this.$store.commit is not a function

    Vue的项目中,如果项目简单, 父子组件之间的数据传递可以使用  props 或者 $emit 等方式 进行传递 但是如果是大中型项目中,很多时候都需要在不相关的平行组件之间传递数据,并且很多数据需要 ...

随机推荐

  1. UNDER THE HOOD OF THE NEW AZURE PORTAL

    http://jbeckwith.com/2014/09/20/how-the-azure-portal-works/ So - I haven’t been doing much blogging ...

  2. jQuery.clean()方法源码分析(一)

    在jQuery 1.7.1中调用jQuery.clean()方法的地方有三处,第一次就是在我之前的随笔分析jQuery.buildFramgment()方法里面的,其实还是构造函数的一部分,在处理诸如 ...

  3. oracle断电重启之ORA-00600[4194]

    1.问题描述 Oracle服务器断电重启以后无法数据库无法正常连接,使用sqlplus envision/envision连接报错.常见的错误有以下这些: ORA-12518: TNS:listene ...

  4. 微信公众号 SDK

    <?php /* 方倍工作室 http://www.fangbei.org/ CopyRight 2015 All Rights Reserved */ define("TOKEN&q ...

  5. (object sender,EventArgs e)是什么?

    object sender:发出事件的对象 EventArgs e:对象中的数据

  6. C&num;正则表达式之字符替换

    string strTest= "www.BaiDu.com",strRst=""; //忽略大小写,将strTest中的BaiDu替换为baidu Regex ...

  7. Python面向对象——多重继承

    1本文的作用 一个从多个父类继承过来的子类,可以访问所有父类的功能. 2图文介绍 3代码验证 class Contact: all_contacts = [] def __init__(self, n ...

  8. pytho部分命令

    python --version查看版本号 pip install XXX 安装模块 pip uninstall XXX 卸载模块

  9. BZOJ2716 KD-Tree

    好久没写博客了 回去赶了好久文化课 颓欲见长 突然翻到fc爷的KD-Tree板子 来切了到裸题 对于一开始的数据我们可以先预处理 具体的排序方式见板子 其实就是我们对每次选定的一块选一个维度来排序啦 ...

  10. 如何利用启明星Portal门户系统的Page模块构建工作流表单

    启明星门户网站的Pages模块支持构建自定义表单系统.这使得对于使用表单收集用户数据的需求来说非常有用. 本文介绍如何构建一个简单的“出差系统”. 1.在页面里增加Pages模块,建立人事部部门,然后 ...