Skip to content

Instantly share code, notes, and snippets.

@nbessi
Created October 28, 2011 15:34
Show Gist options
  • Save nbessi/1322553 to your computer and use it in GitHub Desktop.
Save nbessi/1322553 to your computer and use it in GitHub Desktop.
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)
@xrg
Copy link

xrg commented Oct 28, 2011

in pg84-next (already)

class partner(osv.osv):
_inherit = 'res.partner'
_columns = {
'my_selection': fields.inherit(selection_extend=[('new_val', 'New Label')])
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment