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

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

By
tansadio
on 4/21/15, 8:31 PM 660 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

--zbik--
5941
| 6 4 7
Lodz, Poland
--zbik--


zbik
On 4/22/15, 4:01 AM

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

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: 4/21/15, 8:31 PM
Seen: 660 times
Last updated: 4/22/15, 4:01 AM