[FIX] base: field monetary lose context of t-lang

In monetary field refactoring (3407fb70e4) there was a small issue that
made context lost so the language use to render the field could be
different from the one to render the view.

For example: if the user has english, and print a report using the lang
of a partner in language spanish, the report would use spanish to format
number for all fields but monetary (which would use english).

opw-708197
This commit is contained in:
Nicolas Lempereur
2017-04-05 14:49:03 +02:00
parent 0ac2ca9b14
commit dff2cf3ca1
+1 -1
View File
@@ -340,7 +340,7 @@ class MonetaryConverter(models.AbstractModel):
if not options.get('display_currency') and field.type == 'monetary' and field.currency_field:
options['display_currency'] = record[field.currency_field]
return self.value_to_html(record[field_name], options)
return super(MonetaryConverter, self).record_to_html(record, field_name, options)
TIMEDELTA_UNITS = (
('year', 3600 * 24 * 365),