Ir al contenido
Menú
Se marcó esta pregunta
3 Respuestas
265 Vistas

i am trying to put skill_ids field after the Quatation Template (sale_order_template_id) field but i am not able to locate it in views


<record id="view_sale_order_inherit" model="ir.ui.view">

<field name="name">Sale Order Inherit</field>

<field name="model">sale.order</field>

<field name="inherit_id" ref="sale.view_order_form"/>

<field name="arch" type="xml">

<xpath expr="//field[@name='partner_id']" position="after">

<field name="employee_id" />

</xpath>

<xpath expr="//field[@name='sale_order_template_id']" position="after">

<field name="skill_ids" widget="many2many_tags" options="{'color_field' : 'color'}" />

</xpath>

</field>

</record>


Element '<xpath expr="//field[@name=&#39;sale_order_template_id&#39;]">' cannot be located in parent view
View error context:

{'file': '/home/xxxx/xxxx/16.0/custom_modules/office_management/views/sale_order_inherit_views.xml',

'line': 2,

'name': 'Sale Order Inherit',

'view': ir.ui.view(1949,),

'view.model': 'sale.order',

'view.parent': ir.ui.view(805,),

'xmlid': 'view_sale_order_inherit'}



Avatar
Descartar
Autor Mejor respuesta

the error was resolved after i included 
sale_managment module in 
depends = ['base','sale_management']
in manifest file. 

Avatar
Descartar
Mejor respuesta

The field sale_order_template_id is actually defined on sale_order_form_quote in sale_management module, So inherit accordingly.

<record id="view_sale_order_inherit" model="ir.ui.view">

    <field name="name">Sale Order Inherit</field>

    <field name="model">sale.order</field>

    <field name="inherit_id" ref="sale_management.sale_order_form_quote"/>

    <field name="arch" type="xml">

        <xpath expr="//field[@name='sale_order_template_id']" position="after">

            <field name="skill_ids" widget="many2many_tags" options="{'color_field': 'color'}" />

        </xpath>

    </field>

</record>

Regard,

NIZAMUDHEEN MJ
Accurates

Avatar
Descartar
Autor

yes , you are right
but we can still use this in sale.view_order_form i didnt included sale_management in depends
so that's why i was getting these errors
later the error was resolved by just adding it in depends

Mejor respuesta

Hello, 

the field 'sale_order_template_id' not exist in this view ( try another exxisting field )

Avatar
Descartar