[FIX] base_import_module: fix missing field name in non-debug mode
Before this commit, the website of the industry module ends with `/False`. This is because the website of the module requires the name of the module. It is therefore added in the _get_modules_from_apps method. closes odoo/odoo#152078 Signed-off-by: Pierre Masereel (pim) <pim@odoo.com>
This commit is contained in:
@@ -318,6 +318,8 @@ class IrModule(models.Model):
|
||||
|
||||
@api.model
|
||||
def _get_modules_from_apps(self, fields, module_type, module_name, domain=None, limit=None, offset=None):
|
||||
if 'name' not in fields:
|
||||
fields = fields + ['name']
|
||||
payload = {
|
||||
'params': {
|
||||
'series': major_version,
|
||||
@@ -334,7 +336,7 @@ class IrModule(models.Model):
|
||||
resp.raise_for_status()
|
||||
modules_list = resp.json().get('result', [])
|
||||
for mod in modules_list:
|
||||
module_name = mod.get('name', module_name)
|
||||
module_name = mod['name']
|
||||
existing_mod = self.search([('name', '=', module_name), ('state', '=', 'installed')])
|
||||
mod['id'] = existing_mod.id if existing_mod else -1
|
||||
if 'icon' in fields:
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
<field name="inherit_id" ref="base.module_tree"/>
|
||||
<field name="arch" type="xml">
|
||||
<xpath expr="//field[@name='category_id']" position="after">
|
||||
<field name="module_type" invisible="1"/>
|
||||
<field name="module_type" column_invisible="1"/>
|
||||
</xpath>
|
||||
</field>
|
||||
</record>
|
||||
|
||||
Reference in New Issue
Block a user