Merge branch 'fix-estimate-workload' into 'main'

[FIX] getting url on apps.odoo.com

Closes #40

See merge request odoo-openupgrade-wizard/odoo-openupgrade-wizard!52
This commit is contained in:
LE GAL SYLVAIN 2024-02-06 00:42:09 +00:00
commit a878df2915

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