Breaking News
Loading...
Saturday, 16 February 2013

AttributeError: 'NoneType' object has no attribute '_orm_template__view_look_dom_arc

2/16/2013 02:39:00 pm
Log:

Traceback (most recent call last):
  File "/opt/hnferp/server/bin/osv/osv.py", line 122, in wrapper
    return f(self, dbname, *args, **kwargs)
  File "/opt/hnferp/server/bin/osv/osv.py", line 176, in execute
    res = self.execute_cr(cr, uid, obj, method, *args, **kw)
  File "/opt/hnferp/server/bin/osv/osv.py", line 167, in execute_cr
    return getattr(object, method)(cr, uid, *args, **kw)
  File "/opt/hnferp/server/bin/osv/orm.py", line 1645, in fields_view_get
    xarch, xfields = self.__view_look_dom_arch(cr, user, result['arch'], view_id, context=ctx)
  File "/opt/hnferp/server/bin/osv/orm.py", line 1314, in __view_look_dom_arch
    fields_def = self.__view_look_dom(cr, user, node, view_id, context=context)
  File "/opt/hnferp/server/bin/osv/orm.py", line 1285, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, context))
  File "/opt/hnferp/server/bin/osv/orm.py", line 1285, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, context))
  File "/opt/hnferp/server/bin/osv/orm.py", line 1285, in __view_look_dom
    fields.update(self.__view_look_dom(cr, user, f, view_id, context))
  File "/opt/hnferp/server/bin/osv/orm.py", line 1223, in __view_look_dom
    xarch, xfields = relation.__view_look_dom_arch(cr, user, f, view_id, ctx)
AttributeError: 'NoneType' object has no attribute '_orm_template__view_look_dom_arch'


This error occurs when you specify the class name as follows

      class sample_class(osv.osv):
                _name="sample_class"
                 _columns= {
                            'name': fields.char('Name', size=128),
                 }
      sample_class()

This can be solved by replacing the class name as sample.class as follows
 
    class sample_class(osv.osv):
                _name="sample.class"
                 _columns= {
                            'name': fields.char('Name', size=128),
                 }
      sample_class()
    

0 comments:

Post a Comment

 
Toggle Footer