Skip to Content
Menu
This question has been flagged

I tried to develop a simple module. But there is a error arise with it. Uncaught TypeError: viewclass is not a function.              http://localhost:8069/web/js/web.assets_backend/38f1c44:3143 If anyone know this error answer please. This is the xml code which I tried. 

<?xml version="1.0" encoding="UTF-8"?>

<openerp>

<data>

<menuitem name="Test module" id="menu_root_academy" sequence="50"/>

<menuitem name="General" id="menu_general" parent="menu_root_academy" sequence="10"/>

<!--<record id="" model="ir.ui.view">

<field name="name"></field>

<field name="model"></field>

<field name="arch" type="xml">

<form string="">

<sheet>

<group>

<field name="name"/>

</group>

</sheet>

</form>>

</field>

</record>-->

<record id="action_course" model="ir.actions.act_window">

<field name="name">courses</field>

<field name="res_model">test_module</field>

<field name="view_type">form</field>

<field name="view_mode">tree.form</field>

<field name="help" type="html">

<p class="oe_view_no_content_create" >create the first course</p>

</field>

</record>

<menuitem id="menu_course" parent="menu_general" action="action_course" sequence="10"/>

</data>

</openerp>



And this is the python code. 

from openerp.osv import osv

from openerp.osv import fields

class test_module(osv.osv):

_name = "test_module"

_discription = "test_modules"

_columns = {

'name' : fields.char('Name', size=64, required=True, select=True),

'discription' : fields.text('Discription'),

}

test_module

Avatar
Discard
Best Answer

Hi, Change your action record to this ->

			<record id="action_course" model="ir.actions.act_window">

<field name="name">courses</field>

<field name="res_model">test_module</field>

<field name="view_type">form</field>

<field name="view_mode">tree,form</field>

<field name="help" type="html">

<p class="oe_view_no_content_create" >create the first course</p>

</field>

</record>

The problem with your code is in this line ->

				<field name="view_mode">tree.form</field>

you just give dot(.) instead of comma(,) Corrected->

				<field name="view_mode">tree,form</field>

 Hope this helps.


Avatar
Discard
Author

Thank you Baiju KS. It really worked!

Related Posts Replies Views Activity
1
Nov 22
1704
1
Feb 21
6177
1
Jan 16
5330
2
Mar 15
3082
1
Mar 15
12454