Created
October 28, 2011 15:34
-
-
Save nbessi/1322553 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MYCONST = ('new_val', 'New Label') | |
class Partner(osv.osv): | |
"""My Stuff""" | |
_inherit = 'res.partner' | |
def __init__(self, pool, cursor): | |
"""Hack due to the lack of selection fields inheritance mechanism.""" | |
super(Partner, self).__init__(pool, cursor) | |
my_selection = self._columns['my_selection'].selection | |
if MYCONST not in my_selection: | |
my_selection.append(MYCONST) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
in pg84-next (already)
class partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'my_selection': fields.inherit(selection_extend=[('new_val', 'New Label')])
}