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

Attribute error in mail_thread and res_partner

By
Shiriru Kiriluksen
on 2/22/14, 1:29 PM 1,269 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!

0
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

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

0 follower(s)

Stats

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