Search code examples
pythonodooodoo-10

Open a xml after clicking button in odoo 10


How do we open a new xml form in odoo 10 ? I want to open views/views.xml after logging in the system.

My LogIn_SignUp.xml:

    <record model="ir.ui.view" id="LogIn_form_view">
        <field name="name">Logging</field>
        <field name="model">studentmanagement.sinhvien</field>
        <field name="type">form</field>
        <field name="arch" type="xml">
            <form string="Logging">
                <group>
                    <field name="LienLac"/>
                    <field name="MatKhau" type="password"/>
                    <button string="Log In" type="object" name="Log_In"/>
                </group>
            </form>
        </field>
    </record>

function "Log_In()" in python : (If account and password match a record in database, a new form is opened

But it doesn't work: it not only does not change the page, but also inserts a row into the database studentmanagement.sinhvien! So I don't understand what happened!


Solution

  • You need to change the view_id of the dictionary you are returning to the id of your view, that is your_module_name.LogIn_form_view