Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
2722 Widoki

Hi All,

i'm just migrating from 17 to 18 and code that's works in 17. Now returns warning 

odoo.tools.translate: no translation language detected, skipping translation


I have my own class for bank export that not inherit from model. This is how my class looks like any idea what I should add or change? 

from odoo import _

class ExportBankFormat:

def __init__(self, batch):
self.batch = batch
Awatar
Odrzuć
Najlepsza odpowiedź

Hi Stanislav

Try to change

from odoo import _

class ExportBankFormat:
a = _("my text") # find rows with "_("

to

from odoo.tools.translate import _, LazyTranslate
_lt = LazyTranslate(__name__, default_lang='en_US')

class ExportBankFormat:
a = _lt("my text") # change "_(" to "_lt("
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
1
sty 25
1602
2
maj 25
849
1
maj 25
1226
2
kwi 25
2020
1
maj 25
2254