- android - 多次调用 OnPrimaryClipChangedListener
- android - 无法更新 RecyclerView 中的 TextView 字段
- android.database.CursorIndexOutOfBoundsException : Index 0 requested, 光标大小为 0
- android - 使用 AppCompat 时,我们是否需要明确指定其 UI 组件(Spinner、EditText)颜色
' cannot be located in parent view-6ren"> ' cannot be located in parent view-我在 python 代码 bom.py(请参见下文)中创建了一个计算字段,并将该字段添加到 View bom_view.xml 中。字段名称是“old_default_code”,python 代码中-6ren">
我在 python 代码 bom.py(请参见下文)中创建了一个计算字段,并将该字段添加到 View bom_view.xml 中。字段名称是“old_default_code”,python 代码中的关联函数是_old_default_code()。但是,当我尝试更新(刷新)模块时出现错误:
"Error details: "Field `old_default_code" does not exist"
我做错了什么?
这是来自 bom.py 的代码片段:
class mrp_bom(osv.osv):
_inherit = 'mrp.bom'
def _old_default_code(self, cr, uid, ids, name, arg, context=None):
return True
_columns = {'x_roll_material': fields.float('Standard Material Cost', digits=(16, 4), readonly=True),
'x_bom_time_average': fields.float('Average BOM Lead Time', digits=(16, 4), readonly=True),
'x_bom_time_last': fields.float('Last BOM Lead Time', digits=(16, 4), readonly=True),
'old_default_code' : fields.function(_old_default_code, type='char', size=32, method=True, store=False, multi=False) }
这是 XML 代码:
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<!-- mrp_bom -->
<record id="adamson_mrp_bom_form_view" model="ir.ui.view">
<field name="name">adamson.mrp.bom.form.view</field>
<field name="model">mrp.bom</field>
<field name="type">form</field>
<field name="inherit_id" ref="mrp.mrp_bom_form_view" />
<field name="arch" type="xml">
<field name="old_default_code" />
<xpath expr="//notebook/page[@string='Components']/field/tree[@string='Components']/field[@name='sequence']" position="before" >
<button class="oe_inline oe_stat_button" type="object" string="Go!" icon="gtk-go-forward" name="action_go"
attrs="{'invisible':[('old_default_code','=', False)]}" />
</xpath>
最佳答案
当您继承 View 时,这意味着您可以将字段引用到父 View 中存在的元素。
您在此处显示的 View ,因为您试图直接放置字段 old_default_code
而不引用现有字段。
例如,当您通过继承将新字段放入模型时,然后在 View 中您需要引用父 View 中存在的字段并使用具有以下值的选项 position
'after', 'before', 'attributes',您可以定位您新添加的字段。
在这里,您试图直接放置字段 old_default_code
,因此尝试在父 View 中找到该字段,但该字段不存在,因此您面临错误。
关于python - 错误 : Element '<field name="x y z">' cannot be located in parent view,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27626242/
我正在尝试在 python 中编写正则表达式来查找目录路径:我的文本如下所示: text = "The public disk is: \\\\diskA\\FolderB\\SubFolderC\\
我想写一个LocationListener,它把最近最精确的位置作为它的位置。我打算在我的 LocationListener 中使用此代码: @Override public void
我想建立一个有光泽和 plotly 的交互式图表。 Shiny 有一个内置功能来获取有关用户交互的信息。比如:input$plot_click、input$plot_dblclick、input$pl
我正在使用 MobileFirst 提供的 WL.Device.Geo.acquirePosition(onGeoLocationSuccess, onGeoLocationFailure, opti
我最近开始使用 ionic 框架,它里面有 angular js。为了在屏幕之间导航,我使用了 $location.path 并且效果很好。但是,在我下载的一个示例中,我看到 $state.go 被用
谁能解释一下这种行为?我使用 history.pushState(null, null, '#test'); 推送历史状态。然后,当尝试使用console.log(window.location.ha
这里是相关代码: https://www.facebook.com/sharer/sharer.php?u={{$location.absUrl()}} https://www.facebook.c
这两个重定向之间有什么区别?我有一个应用程序,当我使用时,它可以在 chrome 和 android 4 上正常工作,但在 android 2.x.x 上不能正常工作 document.locatio
JavaScript 的区别是什么 window.location.href = window.location.href 和 window.location.reload() 功能? 最佳答案 如果
有什么区别 window.location.href="http://example.com"; window.location.replace("http://example.com"); wind
JavaScript 的区别是什么 window.location.href = window.location.href 和 window.location.reload() 功能? 最佳答案 如果
以下 3 个指令之间有区别吗? location ~* \.(png)$ { expires max; log_not_found off; } location ~ \.(png)$ {
位于正文末尾之前的以下脚本在 Internet Explorer 和 Chrome(以及任何其他浏览器)中都会被调用。但重定向到指定的 URL 仅发生在 IE 中。我还尝试了 window.locat
我正在使用 Angular ngRouter。我需要更改 url 路径以及搜索参数。我知道 $location.path 和 $location.search,但是有没有一个函数可以同时设置它们? 最
在angularjs中用$location和window.location哪个更好。 例如,我们可以使用$location.path() 或window.location.href 来完成同样的工作。
我在我的网站上使用上述 2 个命令。似乎它们对 95% 访问它应该触发的页面的人有效,但对其他人则不会。 有谁知道是否可以完全阻止这些 javascript 命令?我真的很头疼为什么它们有时不起作用。
这是我无法弄清楚的另一个错误。 我有这个类ExtendedLocation extends Location实例化时抛出 ClassCastExceptioncurrentGpsLocation =
我一直在尝试简单地将一个包含两个变量(一个字符串和一个位置)的类推送和读取到 firebase,但我一直收到此错误。 **com.google.firebase.database.DatabaseEx
我注意到 iPhone 上的“常用位置”似乎比监控 iOS 访问的应用程序 (https://developer.apple.com/reference/corelocation/clvisit) 使
在我的 javascript 代码中,在某些时候,我需要刷新窗口(用户上传了新图片但在页面中仍然可以看到它) 我想知道为什么 location.href = location.href 不刷新窗口?
我是一名优秀的程序员,十分优秀!