Impacted versions:
Master branch, should by 12.0

Steps to reproduce:
Install a third party addon with localization po file in i18n folder, even loading translation manually, the translation won't work, The console reports error: Translation .... not found in reference pot, skipping.
Reverse the change of  "odoo/tools/translate.py" in this commit, the issue was gone.

Expected behavior:
The po translation works as before.



plurial = len(modules) > 1 and 's' or ''
        self.buffer.write(u"#. module%s: %s\n" % (plurial, ', '.join(modules)))
        if comments:
            self.buffer.write(u''.join(('#. %s\n' % c for c in comments)))
        code = False
        for typy, name, res_id in tnrs:
            self.buffer.write(u"#: %s:%s:%s\n" % (typy, name, res_id))
            if typy == 'code':
                code = True
        if code:
            
            self.buffer.write(u"#, python-format\n")
        msg = (
            u"msgid %s\n"
            u"msgstr %s\n\n"
        ) % (
            quote(pycompat.text_type(source)), 
            quote(pycompat.text_type(trad))
        )
        self.buffer.write(msg)
def trans_export(lang, modules, buffer, format, cr):