Skip to content

Commit

Permalink
🌈 add a comment about how to control all the databases, while keeping…
Browse files Browse the repository at this point in the history
… /web/database/manager page hidden
  • Loading branch information
trojikman committed May 10, 2021
1 parent 3f16436 commit 2c068c3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion odoo_backup_sh/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -212,4 +212,4 @@ Further information
Odoo Apps Store: https://apps.odoo.com/apps/modules/13.0/odoo_backup_sh/


Tested on `Odoo 12.0 <https://github.com/odoo/odoo/commit/483b6024cd44fcc6e2b987505beb739014b51856>`_
Tested on `Odoo 13.0 <https://github.com/odoo/odoo/commit/fafea72843e25e0fee091ca935df61edb9133f6f>`_
7 changes: 6 additions & 1 deletion odoo_backup_sh/models/odoo_backup_sh.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ class BackupConfig(models.Model):

@api.model
def _compute_database_names(self):
# Uncomment the following line if you want to control all the databases while keeping /web/database/manager page hidden
# return [(db, db) for db in odoo.service.db.list_dbs(force=True)]
if odoo.tools.config["list_db"]:
return [
(db, db) for db in odoo.service.db.list_dbs() if db != "session_store"
Expand Down Expand Up @@ -631,8 +633,11 @@ def get_dump_stream_and_info_file(self, name, service, ts):
if config_record.backup_simulation:
dump_stream = tempfile.TemporaryFile()
else:
# Comment following line and uncomment next few lines if you want control all the databases, while keeping /web/database/manager page hidden
dump_stream = odoo.service.db.dump_db(name, None, "zip")

# from unittest.mock import patch
# with patch.dict(odoo.tools.config.options, {'list_db': True}):
# dump_stream = odoo.service.db.dump_db(name, None, "zip")
if config_record.encrypt_backups and config_record.backup_simulation is False:
# GnuPG ignores the --output parameter with an existing file object as value
backup_encrpyted = tempfile.NamedTemporaryFile()
Expand Down

0 comments on commit 2c068c3

Please sign in to comment.