gpt4 book ai didi

xml - 重新启动 odoo-bin 时出现 odoo.tools.convert.ParseError

转载 作者:行者123 更新时间:2023-12-02 18:22:47 25 4
gpt4 key购买 nike

我正在学习开发者教程 here .

我已将两个操作按钮添加到 TreeView 中。

一切正常,直到我将 button 标记添加到 XML view 后重新启动服务器。然后我收到以下错误:

Traceback (most recent call last):
File "/home/keith/src/odoo/odoo/service/server.py", line 1246, in preload_registries
registry = Registry.new(dbname, update_module=update_module)
File "/odoo/modules/registry.py", line 87, in new
odoo.modules.load_modules(registry, force_demo, status, update_module)
File "/odoo/modules/loading.py", line 470, in load_modules
processed_modules += load_marked_modules(cr, graph,
File "/odoo/modules/loading.py", line 363, in load_marked_modules
loaded, processed = load_module_graph(
File "/odoo/modules/loading.py", line 222, in load_module_graph
load_data(cr, idref, mode, kind='data', package=package)
File "/odoo/modules/loading.py", line 69, in load_data
tools.convert_file(cr, package.name, filename, idref, mode, noupdate, kind)
File "/odoo/tools/convert.py", line 745, in convert_file
convert_xml_import(cr, module, fp, idref, mode, noupdate)
File "/odoo/tools/convert.py", line 811, in convert_xml_import
obj.parse(doc.getroot())
File "/odoo/tools/convert.py", line 731, in parse
self._tag_root(de)
File "/odoo/tools/convert.py", line 691, in _tag_root
raise ParseError(msg) from None # Restart with "--log-handler odoo.tools.convert:DEBUG" for complete traceback
odoo.tools.convert.ParseError: while parsing /custom/estate/views/estate_property_offer_views.xml:3
Invalid view estate.property.offer.tree (estate.estate_property_offer_view_tree) definition in estate/views/estate_property_offer_views.xml

View error context:
'-no context-'

如果我删除按钮标签,服务器启动时不会出现错误(./odoo-bin --addons-path=../custom,addons -d rd-demo -u Estate --dev xml)。

然后我可以重新添加按钮并且它们可以正常工作,但是一旦我重新启动服务器,我就会再次收到错误。

以下是 View 的完整记录:

    <record id="estate_property_offer_view_tree" model="ir.ui.view">
<field name="name">estate.property.offer.tree</field>
<field name="model">estate.property.offer</field>
<field name="arch" type="xml">
<tree string="Offers">
<field name="price"/>
<field name="partner_id"/>
<field name="validity"/>
<field name="date_deadline"/>
<field name="state"/>

<button name="action_accept" type="object" icon="fa-check" style="color:green" states="new"/>
<button name="action_refuse" type="object" icon="fa-close" style="color:red" states="new"/>

</tree>
</field>
</record>

最佳答案

删除tree view上按钮的样式

<button name="action_refuse" type="object" icon="fa-close"  states="new"/>

style 属性仅适用于 buttontree architecture,您可以使用 基于类

带有类:

    <button name="action_refuse" type="object" icon="fa-close"  states="new" class="btn-primary my_class"/> <!--my_class your custom class  -->

关于xml - 重新启动 odoo-bin 时出现 odoo.tools.convert.ParseError,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70652196/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com