odoo - odoo:不可能在 one2many 上使一条线不可见吗?
问题描述
我正在尝试根据字段filtre_project
(在 stock.picking 中)使一些行(one2many stock.move)不可见。
我尝试使用域作为:
<field name="move_lines" position="attributes">
<attribute name="domain">[('project_id','in',filtre_project and filtre_project[0] and filtre_project[0][2])]
</attribute>
解决方案
您不能在树/列表视图中有条件地隐藏字段,您可以不可见,但这应该针对所有数据而不是有条件地修复。
我不确定,但你可以通过使用不可见的上下文来实现这一点。
例子 :
<field name="department_id" invisible="context.get('invisible_department', True)"/>
推荐阅读
- python - 递归测试文件夹是否完全为空的最佳方法?
- python - 按部分拟合曲线 - lmfit Python
- python - 使用 HTML 中的 for 循环访问变量(python 烧瓶)
- python-2.7 - 包装函数的 __call__ 方法时确定 cProfile 中 __call__ 的来源
- angular - Angular 5 - 组件具有 MAT-AUTOCOMPLETE 的多个子组件正在减慢输入速度
- sql - SSMS SQL 编辑器工具栏灰显
- android - QML QtQuick controls2 和 Android 键盘自动大写
- python - 将熊猫数据帧转换为位图的更有效方法是什么?
- python-3.x - 向 python 列表的元素添加值时的奇怪行为
- jquery - 使用 jQuery 添加或删除类进行滚动导航