尝试将模块从odoo 10迁移到odoo 12,但它向我显示了这个错误,似乎stock_account不存在。
raise ValueError('External ID not found in the system: %s' % xmlid)
odoo.tools.convert.ParseError: "External ID not found in the system: stock_account.view_picking_inherit_form2" while parsing /home/*/PycharmProjects/Odoo12/*/invoice_in_picking/views/stock_view.xml:37, near
<record id="view_picking_inherit_form3" model="ir.ui.view">
<field name="name">stock.picking.form.inherit3</field>
<field name="model">stock.picking</field>
<field name="inherit_id" ref="stock_account.view_picking_inherit_form2"/>
<field name="arch" type="xml">
<field name="move_lines" position="attributes">
<attribute name="context">{'default_invoice_state': invoice_state, 'address_in_id': partner_id, 'form_view_ref':'stock.view_move_picking_form', 'tree_view_ref':'stock.view_move_picking_tree', 'default_picking_type_id': picking_type_id, 'default_location_id': location_id, 'default_location_dest_id': location_dest_id}</attribute>
</field>
</field>
</record>
您收到的错误表明外部ID不存在。你得到这个错误是因为,虽然stock_account
模块仍然存在于Odoo 12中,但视图(view_picking_inherit_form2
)不存在。
您需要确定要从哪个Odoo 12视图继承 - 很可能是stock.view_picking_form
。
但是,您还需要查看该表单的内容,因为自Odoo 10以来已经发生了很多变化。例如,您尝试更改attributes
(move_lines
)的字段也不存在;它被move_ids_without_package
取代。
继承视图在12中或多或少相同,但在将任何视图内容迁移到Odoo 12之前,您需要问自己一些问题。