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!
After debugging I figured out (or at least think so) where is the problem:
It turns out that
create method in
res_partner.py and therefore if you have inheritance of type
_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.
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
|Asked: 2/22/14, 1:29 PM|
|Seen: 1269 times|
|Last updated: 3/16/15, 8:10 AM|