[FIX] installation os before choose odoo version

This commit is contained in:
Mathieu Benoit 2024-11-23 23:32:11 -05:00
parent 7b5a3294ac
commit e08b402f3a
2 changed files with 26 additions and 20 deletions

View file

@ -57,6 +57,7 @@ cd ERPLibre
Support Ubuntu 20.04, 22.04, 24.04 and OSX. The installation duration is more than 30 minutes. Support Ubuntu 20.04, 22.04, 24.04 and OSX. The installation duration is more than 30 minutes.
```bash ```bash
make install_os
make install_odoo_16 make install_odoo_16
``` ```

View file

@ -423,14 +423,12 @@ class Update:
os.rename(addons_path, addons_path + "TEMP") os.rename(addons_path, addons_path + "TEMP")
# TODO need to be force if installation path is all good, return True # TODO need to be force if installation path is all good, return True
if self.config.is_in_installation: if self.config.install_dev:
_logger.info("Installation.") _logger.info("Installation.")
status = self.install_erplibre( status = self.install_erplibre()
install_system=self.config.install,
install_dev=self.config.install_dev,
)
# Re-update if launch installation # Re-update if launch installation
if self.config.install_dev:
self._update_directory_to_link( self._update_directory_to_link(
VENV_FILE, self.expected_venv_name VENV_FILE, self.expected_venv_name
) )
@ -487,17 +485,16 @@ class Update:
return return
os.system("./.venv/bin/python ./script/ide/pycharm_configuration.py --init") os.system("./.venv/bin/python ./script/ide/pycharm_configuration.py --init")
def install_erplibre(self, install_system=False, install_dev=False): def install_erplibre(self):
status = 0
if install_system:
self.execute_log.append(f"System installation")
status = os.system("./script/install/install_dev.sh")
if install_dev and not status:
self.execute_log.append(f"Dev installation") self.execute_log.append(f"Dev installation")
status = os.system("./script/install/install_locally_dev.sh") status = os.system("./script/install/install_locally_dev.sh")
return status return status
def install_system(self):
self.execute_log.append(f"System installation")
status = os.system("./script/install/install_dev.sh")
return status
def update_link_file( def update_link_file(
self, self,
component_name, component_name,
@ -688,12 +685,20 @@ def main():
update.validate_version() update.validate_version()
_logger.info("Validate environment") _logger.info("Validate environment")
status = 0
if update.config.install_dev or update.config.is_in_switch:
status = update.validate_environment() status = update.validate_environment()
if update.config.force_install or not status: if update.config.install:
status = update.install_system()
if (
update.config.force_install
or update.config.install_dev
or update.config.is_in_switch
) and not status:
update.update_environment() update.update_environment()
update.print_log() update.print_log()
if update.config.is_in_installation: if update.config.install_dev:
# Update pycharm configuration # Update pycharm configuration
update.pycharm_update() update.pycharm_update()