Odoo Help


Action window is blank in OpenERP 7

Saghir A. Khatri
on 7/18/13, 6:12 AM 3,826 views

i am trying to load action window using python class to Open ERP. i have created and installed module on OpenERP. in that module,a user clicks on button to fill some form fields. i am using action window to display fields. but when action window opens, no field is displayed.

here is my __init__.py

import mywin

here is my __openerp__.py

    'name':'form module',
        New Form Module

here is my mywin.py

from osv import fields, osv
import time

class my_window(osv.osv):

    def display(self,cr,uid,ids,context=None):
           return {
        'view_mode': 'form',
        'view_type': 'form',
        'res_id' : '2', # id of the object to which to redirected
        'res_model': 'ir.actions.act_window', # object name
        'type': 'ir.actions.act_window',
        'target': 'new' # if you want to open the form in new tab

here is my mywin_view.xml

<?xml version="1.0" encoding="UTF-8"?>
       <record model="ir.ui.view" id="from_view_form">
            <field name="name">from.view.form</field>
            <field name="model">my.window</field>
            <field name="arch" type="xml">
                <form string="Form" version="7.0">
                        <field name="name" />
                        <field name="bdate" />
                        <button name="display" string="Add Field" type="object"  class="oe_highlight" />

        <record model='ir.ui.view' id='2'>
            <field name="name">Form</field>
            <field name="model">my.window</field>
            <field name="arch" type="xml">
                <form string="Form" version="7.0">
                        <field name="name" />
                        <field name="bdate" />

       <record model='ir.actions.act_window' id='form_view_action'>
            <field name="name">Form</field>
            <field name="res_model">my.window</field>
            <field name="view_type">form</field>
            <field name="view_mode">tree,form</field>
            <field name="context">{}</field>
            <field name="help" type="html">
                <p class="oe_view_nocontent_create">
                    Click to create a new record.
                <p>This is a test class developed to learn Openerp.</p>

        <menuitem name="newforms" id="newforms_ID" sequence="110" />
        <menuitem name="newforms2" parent="newforms_ID" id="newforms2_ID" sequence="0" />
        <menuitem name="newforms3" parent="newforms2_ID" id="newforms3_ID" action='form_view_action' />

please let me know, what is wrong with my code. and why Action Window is all blank. Thanks in Advance



| 7 8 8
Thiruvananthapuram, India

Working as an Senior ODOO developer. http://in.linkedin.com/pub/remya-r/69/a23/298

On 7/19/13, 6:07 AM

menuitem name="newforms3" parent="newforms2_ID" id="newforms3_ID" action="form_view_action"

please change single quotes into double.

Saghir A. Khatri
On 7/22/13, 4:33 AM

i forgot to create view window in xml. my bad, Thanks for all the suggestions

On 3/11/15, 2:35 AM

i want to create new window with one textarea and button. without create model and form how to possible it ?

About This Community

This platform 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.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

0 follower(s)


Asked: 7/18/13, 6:12 AM
Seen: 3826 times
Last updated: 3/16/15, 8:10 AM