Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Enter in a specific form without passing through a tree.

By
mathieu
on 2/6/14, 11:24 AM 562 views

Hi! I would like to have a link in the menu where the user can click on it and enter directly in his form. Now, when the user click on the menu link, he's thrown to a new form, not his form. I want to do this because there is only one record available by user.

Is it possible to specify the id of the form or is tree view is mandatory ?

tank you

There is my code:

<record id="view_parcours_fiche_form" model="ir.ui.view">
            <field name="name">Ma fiche</field>
            <field name="model">persons</field>
            <field name="type">form</field>
            <field name="arch" type="xml">
                <form string="Persons" version="7.0">
                    <sheet>
                        <div>
                            <h1>
                                <field edit="false" default_focus="1" name="firstname"
                                    placeholder="Prénom" style="width: 40%%"/>
                                <field name="lastname"
                                    placeholder="Nom de famille" style="width: 40%%"/>
                            </h1>
                        </div>
                        <group>
                            <field name="phone1"
                                placeholder="1-888-123-8888" style="width: 50%%"/>
                            <field name="phone2"
                                placeholder="1-888-123-8888" style="width: 50%%"/>
                            <field name="email" style="width: 50%%"/>
                        </group>
                    </sheet>
                </form>
            </field>
        </record>

 <record id="action_parcours_fiche_seq" model="ir.actions.act_window">
            <field name="name">Ma fiche</field>
            <field name="res_model">persons</field>
            <field name="view_mode">form</field>
            <field name="view_type">form</field>
            <field name="domain">[('user_id','=',uid)]</field>
        </record>

<record id="action_parcours_fiche_form" model="ir.actions.act_window.view">
            <field eval="2" name="sequence"/>
            <field name="view_mode">form</field>
            <field name="view_id" ref="view_parcours_fiche_form"/>
            <field name="act_window_id" ref="action_parcours_fiche_seq"/>
        </record>
<menuitem
            action="action_parcours_fiche_seq"   id="menu_students"
            name="Ma fiche"   parent="section_main_menu"    sequence="2"
            groups="group_parcours2_etudiants"
            />

Do you have the field 'user_id' in model 'persons' set to the right user?

Seems like the window action domain is filtering all existing records.

René Schuster
on 2/6/14, 11:58 AM

Yes, when i'm adding tree view, user can see only one record, if he click on it he can see his record. If I remove the domain, the result is the same..

mathieu
on 2/6/14, 12:29 PM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/6/14, 11:24 AM
Seen: 562 times
Last updated: 3/16/15, 8:10 AM