You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

20 lines
765 B

  1. # -*- coding: utf-8 -*-
  2. ##############################################################################
  3. # (c) 2015 Pedro M. Baeza
  4. # License AGPL-3 - See LICENSE file on root folder for details
  5. ##############################################################################
  6. from openerp import models, api
  7. class Report(models.Model):
  8. _inherit = 'report'
  9. @api.model
  10. def translate_doc(self, doc_id, model, lang_field, template, values):
  11. if self.env.context.get('force_lang'):
  12. obj = self.with_context(lang=self.env.context['force_lang'],
  13. translatable=True)
  14. else:
  15. obj = self
  16. return super(Report, obj).translate_doc(
  17. doc_id, model, lang_field, template, values)