0

The action module takes as origin 'audit' audit module, when I try this code: in audit.py:

 class action(orm.Model):
 _inherit = "action"
 def __init__(self, pool, cr):
    """Add a new audit value"""
    return super(action, self).Origin_SELECTION.append(('audit', 'Audit'))

in action.py we have:

Origin_SELECTION=[('dysfunction','Dysfunction')]
origin_act = fields.Selection(Origin_SELECTION, 'Origin')

in the final selection field the 'audit' choice appeared 2 times.

Tessnim
  • 434
  • 9
  • 29
  • I don't think you're using `super` correctly. See ["How to use `super` in Python"](http://stackoverflow.com/questions/222877/how-to-use-super-in-python). – ChrisP Apr 19 '16 at 14:02

1 Answers1

0

Try with:

class my_model(orm.Model): _inherit = 'my.model'

def _type_selection(self, cr, uid, context=None):
    selection = super(my_model, self)._type_selection(cr, uid, context=context)
    selection.append(('special', 'Special'))
    return selection
mokiSRB
  • 1,132
  • 7
  • 16