[FIX] getting url on apps.odoo.com

Fix #40
This commit is contained in:
Rémy Taymans 2024-02-05 16:14:06 +01:00
parent 372d797430
commit 38ac07c141

View File

@ -346,8 +346,20 @@ class OdooModule(object):
def get_odoo_apps_url(self): def get_odoo_apps_url(self):
logger.info("Searching %s in the Odoo appstore ..." % self.name) logger.info("Searching %s in the Odoo appstore ..." % self.name)
url = f"https://apps.odoo.com/apps/modules/14.0/{self.name}/" url = (
if requests.get(url).status_code == 200: f"https://apps.odoo.com/apps/modules/"
f"{self.analyse.initial_version}/{self.name}/"
)
try:
response = requests.get(url)
except requests.exceptions.RequestException as err:
logger.warning(
"Error when trying to get %s: %s",
url,
err,
)
return False
if response.status_code == 200:
return url return url
return False return False