[FIX] base: update module list without translating fields

Install a database in some other language than en_US
In debug mode and in the app list viewer,
   you'll see that the apps field are translated into your language
Then do an "Update App List"
Reload your page

Before this commit, the Apps' field lost their translation
This was because when checking for any updated data for known modules,
the ORM fetched the translation automatically, and compared the old (translated)
value with the new (English) value from the manifest

After this commit, This operation doesn't make the translations to be lost,
because only english values are compared

OPW 1832796
closes #23910
closes #24091
This commit is contained in:
Lucas Perais (lpe)
2018-04-09 09:22:11 +02:00
parent 1735ac582c
commit 6ee5b6fd6f
+1 -1
View File
@@ -599,7 +599,7 @@ class Module(models.Model):
res = [0, 0] # [update, add]
default_version = modules.adapt_version('1.0')
known_mods = self.search([])
known_mods = self.with_context(lang=None).search([])
known_mods_names = {mod.name: mod for mod in known_mods}
# iterate through detected modules and update/create them in db