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

Adding custom field while inheriting mail.thread

By
Nat Gimenez
on 5/4/16, 3:29 AM 496 views

 I'm trying to add a new field in mail.thread in order to have tags in it.

I've created a new module, named myTaggedMailThread :

from openerp.osv import osv

from openerp import api, fields, models

class myTaggedMailThread(models.Model):

   _inherit = 'mail.thread'

   _name='mail.thread'

   _columns = {

       'current_tags': fields.Text('current_tags', help="Tags", default='test current tags')

   }

   #current_tags = fields.Text('current_tags', help="Tags", default=' test current tag ')

myTaggedMailThread ()

But I get an error when lauching my odoo instance :

File "/opt/myOdoo/app/openerp/field.py", line 343, in __getattr__

    return self._attrs[name].

RuntimeError : maximum recursion depth exceeded

Can someone explain what I'm doing wrong please ?

2

Akhil P Sivan

--Akhil P Sivan--
3423
| 5 3 6
Kochi, India
--Akhil P Sivan--

Interested in exploring Odoo both technically & functionality wise.

email-id : akhilpsivan01@gmail.com

Akhil P Sivan
On 5/4/16, 5:10 AM

Hi,

You have mixed the api's in field definition. I think, that could be the problem.

Try like this in your py file:

from openerp import models, fields, api

class myTaggedMailThread(models.Model):

    _inherit = 'mail.thread'

current_tags = fields.Text(string= 'current_tags', help="Tags", default='test current tag')

Hope this helps

Hello Nat, I tried akhil's code, It work for me. Thanks @ Akhil +1

Ankit H Gandhi(AHG)
on 5/4/16, 6:50 AM

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: 5/4/16, 3:29 AM
Seen: 496 times
Last updated: 5/4/16, 5:10 AM