odoo_record_backup
Capture a full field snapshot of Odoo records as JSON before destructive operations for potential rollback.
Instructions
Read full field snapshot of one or more records (any model) and return as a JSON structure. Use BEFORE destructive operations to capture state for possible rollback. Returns a dict with metadata (date, connection alias, model, ids, field count) plus the records themselves. Does NOT write to disk — caller decides what to do with the JSON.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| connection | No | default | |
| model | Yes | Odoo model (e.g. 'mrp.production') | |
| ids | Yes | Record IDs to snapshot | |
| include_related | No | Optional list of related queries. Each: {model, domain, fields}. Example: [{model: 'stock.move', domain: [['raw_material_production_id', 'in', <mo_ids>]], fields: [...]}] (use placeholders manually). |