我正在尝试编译一个模块,但它显示了这个错误
Element '<group name="sale_condition">' cannot be located in parent view
Error context:
View `product.template.only.form.view.marge`
[view_id: 1240, xml_id: n/a, model: product.template, parent_id: 560]
None" while parsing /home/PycharmProjects/account_invoice_margin/views/product_view.xml:4, near
<record id="product_template_only_form_view_marge" model="ir.ui.view">
<field name="name">product.template.only.form.view.marge</field>
<field name="model">product.template</field>
<field name="inherit_id" ref="stock.view_template_property_form"/>
<field name="arch" type="xml">
<group name="sale_condition" position="inside">
<label for="taux_marge" groups="account_invoice_margin.group_margin_security"/>
<div groups="account_invoice_margin.group_margin_security">
<field name="taux_marge" class="oe_inline"/>
</div>
<label for="marge_product" groups="account_invoice_margin.group_margin_security"/>
<div groups="account_invoice_margin.group_margin_security">
<field name="marge_product" class="oe_inline"/>
</div>
</group>
</field>
</record>
我了解该错误是由于父视图中没有的“sale_condition”引起的。您能否通过给我一个替代方案来帮助我,我可以在哪里添加此组以使其正常工作?知道我无法更改插件文件
这个具有“sale_condition”属性的组存在于 odoo 10 mais pas dans odoo 12 中。
<group name="sale_condition" string="Sale Conditions">
<label for="warranty" groups="stock.group_production_lot"/>
<div groups="stock.group_production_lot">
<field name="warranty" class="oe_inline"/> months
</div>
<label for="sale_delay"/>
<div>
<field name="sale_delay" attrs="{'readonly':[('sale_ok','=',False)]}" class="oe_inline" style="vertical-align:baseline"/> days
</div>