Odoo Help

0

remove defaults values from inherited class?

By
Andrius Laukavičius
on 12/1/13, 10:35 AM 3,109 views

How can I remove/stop creating defaults values from inherited class?

For example I have this:

class A(orm.Model):
    _name = 'a.a'
    _columns = {
        'field1': fields.char('Field', size=64),
    }
    defaults = {
        'field1': 'Hello',
    }

class B(orm.Model):
    _inherit = 'a.a'
    #now how to remove to stop creating default value from A class?

Note. Of course I can't just simply delete that line from class A, because some other modules may depend on it.

0
Grover Menacho
On 12/1/13, 5:19 PM

You have to do this:

class B(orm.Model):
_inherit = 'a.a'
#now how to remove to stop creating default value from A class?
defaults = {
        'field1': None,
    }

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.

Register

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)

Stats

Asked: 12/1/13, 10:35 AM
Seen: 3109 times
Last updated: 3/16/15, 8:10 AM