Hello Everyone,
I also faced the same issue with odoo v12 enterprise, with python message there was trouble in translation.
Here what is did that has solved my problem:
Explaining with sample message that i will translate in Spanish.
Note : I'm considering you have already exported .po file for your language.
Consider module name is : anil_test_translate
and .py file name : test_translate.py which is inside models folder.
1. Added warning message like this :
from odoo.exceptions import UserError
from odoo import api, fields, models, _
your_proble_exist = True
test_val = "SO12345"
warning_message =_("Hello Anil, My problem Solved, Thank you.")
if your_proble_exist:
raise UserError(_('%s %s')% (warning_message,test_val))
2.. Added Entry for the message in .po file like this :
#. module: anil_test_translate
#: code:addons/anil_test_translate/models/test_translate.py:6
#, python-format
msgid "Hello Anil, My problem Solved, Thank you."
msgstr "Hola Anil, mi problema resuelto, gracias."
I hope this will solve you translation problem if you are facing an error on warning message :
Cheers!
Anil