当我将我的列表视图代码添加到我的.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>
我遵循this教程,但那没有任何说明,除非介绍给我一个免费的视频教程
发布于 2021-08-10 09:51:33
我想你错过了模型的名字,试试这个:
<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>
有关参考,请参阅this。
https://stackoverflow.com/questions/68711929
复制相似问题