| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 1551 |
| Technical Name |
db_table_safety |
| License | OPL-1 |
| Website | https://tuplesinc.com |
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
Discuss (mail)
|
| Lines of code | 1551 |
| Technical Name |
db_table_safety |
| License | OPL-1 |
| Website | https://tuplesinc.com |
Database Table Drop Safety
Two-phase table drop protection for Odoo 19. Automatically backs up your data before module uninstalls, intercepts DROP TABLE commands, and lets you restore everything with a single click.
Odoo 19 Community + Enterprise PostgreSQL Event TriggersSee It In Action
▶ Watch Full Demo VideoFull walkthrough: install, create data, uninstall, restore, and verify
Key Features
Everything you need to protect your database from accidental data loss
|
🛡
Silent InterceptionDROP TABLE commands are intercepted via PostgreSQL event triggers. Tables with data are backed up automatically. |
📦
Pre-Uninstall SnapshotsFull table snapshots are taken before module uninstall strips columns, preserving all your data with complete schema. |
🔄
One-Click RestoreRestore backed up data with intelligent column matching. Handles schema changes between backup and restore. |
|
🔒
Authenticated DeletionPermanent deletion requires password re-authentication or system PIN. Every attempt is logged. |
📝
Full Audit TrailEvery action is logged: who dropped what, when, restore attempts, permanent deletions, and blocked actions. |
⚙
Settings PageConfigure authorized users, safety PIN, email notifications, and enable/disable protection from Settings. |
01. How It Works
When a module is uninstalled (or a table is manually dropped), DB Table Safety intercepts
the operation and creates a full backup of the table data in a protected
deleted_tables PostgreSQL schema. Empty tables (wizards, relation tables)
are skipped automatically. Only tables with actual data are backed up.
02. Before: Your Data
You have products, customers, and a sale order in the system. Everything is working fine.
|
|
|
|
Products, customers, and a sale order with order lines before uninstall
03. Module Uninstalled
The Sales module is uninstalled. Without DB Table Safety, all sale orders, order lines, and related data would be permanently lost. With our module installed, the data is silently backed up before anything is deleted.
|
|
Sales module gone. But your data is safe in the backup schema.
Deleted Tables view showing all backed up tables with record counts and state
04. Restore Your Data
Reinstall the module, then click Restore. If the table already exists (module reinstalled), you'll see a warning showing how many current rows will be replaced. If the table doesn't exist yet, the backup is moved back directly.
|
|
Delete and Restore (table exists) vs Confirm Restore (table doesn't exist)
|
|
Sale order fully restored with all data. Backup marked as "Restored".
05. Full Audit Trail
Every action is recorded in the Audit Log: soft deletes during uninstall, restores by administrators, permanent deletions, and blocked attempts. Track who did what, when, and whether it was approved - all from a single view with filters and grouping.
Audit Log showing soft deletes, restores, with user tracking and status badges
06. Configuration
Configure the module from Settings. Enable/disable protection, set a safety PIN for permanent deletions, choose authorized users, and toggle email notifications.
07. Clean Dashboard
When no tables have been dropped, the Deleted Tables view shows a clean empty state. The module runs silently in the background until it's needed.
08. Tested and Verified
27 automated tests covering every scenario. All passing.
27 Tests 27 Passed 0 Failed
| Category | What We Test | What It Means | Status |
|---|---|---|---|
| Setup | Backup schema created | The protected storage area is ready the moment you install | PASS |
| Event trigger active | The database-level interceptor is watching for DROP TABLE commands | PASS | |
| Drop Interception | Table with data backed up | Tables containing your data are saved instead of destroyed | PASS |
| Empty tables skipped | Wizard and system tables with no data are dropped normally | PASS | |
| No duplicate backups | Dropping the same table multiple times doesn't create redundant copies | PASS | |
| Missing table handled | Attempting to back up a nonexistent table fails gracefully | PASS | |
| Audit | Every action logged | Who did what, when, and whether it succeeded - always recorded | PASS |
| Restore | Table gone - recreated | If the table was removed, it's recreated from the backup | PASS |
| Table exists - replaced | If module was reinstalled, old data replaces new data cleanly | PASS | |
| ID sequence synced | New records get correct IDs and sequence numbers after restore | PASS | |
| Schema changes handled | Columns added or removed since backup - restore still works | PASS | |
| Corrupt backup detected | Incomplete backups show a clear error instead of breaking your DB | PASS | |
| FK Constraints | Referenced tables restored | Tables linked to invoices, orders, etc. restore without FK errors | PASS |
| Auth | Correct password accepted | Authorized users can delete backups with their login password | PASS |
| Wrong password blocked | Incorrect password is rejected, backup stays safe | PASS | |
| Correct PIN accepted | System PIN works as an alternative to password | PASS | |
| Wrong PIN blocked | Incorrect PIN is rejected, backup stays safe | PASS | |
| Safety | Active backups protected | Can't accidentally delete a backup while it's still active | PASS |
| Restored records cleanable | After restore, tracking records can be cleaned up | PASS | |
| Related Tables | Batch links tables | Tables dropped together are grouped as related | PASS |
| No batch, no related | Standalone backups show no related tables | PASS | |
| Restore with related | "Also Restore Related" restores all sibling tables in one click | PASS | |
| Restore without related | Unchecking restores only the selected table | PASS | |
| System | Bypass flag works | Internal operations can bypass protection when authorized | PASS |
| Core models skipped | System tables are never unnecessarily backed up | PASS | |
| Row count accurate | UI count matches actual backed up rows | PASS | |
| Restored shows zero | After restore, count shows 0 (data moved back) | PASS |
Need Help?
If you encounter any errors, issues, or unexpected behavior during installation, configuration, or restore operations, please do not hesitate to reach out. We are here to help and will respond as quickly as possible.
support@tuplesinc.comOdoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module