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
869 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 EmailTemplate(models.Model):
  8. _inherit = 'email.template'
  9. @api.model
  10. def get_email_template_batch(self, template_id=False, res_ids=None):
  11. if template_id and res_ids and self.env.context.get('force_lang'):
  12. template = self.env['email.template'].with_context(
  13. lang=self.env.context['force_lang']).browse(template_id)
  14. return dict.fromkeys(res_ids, template)
  15. else:
  16. return super(EmailTemplate, self).get_email_template_batch(
  17. template_id=template_id, res_ids=res_ids)