Help

How to choose form view used by many2one field in OpenERP V7 ?

Closed
Avatar
Jeudy Nicolas

The question has been closed

by
Jeudy Nicolas
on 07/23/2013 13:39:27

Hi all,

I would like to select a particular form (with context or something like that) to edit many2one entry of an object.

For example, I have a many2one field partner_id that is link to res.partner, and I want to edit this entry in a simple form (name, phone, email) and not have all standard form.

I try :

<field name="partner_id">
    <form>
    <field name="name"/> ....
    </form>
</field>

and :

<field name="partner_id" context="{'ref_form_view': view_id_of_my_form}"/>

Any Idea ?

Avatar
Discard
2 Answers
9
Avatar
Jeudy Nicolas
Best Answer

Ok I find it:

<field name="partner" context="{'form_view_ref':'mymodule.my_xmlid_partner_form'}"/>

you have to pass mymodule.xmlid_name_of_view, else it does not work. Think it should be helfull for others,

Avatar
Discard
0
Avatar
Aristóbulo Meneses
Best Answer

Hello, 

I'm trying to do the same but with res.users object, so this is my field

<field name="user_id" context="{'form_view_ref':'base.view_users_form'}"/>

But it doesn't load base.view_users_form it loads base.view_users_simple_form, any ideas?

Avatar
Discard