I have the next field:
cost_method = fields.Selection([ ('fixed', 'Fixed Price'), ('calculation', 'Based on Work Effort'), ('warranty', 'Warranty'), ('noinvoice', 'No invoicing') ], 'Cost Method')
I also want that field on the report, so I added
<record.cost_method> to the report. It works, but I got the first entry from the tuple (
calculation, …) instead of the second one. So I created a small function and moved the data of the selection to a global
@classmethod def _get_cost_method(cls, method): return dict(COST_METHOD)[method]
It works, I get the second entry of the tuple. But now translation isn’t working. Before I start any further, am I on the right path? Or is there another possibility to get the right translated data from the selection?