Community mailing list archives

search group by filter and display selection name

Maxim Litnitskiy
- 11/03/2014 09:28:33
Hi all!
Please look at this sample of code:

    ('1', 'Organization1'),
    ('2', 'Organization2'),

class res_partner(models.Model):
    _name = 'res.partner'
    _inherit = 'res.partner'

    organization = fields.Selection(ORGANIZATION_CHOICES, string=_('Organization'))

Now when I add a filter:
<filter string="Organization" context="{'group_by' : 'organization'}" />
I can group records in tree view but it displays integers not names.
See the screenshot attached.
Is there a way to display choices names not values or I have to redefine ORGANIZATION_CHOICES like 
    ('org1', 'Organization1'),
    ('org2', 'Organization2'),
But what about i18n in this case? group by will not be translated!

Please advise.