[IMP] fields: add mechanism to extend a selection field
authorRaphael Collet <rco@openerp.com>
Thu, 10 Jul 2014 20:04:03 +0000 (22:04 +0200)
committerRaphael Collet <rco@openerp.com>
Wed, 6 Aug 2014 13:20:07 +0000 (15:20 +0200)
commite95fc488dbc668932f0f8f8b2223d752c4745347
treea9924e33fda29f15e0107b26587b09a8fee049d4
parentdc9bcf479de49ece90bb4df97045c877e5a0e437
[IMP] fields: add mechanism to extend a selection field

If a selection field is defined by a list as selection, such as:

    state = fields.Selection([('a', 'A'), ('b', 'B')])

one can extend it by inheritance by redefining the field, as:

    state = fields.Selection(selection_add=[('c', 'C')])

The result is that the selection field will have the list
[('a', 'A'), ('b', 'B'), ('c', 'C')] as selection.
openerp/addons/test_inherit/models.py
openerp/addons/test_inherit/tests/test_inherit.py
openerp/fields.py