python - how to view fields on my custom form in openerp? -
hi have created custom module in openerp 7. using eclipse in order run code. have put button on module open new form on clicking. button loading form there no fields present on form. not know wrong. plz guide me .
hopes suggestion
here xml
<?xml version="1.0" encoding="utf-8"?> <openerp> <data> <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"> <group> <field name="name" /> <field name="bdate" /> <button name="display" string="add field" type="object" class="oe_highlight" /> </group> </form> </field> </record> <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"> <group> <field name="name" /> <field name="bdate" /> </group> </form> </field> </record> <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 create new record. </p> <p>this test class developed learn openerp.</p> </field> </record> <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' /> </data> </openerp>
here python code
from osv import fields, osv import time class my_window(osv.osv): _name="my.window" _columns={ 'name':fields.char('name',size=64), 'bdate':fields.date('birthdate') } def display(self,cr,uid,ids,context=none): return { 'name':'formview', 'view_mode': 'form', 'view_type': 'form', 'res_id' : '2', # id of object redirected 'res_model': 'ir.actions.act_window', # object name 'type': 'ir.actions.act_window', 'target': 'new' # if want open form in new tab }
your res_model given wrong. please give 'from.view.form' please check following link method return value call form in openerp
Comments
Post a Comment