Impacted versions:

11.0 (saas)

Steps to reproduce:

- Create a simple module, ser version to 1.0
- Import it using odoo studio.
- Check the version (11.0.1.0)
- Change the version.
- Import it again (or even un-install it and install it again if you wish)

Current behavior:

- Version is yet 11.0.1.0

Expected behavior:

- Take the proper version from the module itself

Video/Screenshot link (optional):


addons/base_import_module/models/ir_module.py
if not module_file:
            raise Exception(_("No file sent."))
        if not zipfile.is_zipfile(module_file):
            raise UserError(_('File is not a zip file!'))
        success = []
        errors = dict()
        module_names = []
        with zipfile.ZipFile(module_file, "r") as z:
            for zf in z.filelist:
                if zf.file_size > MAX_FILE_SIZE:
                    raise UserError(_("File '%s' exceed maximum allowed file size") % zf.filename)
            with tempdir() as module_dir:
                import odoo.modules.module as module
                try:
                    module.ad_paths.append(module_dir)
                    z.extractall(module_dir)
                    dirs = [d for d in os.listdir(module_dir) if os.path.isdir(opj(module_dir, d))]
                    for mod_name in dirs:
                        module_names.append(mod_name)
                        try:
                            
                            path = opj(module_dir, mod_name)
                            self._import_module(mod_name, path, force=force)
                            success.append(mod_name)
                        except Exception as e:
                            _logger.exception('Error while importing module')
                            errors[mod_name] = exception_to_unicode(e)
                finally:
                    module.ad_paths.remove(module_dir)
        r = ["Successfully imported module '%s'" % mod for mod in success]