Skip to content

Instantly share code, notes, and snippets.

@simahawk
Created June 10, 2016 11:09
Show Gist options
  • Save simahawk/23c90416639ab2d3658a846ec6a57d46 to your computer and use it in GitHub Desktop.
Save simahawk/23c90416639ab2d3658a846ec6a57d46 to your computer and use it in GitHub Desktop.
odoo stuff
@api.model
def translate(self, term):
"""Load `term` translation."""
translations = self.env['ir.translation']
name = '' # can ben empty since we are passing the source = term
_type = 'code'
lang = self.env.context.get('lang')
return translations._get_source(name, _type, lang, source=term)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment