我正在升级一个模块,允许从客户/供应商发票中挑选股票。这是一个下载的模块,用于网络11社区,我正在执行一次升级,以供网络15-企业使用。不幸的是,我总是在下面看到错误:
Traceback (most recent call last):
File "C:\Program Files\odoo-14\server\odoo\http.py", line 643, in _handle_exception
return super(JsonRequest, self)._handle_exception(exception)
File "C:\Program Files\odoo-14\server\odoo\http.py", line 301, in _handle_exception
raise exception.with_traceback(None) from new_cause
odoo.tools.convert.ParseError: while parsing file:/c:/program%20files/odoo-14/server/odoo/addons/invoice_stock_move/views/invoice_stock_move_view.xml:4
Error while validating view:
Element '<xpath expr="//field[@name='date_due']">' cannot be located in parent view
View error context:
{'file': 'c:\\program '
'files\\odoo-14\\server\\odoo\\addons\\invoice_stock_move\\views\\invoice_stock_move_view.xml',
'line': 2,
'name': 'Move Name',
'view': ir.ui.view(1053,),
'view.model': 'account.move',
'view.parent': ir.ui.view(545,),
'xmlid': 'customer_invoice_stock_move_view'}这是我的视图文件
<odoo>
<data>
<record id="customer_invoice_stock_move_view" model="ir.ui.view">
<field name="name">Move Name</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_stock_transfer" string="Transfer" type="object" class="oe_highlight"
attrs="{'invisible':[('origin', '!=', False)]}"/>
</xpath>
<xpath expr="//field[@name='date_due']" position="after">
<field name="picking_transfer_id"/>
<field name="invoice_picking_id" invisible="1"/>
</xpath>
<xpath expr="//field[@name='number']" position="before">
<div class="oe_button_box" name="button_box">
<button type="object"
name="action_view_picking" states="open,paid"
class="oe_stat_button" attrs="{'invisible':[('origin', '!=', False)]}"
icon="fa-truck">
<field name="picking_count" string="Shipment" widget="statinfo"/>
</button>
</div>
</xpath>
</field>
</record>
<record id="supplier_invoice_stock_move_view" model="ir.ui.view">
<field name="name">Move Name</field>
<field name="model">account.move</field>
<field name="inherit_id" ref="account.view_move_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="action_stock_receive" string="Receive" class="oe_highlight"
type="object" attrs="{'invisible':[('origin', '!=', False)]}"/>
</xpath>
<xpath expr="//field[@name='date_due']" position="after">
<field name="picking_type_id"/>
<field name="invoice_picking_id" invisible="1"/>
</xpath>
<xpath expr="//field[@name='number']" position="before">
<div class="oe_button_box" name="button_box">
<button type="object"
name="action_view_picking"
class="oe_stat_button" attrs="{'invisible':[('origin', '!=', False)]}"
icon="fa-truck">
<field name="picking_count" string="Shipment" widget="statinfo"/>
</button>
</div>
</xpath>
</field>
</record>
</data>
</odoo> 有人能帮我指出正确的方向吗。
发布于 2022-04-28 17:21:42
在后台:主仪表板>设置>技术设置>视图,以访问父视图:将自定义视图URL中的id替换为id : 545,这是parent_view的id,如错误消息'view.parent':ir.ui.view(545,)中所述
你的网址应该和这个类似:
yourdomain.com /web?#id=545&action=28&model=ir.ui.view&view_type=form
并查证:
(id=545)
中
https://stackoverflow.com/questions/72046903
复制相似问题