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

AttributeError: 'NoneType' object has no attribute '_name'

By
Ashmsh.M
on 7/6/14, 6:16 AM 1,046 views

the following error occured while installing my own module.

OpenERP Server Error

Client Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\http.py", line 204, in dispatch File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\controllers\main.py", line 989, in load File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\controllers\main.py", line 975, in get_user_roots File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\session.py", line 42, in proxy File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\session.py", line 30, in proxy_method File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\session.py", line 103, in send Server Traceback (most recent call last): File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\web\session.py", line 89, in send File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\netsvc.py", line 296, in dispatch_rpc File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\service\web_services.py", line 626, in dispatch File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\osv.py", line 190, in execute_kw File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\osv.py", line 132, in wrapper File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\osv.py", line 199, in execute File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\osv.py", line 187, in execute_cr File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\mail\mail_group_menu.py", line 44, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 127, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 103, in _filter_visible_menus File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 502, in __getattr__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 405, in __getitem__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 3679, in read File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 3800, in _read_flat File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\fields.py", line 538, in get File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\mail\mail_group_menu.py", line 44, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 127, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 103, in _filter_visible_menus File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 502, in __getattr__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 405, in __getitem__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 3679, in read File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 3800, in _read_flat File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\fields.py", line 538, in get File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\mail\mail_group_menu.py", line 44, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 127, in search File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\openerp\addons\base\ir\ir_ui_menu.py", line 87, in _filter_visible_menus File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 502, in __getattr__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 484, in __getitem__ File "C:\Program Files (x86)\OpenERP 7.0-20140513-231308\Server\server\.\openerp\osv\orm.py", line 341, in __init__ AttributeError: 'NoneType' object has no attribute '_name'

my py file.

from openerp.osv import fields, osv

class src(osv.osv):
    _name = 'src.src'
    _columns = {
                    'src':fields.char('Source' ,size=32),
                    'dest':fields.char('Destination' ,size=32),
                    'rate':fields.float('Rate' ,size=32),
                    }
src()


 

 

in my xml file

<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
 
 <menuitem id="menu_source" name="Source" sequence="3"/>
  <menuitem id="menu_sub" name="Source/Destination" parent="menu_source" sequence="1"/>
  
      <record id="view_source_tree" model="ir.ui.view">
           <field name="name">src.src.tree</field>
           <field name="model">src.src</field>
          <!-- <field name="type">tree<field>-->
                       <field name="arch" type="xml">
                       <tree string="Source" version="7.0">
                          <field name="src"/>
                          <field name="dest"/>
                          <field name="rate"/>
                       </tree>
                      </field>
     </record>
     
     <record id="view_source_form" model="ir.ui.view">
                       
        <field name="name">src.src.form</field>
        <field name="model">src.src</field>
                 <field name="arch" type="xml">
                  <form string="view_source_form" version="7.0">
                      <field name="src"/>
                      <field name="dest"/>
                      <field name="rate"/>
                   </form>
                 </field>
      </record>
      <record id="action_source" model="ir.actions.act_window">
                <field name="name">source</field>
                <field name="res_model">src.src</field>
                <field name="view_type">form</field>
                <field name="view_mode">form,tree</field>
        </record>      
  
        
<menuitem name="Source Cost" action="view_source_form" id="menu_sources" parent="menu_sub" sequence="0"/>
 </data>
 </openerp>
  

I am workin on OpenErp v7.0   in Windows 7

 

 

0

Serpent Consulting Services Pvt. Ltd.

--Serpent Consulting Services Pvt. Ltd.--
4341
| 6 6 8
Gandhinagar, India
--Serpent Consulting Services Pvt. Ltd.--

Serpent Consulting Services Pvt. Ltd. Your Odoo/OpenERP Solution, just an email away!

Serpent Consulting Services Pvt. Ltd.
On 7/6/14, 8:41 AM

Ashmsh,

You should link an action to the menu, and you linked a form view.

<menuitem name="Source Cost" action="view_source_form" id="menu_sources" parent="menu_sub" sequence="0"/>

should be

<menuitem name="Source Cost" action="action_source" id="menu_sources" parent="menu_sub" sequence="0"/>

Thanks.

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: 7/6/14, 6:16 AM
Seen: 1046 times
Last updated: 3/16/15, 8:10 AM