Community mailing list archives

community@mail.odoo.com

Re: search group by filter and display selection name

by
Sebastien Alix
- 11/03/2014 11:11:51
Hi,

The workaround is to add your 'organization' field on your tree view to 
display the user label on a group by, and optionaly set an invisible="1" 
on it if you don't want to display this information without group by.
i18n will work too.

Regards,


Le 03/11/2014 15:32, Maxim Litnitskiy a écrit :
> Hi all!
> Please look at this sample of code:
>
> ORGANIZATION_CHOICES= [
>      ('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:
> 
> 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
> ORGANIZATION_CHOICES= [
>      ('org1', 'Organization1'),
>      ('org2', 'Organization2'),
> ]
> But what about i18n in this case? group by will not be translated!
>
> Please advise.
>
> _______________________________________________
> Mailing-List: https://www.odoo.com/groups/community-59
> Post to: mailto:community@mail.odoo.com
> Unsubscribe: https://www.odoo.com/groups?unsubscribe
>

-- 
Sébastien ALIX
ABF Osiell