Odoo Help


Error in Inheritance of class html in osv/fields.py Python/openerp 7 ?

on 2/14/15, 7:30 AM 832 views

i want to inherit the class html and to redefine the methode _symbol_f(x) which is defined in osv/fields.py in html classe the definition of this calss is the following:

class text(_column):

_type = 'text'


class html(text):

_type = 'html'

_symbol_c = '%s'

def _symbol_f(x):

        if x is None or x == False:

            return None

return html_sanitize(x)

_symbol_set = (_symbol_c, _symbol_f)

i want to redefine the method _symbol_f(x), so i have created the class wiki_html in the file wiki_html.py like the following

from openerp.osv import fields, osv

class wiki_html(fields.html):

_type = 'html'

_symbol_c = '%s'

def _symbol_f(x):

if x is None or x == False:

        return None

return html_sanitize_h(x)

_symbol_set = (_symbol_c, _symbol_f)

and now i define a field like the following:

'demandes_description':wiki_html('Description demande'),

but i have always this error:

openerp.osv.orm: <class 'openerp.addons.....wiki_html'> type not supported!

please help !!


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

1 follower(s)


Asked: 2/14/15, 7:30 AM
Seen: 832 times
Last updated: 3/16/15, 8:10 AM