5.3 KiB
Template Deletion Guide
Quick Reference: Deleting Custom Certificate Templates
Overview
This guide explains how to delete custom certificate templates from surveys and revert to default template options.
When to Delete a Template
You might want to delete a custom certificate template when:
- You no longer need custom certificates for a survey
- You want to switch back to Odoo's default certificate templates
- You need to start fresh with a new template design
- The template is outdated or incorrect
How to Delete a Template
Step-by-Step Instructions
-
Navigate to Survey
- Go to Surveys app
- Open the survey with the custom certificate template
-
Locate Delete Button
- Scroll to the "Certification" section
- Find the "Delete Custom Certificate" button
- The button appears only when:
- Certification Report Layout = "Custom Template"
- A custom template is configured
-
Delete Template
- Click "Delete Custom Certificate" button
- Confirm deletion in the dialog box
- Wait for success notification
-
Verify Deletion
- Custom certificate fields are cleared
- Certification Report Layout is reset
- You can now select default templates
What Gets Deleted
When you delete a custom certificate template, the following data is removed:
Cleared Fields
- ✓ Custom certificate template file (DOCX)
- ✓ Template filename
- ✓ Placeholder mappings (JSON)
- ✓ Custom certificate flag
- ✓ Certification report layout selection
Preserved Data
- ✓ Survey configuration
- ✓ Survey questions and answers
- ✓ Participant responses
- ✓ Previously generated certificates (as attachments)
Important Notes
Confirmation Required
- Deletion requires confirmation
- Action cannot be undone
- Previously generated certificates remain available
Survey-Specific
- Deleting a template from one survey doesn't affect other surveys
- Each survey maintains its own custom template independently
Default Reversion
- After deletion, certification_report_layout is reset to "no selection"
- You can then choose from Odoo's default certificate templates
- Or upload a new custom template
Error Scenarios
No Template to Delete
Error: "No custom certificate template to delete."
Cause: Survey doesn't have a custom certificate configured
Solution: Verify the survey has a custom template before attempting deletion
Button Not Visible
Cause: One of the following conditions:
- Certification Report Layout is not set to "Custom Template"
- No custom template is configured (has_custom_certificate = False)
Solution: Check survey configuration and ensure custom template exists
After Deletion
Next Steps
After deleting a custom certificate template, you can:
-
Use Default Templates
- Select from Odoo's built-in certificate templates
- Configure using standard Odoo options
-
Upload New Template
- Click "Upload Custom Certificate" button
- Follow the template configuration wizard
- Configure new placeholder mappings
-
Disable Certification
- Leave certification_report_layout empty
- Survey will not generate certificates
Technical Details
Database Changes
# Fields set to False after deletion
{
'custom_cert_template': False,
'custom_cert_template_filename': False,
'custom_cert_mappings': False,
'has_custom_certificate': False,
'certification_report_layout': False,
}
Logging
Deletion actions are logged with:
- Survey ID
- Timestamp
- Action type (deletion)
Notification
Success notification displays:
- Title: "Template Deleted"
- Message: "Custom certificate template has been deleted successfully."
- Type: Success (green)
Best Practices
Before Deletion
- Backup Template: Download the template file if you might need it later
- Document Mappings: Note the placeholder mappings for reference
- Check Dependencies: Verify no active processes depend on the template
- Inform Users: Notify stakeholders about the change
After Deletion
- Verify State: Confirm all custom certificate fields are cleared
- Test Workflow: Ensure survey still functions correctly
- Update Documentation: Update any documentation referencing the custom template
- Monitor: Check that certificate generation works with new settings
Troubleshooting
Problem: Delete button not working
Solution:
- Check browser console for errors
- Verify user has appropriate permissions
- Refresh the page and try again
- Check Odoo logs for error messages
Problem: Template still appears after deletion
Solution:
- Refresh the browser page
- Clear browser cache
- Check database directly to verify deletion
- Contact system administrator
Problem: Cannot select default templates after deletion
Solution:
- Verify certification_report_layout field is cleared
- Check if default templates are available in your Odoo installation
- Restart Odoo server if necessary
Support
For additional help:
- Check Odoo logs:
/var/log/odoo/odoo.log - Review module documentation
- Contact system administrator
- Refer to Odoo Survey documentation