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

Module development

By
Avini Wanigasinghe
on 10/19/15, 3:46 AM 432 views

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

1

Baiju

--Baiju--
3154
| 5 4 8
Kochi, India
--Baiju--
ODOO technical and functional

        I like learning new thing, especially technical thing. I am a quick learner, I can learn technical things very fast. I have good logical skill,  I have immense interest in programming.

e-mail id : baijuks@hotmail.com

Baiju
On 10/19/15, 4:16 AM

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.


Thank you Baiju KS. It really worked!

Avini Wanigasinghe
on 10/19/15, 4:35 AM

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: 10/19/15, 3:46 AM
Seen: 432 times
Last updated: 10/19/15, 5:30 AM