Reputation: 5495
I want to retrieve the name from product.template:
print self.env['product.template'].search([("id", "=", id), ]).name
How do I get translated name in ORM?
Upvotes: 1
Views: 586
Reputation: 1174
You can pass the language code in context to get specific product name in that language. Make sure that language has been loaded in your server before using it. I did some changes in your code to get the product name in German / Duetsch language.
print self.env['product.template'].with_context({'lang': 'de_DE'}).search([("id", "=", id)]).name
I hope this will help you. :)
Upvotes: 4