Skip to content

Commit

Permalink
♿️ Add Odoo Version to Dump Summary
Browse files Browse the repository at this point in the history
  • Loading branch information
joshkreud committed Dec 5, 2023
1 parent 00d74a1 commit d0c7e6f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/godoo_cli/commands/backup/dump.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import typer

from ...cli_common import CommonCLI
from ...helpers.odoo_files import odoo_bin_get_version
from ..db.connection import DBConnection

LOGGER = logging.getLogger(__name__)
Expand All @@ -28,6 +29,7 @@ def dump_instance(
db_port=CLI.database.db_port,
db_user=CLI.database.db_user,
db_password=CLI.database.db_password,
odoo_main_path=CLI.odoo_paths.bin_path,
conf_path=CLI.odoo_paths.conf_path,
):
"""Dump DB and Filestore into Folder"""
Expand Down Expand Up @@ -64,13 +66,18 @@ def dump_instance(

readme_path = Path(dump_path) / "README.md"
readme_path.unlink(missing_ok=True)

odoo_version = odoo_bin_get_version(odoo_main_path)

readme_content = f"""
# gOdoo Dump
SQL Dump and Filestore of gOdoo Instance.
## Metadata
- Odoo Version: {odoo_version.raw}
- Filestore: [{ datetime.fromtimestamp(filestore_target.stat().st_mtime)}]({filestore_target.relative_to(dump_path)})
- SQL Dump: [{ datetime.fromtimestamp(db_dump_target.stat().st_mtime)}]({db_dump_target.relative_to(dump_path)})
Expand Down

0 comments on commit d0c7e6f

Please sign in to comment.