Code review comment for lp:~openerp-dev/openobject-server/7.0-opw-593029-msh

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

I don't think we should change the behavior of the translation system for callable selection fields:

- in the API, when we have static strings we translate them automatically, but when we have callables they are responsible for translating their result. This is the case for the message of _constraints for example: if static it is translated, if callable it is not.
- in many cases the callables will read data from the database (e.g. a list of records), and if the results need to be translated it will already be done (with correct context lang)
- when exporting translations, if we take all results from callables we will have a lot of invalid/incorrect values that will pollute the POT files

Instead the right thing to do would be to fix the callable to make it return translated values correctly:

        return [('public', _('All Users')),
                ('employees', _('Employees Only')),
                ('followers', _('Followers Only'))]

Thanks!

review: Disapprove

« Back to merge proposal