[FIX] new project missing odoo_conf

This commit is contained in:
Mathieu Benoit 2023-12-02 14:13:18 -05:00
parent addb636042
commit 5f7090489e
2 changed files with 11 additions and 3 deletions

View file

@ -57,6 +57,11 @@ def get_config():
required=True,
help="Module name to create",
)
parser.add_argument(
"--odoo_config",
default="./config.conf",
help="Odoo config path",
)
parser.add_argument(
"--config",
help="""Configuration to create models with fields and type. JSON style.
@ -116,12 +121,14 @@ class ProjectManagement:
keep_bd_alive=False,
coverage=False,
config="",
odoo_config="./config.conf",
):
self.force = force
self._coverage = coverage
self.keep_bd_alive = keep_bd_alive
self.msg_error = ""
self.has_config_update = False
self.odoo_config = odoo_config
self.module_directory = module_directory
if not os.path.exists(self.module_directory):
@ -522,7 +529,7 @@ class ProjectManagement:
os.system(cmd)
# Validate
if not os.path.exists(template_path):
if not os.path.exists(module_path):
_logger.error(f"Module not exists '{module_path}'")
return False
else:
@ -532,7 +539,7 @@ class ProjectManagement:
def update_config(self):
config = configparser.ConfigParser()
config.read("./config.conf")
config.read(self.odoo_config)
addons_path = config.get("options", "addons_path")
lst_addons_path = addons_path.split(",")
lst_directory = list(
@ -579,6 +586,7 @@ def main():
keep_bd_alive=config.keep_bd_alive,
coverage=config.coverage,
config=config.config,
odoo_config=config.odoo_config,
)
if project.msg_error:
return -1

View file

@ -8,7 +8,7 @@
git daemon --base-path=. --export-all --reuseaddr --informative-errors --verbose &
DAEMON_PID=$!
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_DEV}
./.venv/repo init -u git://127.0.0.1:9418/ -b $(git rev-parse --verify HEAD) -m ${EL_MANIFEST_DEV} "$@"
./.venv/repo sync -v --force-sync -m ${EL_MANIFEST_DEV}
kill ${DAEMON_PID}