python-3.x - 在 odoo 中添加自定义列表视图的问题
问题描述
当我在我的 .xml 文件中添加我的列表视图代码时,此代码:
<odoo>
<data>
<record id="test_list_view" model="ir.ui.view">
<field name="arch" type="xml">
<tree string="Tests">
<field name="name"/>
<field name="last_seen"/>
</tree>
</field>
</record>
</data>
</odoo>
到这个文件:(estate_list_views.xml)
由于这个错误,我无法完善我的模块
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/home/hadi/Public/st/odoo/odoo/http.py", line 640, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "/home/hadi/Public/st/odoo/odoo/http.py", line 316, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing /home/hadi/Public/st/odoo/oca/estate/views/estate_list_views.xml:3, near
<record id="test_list_view" model="ir.ui.view">
<field name="arch" type="xml">
<tree string="Tests">
<field name="name"/>
<field name="last_seen"/>
</tree>
</field>
</record>
我遵循本教程,但没有任何描述,除非向我介绍 odoo 的免费视频教程
解决方案
我想你错过了型号名称试试这个:
<record id="test_list_view" model="ir.ui.view">
<field name="name">model.tree.view</field>
<field name="model">your.model.name</field>
<field name= "arch" type = "xml">
<tree string="Tests">
<field name="name"/>
<field name="last_seen"/>
</tree>
</field>
</record>
请参阅此内容以供参考。
推荐阅读
- react-native - 为什么 React Native FlatList 样式不随状态而变化
- c# - 尝试对井字游戏实施最小最大算法。我应该如何实现递归函数?
- java - Lambda 表达式不工作,被终止
- python - Python 3 可迭代的惰性块获取
- ruby-on-rails - 私有方法“active_for_authentication?” 要求 #
- excel - Excel.Application.Visibile 在 Office 2016 上不起作用
- javascript - mongodb - 按字段名称的值查询文档
- php - register_shutdown_function() 和 set_error_handler() 可以捕获相同的错误吗?
- node.js - ReferenceError: [client_secret] 未定义。nodejs 护照-fb
- postgresql - Hyperledger Iroha 没有连接到 postgres 数据库?