Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
3251 Vizualizări

i want to change some options of the field user_id in a purchase order but the following xml/xpath does not seem to work:

        <record model="ir.ui.view" id="purchase_order_extended_form">
            <field name="name">purchase.purchase_order_extended_form</field>
            <field name="model">purchase.order</field>
            <field name="inherit_id" ref="purchase.purchase_order_form" />
            <field name="arch" type="xml">
           
                <xpath expr="//field[@name='user_id']" position="attributes">
                        <attribute name="options">{'no_open': True,'no_create': True,'no_quick_create':True,'no_create_edit':True}</attribute>
                </xpath>
            </field>
        </record>


please give any hints whats wrong. i just want to remove the "Open" Icon next to the many2one field.

this


Imagine profil
Abandonează

make sure you have register this xml file into the __manifest__.py file.

Cel mai bun răspuns
hope this helps

<record model="ir.ui.view" id="purchase_order_extended_form">
<field name="name">purchase.purchase_order_extended_form</field>
<field name="model">purchase.order</field>
<field name="inherit_id" ref="purchase.purchase_order_form"/>
<field name="arch" type="xml">
<field name='user_id' position='replace'>
<field name="user_id" options="{'no_create': True, 'no_open': True}"/>
</field>
</field>
</record>
Imagine profil
Abandonează
Autor

it still shows the icon next to the field. it seems to ignore this options for the user_id field. for other fields it with the options attribute but not for user_id

Autor Cel mai bun răspuns

@Mitul Shingala: the xml is in the manifest. there are many other definitions within same file that work. only the user_id does not work

Imagine profil
Abandonează