Odoo Help

0

I get an error when I inherited res_company to add an image field

By
tansadio
on 4/21/15, 8:31 PM 915 views


from openerp.osv import fields, osv

class res_company(osv.osv):

_name = "res.company"

_inherit= 'res.company'

_columns = {

'image_rib': fields.binary('RIB'),

}

res_company()

This code give me error:

File "/home/tansadio/odoo-8.0/base/openerp/api.py", line 241, in wrapper

return old_api(self, *args, **kwargs)

File "/home/tansadio/odoo-8.0/base/openerp/api.py", line 336, in old_api

result = method(recs, *args, **kwargs)

File "/home/tansadio/odoo-8.0/base/openerp/models.py", line 2991, in _setup_fields

field.setup(self.env)

File "/home/tansadio/odoo-8.0/base/openerp/fields.py", line 410, in setup

self._setup_related(env)

File "/home/tansadio/odoo-8.0/base/openerp/fields.py", line 456, in _setup_related

field = recs._fields[name]

KeyError: 'partner_id'

Can you give me a hand ?

Thanks for advance.

0
Zbik
On 4/22/15, 4:01 AM

Try to delete the line  _name = "res.company"

About This Community

This platform 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.

Register

Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

1 follower(s)

Stats

Asked: 4/21/15, 8:31 PM
Seen: 915 times
Last updated: 4/22/15, 4:01 AM