Odoo Help


Attribute error in mail_thread and res_partner

Shiriru Kiriluksen
on 2/22/14, 1:29 PM 1,617 views

Hello, I have custom module that is inherited from res_partner. Until I installed Social (mail) module everithing was fine, but when I installed it I cannot save any record in the database, unless records made in my custom module. When I try to create new record in Customers, or create a new company (modifying existing company is OK), the following error occurs:

Attribute Error: No field image found in record.browse(my_mudule_name, int)

The traceback reports an error in mail_thread.create() method and in res_partner module, but the error occurs with context "my_module_name"!!!

The strange thing is that I can CRUD records with my custom module withoot any errors and mail_thread correctly records all actions (saw the report log), but no create operations are possible in any base module (Address book, Products, etc.)....

Please, help me sort this out if anyone has been where I'm... Any suggestions are very appeciated!

Shiriru Kiriluksen
On 2/24/14, 10:03 AM

After debugging I figured out (or at least think so) where is the problem:

It turns out that mail_thread.py overrides create method in res_partner.py and therefore if you have inheritance of type _name & _table in your custom module it collects wrong ids - not from original res_partner table but from the inherited table of your custom module and throws an exception...

The workaround I decide to use is to change the inheritance type as to accommodate everything in the res_partner table. The only inconvenience I found so far is that now I need to make all my custom module views inherited from res_partner_view.xml in order to display data for my module correctly.

If someone know better way to achieve this without view inheritance, please drop me a line. Thanks to all, hope that this is useful.

I did it without view inheritance and it works as charm :)

Shiriru Kiriluksen
on 2/24/14, 4:06 PM

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.


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

0 follower(s)


Asked: 2/22/14, 1:29 PM
Seen: 1617 times
Last updated: 3/16/15, 8:10 AM