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.

1

error on custom module AttributeError: 'NoneType' ?

By
mirko lazzarini
on 8/23/13, 1:43 PM 2,746 views

When i install my module i obtain this error....

File "/usr/lib/pymodules/python2.6/openerp/modules/loading.py", line 256, in load_marked_modules loaded, processed = load_module_graph(cr, graph, progressdict, report=report, skip_modules=loaded_modules, perform_checks=perform_checks) File "/usr/lib/pymodules/python2.6/openerp/modules/loading.py", line 165, in load_module_graph init_module_models(cr, package.name, models) File "/usr/lib/pymodules/python2.6/openerp/modules/module.py", line 374, in init_module_models result = obj._auto_init(cr, {'module': module_name}) File "/usr/lib/pymodules/python2.6/openerp/osv/orm.py", line 3147, in _auto_init if dest_model._table != 'ir_actions': AttributeError: 'NoneType' object has no attribute '_table'

__openerp__

{ 'name': 'Project Management Extension', 'version': '0.1', 'author': 'xxx S.r.l.', 'website': '', 'category': '', 'sequence': 8, 'summary': '', 'images': [ ], 'depends': [ "project" ], 'description': [ "Project Management Extension"], 'data': [ 'qms_project_view.xml' ], 'installable': True, 'auto_install': False, 'application': True, }

vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:

qms_projects.py

import time import datetime

from openerp.osv import fields, osv from openerp.tools.translate import _

class Project(osv.osv): '''Project''' _name = "project.project" _inherit = 'project.project'

_columns = {
    'type_id': fields.many2one('project.type', string='Typology'),
    'legacy_project_code': fields.char('Project Code',size=250),
    'redmine_project': fields.char('Redmine project',size=250),
    'sales_order_id': fields.many2one('sale.order',string='Sale Order'),
    'purchases_order_ids': fields.many2one('purchase.order',string='Purchase Order'),
    'qms_documents_ids': fields. many2one('project.qms.document',string='Documents'),
}

Project()

class project_task_type(osv.osv): '''project_task_type''' _name = "project.task" _inherit = 'project.task'

_columns = {

    'qms_testing_approval': fields.many2one('project.qms.document', string='Approval Document'),

}

project_task_type()

class Project_Type(osv.osv): '''Project_Type''' _name = 'project.type'

_columns = {
    'name': fields.char('Project Code',size=250),
    'description': fields.text('Description'),
    'qms_code': fields.char('Qms Code',size=250),
    'active': fields.boolean('Active'),
}

Project_Type()

qms_project_view.xml

<openerp> <data>

<record model="ir.ui.view" id="edit_project"> <field name="name">project.project.form</field> <field name="model">project.project</field> <field name="type">form</field> <field name="inherit_id" ref="project.edit_project"/> <field name="arch" type="xml"> <field name="user_id" position="after"> <field name="type_id"/> <field name="sales_order_id"/> </field> <notebook> <page string="QMS">

                        <field name="legacy_project_code" string="Project code"/>
                    <field name="redmine_project" string="Redmine project" />

        </page>
    </notebook>
        </field>
   </record>

</data>

</openerp>

I've another problem... i can't output label in this layout

    <notebook>
        <page string="QMS">

                        <field name="legacy_project_code" string="Project code"/>
                    <field name="redmine_project" string="Redmine project" />

        </page>
    </notebook>

Could anyone help me?

3
Riyaj Pathan
On 8/24/13, 5:37 AM

this is a dependency issue. In your custom module, you have inherited class and added two many2one fields referring to "sale.order" and "purchase.order" but neither your custom module nor built-in project module depends on sale and purchase module. i.e. you are accessing class without having dependency.

Hope this helps.

thx have you solution about my second problem about output label in .xml?

mirko lazzarini
on 8/24/13, 8:16 AM
0
widiana juniar
On 7/1/14, 10:00 PM

I haved same issue, and fix when i try this solution , thanks for Riyaj and Thierry

0
huongcute
On 7/23/14, 12:45 AM

And you must add them in _openerp_.py : 'depends': [ "project", "sale", "purchase" ],

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: 8/23/13, 1:43 PM
Seen: 2746 times
Last updated: 3/16/15, 8:10 AM