Odoo Help


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.


ORM object has no attribute '_foreign_keys'

Sandro Regis
on 4/21/13, 5:15 PM 1,331 views

Hello people!

I am trying to install the training module and after solve some anoying bugs now i face this message:

/server/openerp/osv/orm.py", line 3067, in _auto_end
for t, k, r, d in self._foreign_keys:
AttributeError: 'training_course_job_rel' object has no attribute '_foreign_keys'

I did an inspect on orm.py file and i found the variable declared as follow:

"""- save in self._foreign_keys a list a foreign keys to create (see

    self._foreign_keys = []

In addition for _auto_end i found:

def _auto_end(self, cr, context=None):
    """ Create the foreign keys recorded by _auto_init. """
    for t, k, r, d in self._foreign_keys:
        cr.execute('ALTER TABLE "%s" ADD FOREIGN KEY ("%s") REFERENCES "%s" ON DELETE %s' % (t, k, r, d))
    del self._foreign_keys

But, while i am not an expert please could some friend explain to me what happens and how should i fix it?

Best regards,

Sandro Regis

which version are you working with? and what module are you installing? Because this does not look like a problem with orm but with a training module

on 4/21/13, 7:26 PM

Hello, I am using the 6.1 version and the module version available is 6.0 i catch it directly from the branch (/openobject-training/6.0/) trying to ensure obtain the lastest version.

I try to attach the module but my Karma has not enought points. =0/

Sandro Regis
on 4/22/13, 10:02 AM

Mustufa Rangwala (mra)

--Mustufa Rangwala (mra)--
Tiny ERP Pvt Ltd
| 2 1 4
Ahmedabad, India
--Mustufa Rangwala (mra)--

- Around 7+ years of strong experience in Odoo (Formerly OpenERP) which is world's largest Open Source Business Applications driven by CEO Fabien Pinckaers. - Played key role in developing and maintaining various Odoo Product modules and integrating them on Open Source ERP Environment. - Experience on Scrum methodology for project management - Experience in Team Building - Quick Start Implementations. - Worked on almost all versions (4.0, 5.0, 6.0, 6.1, 7.0, SAAS, Trunk(8.0)...) of Odoo (Formerly OpenERP) . Specialities: Odoo Business Process And OpenERP Implementation. Odoo Application Support and Maintenance. Odoo Technical & Functional Training. Business Process Mapping & Gap Analysis (Functional and Technical Analysis)

Mustufa Rangwala (mra)
On 4/24/13, 3:45 AM

Please check training modules which have been migrated from 6.0 to 6.1 (Not all) here: https://code.launchpad.net/~openerp-commiter/openobject-training/6.1

Hope this help.

Regards, Mustufa Rangwala

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

2 follower(s)


Asked: 4/21/13, 5:15 PM
Seen: 1331 times
Last updated: 3/16/15, 8:10 AM