# Template Update and Deletion - User Guide ## Quick Reference ### Updating a Custom Certificate Template **When to Update:** - You want to change the design of your certificate - You need to add or remove placeholders - You're fixing formatting issues in the template **Steps:** 1. Navigate to your survey configuration 2. Ensure "Custom Template" is selected in Certification Template 3. Click "Upload Custom Certificate" button 4. You'll see a blue notification: "You are updating an existing template" 5. Upload your new DOCX template 6. Click "Parse Template" 7. Review the placeholder mappings: - Existing placeholders keep their configured mappings - New placeholders are automatically mapped 8. Adjust any mappings as needed 9. Click "Generate Preview" to verify 10. Click "Save" to apply changes **What Gets Preserved:** - ✅ Mappings for placeholders that exist in both old and new templates - ✅ Custom text values you configured - ✅ Field selections (survey fields, participant fields) **What Changes:** - ❌ Placeholders removed from new template (mappings discarded) - ➕ New placeholders get automatic mapping (you can adjust) ### Deleting a Custom Certificate Template **When to Delete:** - You want to switch back to Odoo's default certificate templates - You no longer need custom certificates for this survey - You want to start fresh with a new template **Steps:** 1. Navigate to your survey configuration 2. Ensure "Custom Template" is selected in Certification Template 3. Click "Delete Custom Certificate" button (trash icon) 4. Confirm deletion in the dialog 5. Template is deleted and survey reverts to default **What Gets Deleted:** - ❌ Custom template file - ❌ All placeholder mappings - ❌ Custom certificate configuration **What Happens After:** - Survey reverts to no template selection - You can choose a different template option - Other surveys are not affected ## Detailed Examples ### Example 1: Adding a New Field to Your Certificate **Scenario:** You want to add the participant's email address to your certificate. **Current Template:** Contains `{key.name}` and `{key.course_name}` **Steps:** 1. Edit your DOCX template to add `{key.email}` 2. Open the wizard (it will show "updating" notification) 3. Upload the modified template 4. Click "Parse Template" 5. Observe: - `{key.name}` still mapped to "partner_name" ✅ - `{key.course_name}` still mapped to "survey_title" ✅ - `{key.email}` automatically mapped to "partner_email" ➕ 6. Save the configuration **Result:** Your existing mappings are preserved, and the new email field is ready to use. ### Example 2: Changing Certificate Design **Scenario:** You want to use a new design with different colors and layout, but same data fields. **Current Template:** Professional blue design with `{key.name}`, `{key.course_name}`, `{key.date}` **New Template:** Modern green design with same placeholders **Steps:** 1. Create new DOCX with same placeholders but new design 2. Open the wizard 3. Upload the new template 4. Click "Parse Template" 5. All mappings are automatically preserved ✅ 6. Click "Generate Preview" to see new design 7. Save if satisfied **Result:** New design applied with zero reconfiguration needed. ### Example 3: Simplifying Your Certificate **Scenario:** You want to remove some fields to make the certificate simpler. **Current Template:** Contains `{key.name}`, `{key.course_name}`, `{key.date}`, `{key.score}`, `{key.email}` **New Template:** Contains only `{key.name}` and `{key.course_name}` **Steps:** 1. Edit your DOCX to remove unwanted placeholders 2. Open the wizard 3. Upload the simplified template 4. Click "Parse Template" 5. Observe: - `{key.name}` mapping preserved ✅ - `{key.course_name}` mapping preserved ✅ - Other mappings automatically removed (placeholders gone) 6. Save the configuration **Result:** Simpler certificate with only essential information. ### Example 4: Starting Over with a New Template **Scenario:** You want to completely redesign your certificate with different placeholders. **Option A: Update** 1. Upload new template 2. Reconfigure any mappings that changed 3. Save **Option B: Delete and Recreate** 1. Click "Delete Custom Certificate" 2. Confirm deletion 3. Click "Upload Custom Certificate" again 4. Upload new template 5. Configure all mappings fresh 6. Save **When to use each:** - **Update**: When some placeholders remain the same - **Delete & Recreate**: When starting completely fresh ## Tips and Best Practices ### Before Updating ✅ **Do:** - Test your new template in Word/LibreOffice first - Keep placeholder names consistent if you want mappings preserved - Document your current mappings (take a screenshot) - Generate a preview before saving ❌ **Don't:** - Change placeholder names unnecessarily (breaks mapping preservation) - Upload templates with syntax errors - Skip the preview step ### Placeholder Naming Strategy For best mapping preservation: **Good Practice:** ``` {key.name} → Always maps to participant name {key.course_name} → Always maps to survey title {key.date} → Always maps to completion date {key.email} → Always maps to participant email ``` **Avoid:** ``` {key.participant} → Ambiguous, might not auto-map correctly {key.field1} → Not descriptive, hard to remember {key.xyz} → Meaningless, requires manual mapping ``` ### When to Delete vs Update **Update When:** - Making design changes - Adding/removing a few fields - Fixing formatting issues - Want to preserve existing mappings **Delete When:** - Completely changing certificate structure - Switching to default templates - Template is corrupted beyond repair - Want a clean slate ## Troubleshooting ### Issue: Mappings Not Preserved **Cause:** Placeholder names changed between templates **Solution:** - Keep placeholder names consistent - Or manually reconfigure changed mappings ### Issue: Can't Delete Template **Error:** "No custom certificate template to delete" **Cause:** Survey doesn't have a custom template configured **Solution:** - Verify "Custom Template" is selected - Check if template was already deleted ### Issue: Update Notification Not Showing **Cause:** Survey doesn't have existing custom certificate **Solution:** - This is normal for first-time template upload - Notification only shows when updating existing template ## FAQ **Q: Will updating my template affect certificates already issued?** A: No, previously generated certificates are not affected. Only new certificates will use the updated template. **Q: Can I undo a template deletion?** A: No, deletion is permanent. You'll need to re-upload and reconfigure the template. **Q: Does deleting a template from one survey affect other surveys?** A: No, each survey has its own independent template. Deleting from one survey doesn't affect others. **Q: What happens if I upload a template with no placeholders?** A: The system will accept it, but you'll get a warning. The certificate will be static (same for all participants). **Q: Can I update just the mappings without changing the template?** A: Yes, open the wizard and adjust mappings without uploading a new file, then save. **Q: How do I know which mappings were preserved?** A: Check the wizard after parsing - preserved mappings will show your previous configuration, new ones will show automatic mapping. ## Support For additional help: - Check the main module documentation - Review the automatic field mapping guide - Test changes in a development environment first - Contact your system administrator for assistance --- **Related Documentation:** - [Automatic Field Mapping Guide](AUTOMATIC_FIELD_MAPPING.md) - [Preview Functionality Guide](PREVIEW_FUNCTIONALITY.md) - [Quick Start Guide](QUICK_START_AUTO_MAPPING.md)