8.1 KiB
Testing Guide - Login Page Templates Feature
Prerequisites
- Odoo 18 installed and running
- Expert Theme module installed
- Admin access to Odoo backend
Step 1: Install/Upgrade the Module
-
Go to Apps Menu
- Navigate to:
Apps→ Search for "Expert Theme" - Click on the module
- Navigate to:
-
Upgrade the Module
- Click the "Upgrade" button (if already installed)
- OR click "Install" if not installed yet
- Wait for the upgrade/installation to complete
-
Verify Installation
- Check that no errors appear in the logs
- The module should show as "Installed"
Step 2: Access Login Template Configuration
-
Navigate to Configuration
- Go to:
Expert Home→Login Page Templates - OR use the menu:
Expert Home→Login Page Templates(should be above "Theme Colors")
- Go to:
-
Verify Default Templates
- You should see 2 templates created by default:
- Default Template (White background #FFFFFF) - Should be Active
- Light Gray Template (Gray background #F5F5F5) - Should be Inactive
- You should see 2 templates created by default:
Step 3: Test Template Switching
Test 3.1: Switch to Gray Template
-
Open the Gray Template
- Click on "Light Gray Template" from the list
-
Activate the Template
- Click the "Activate" button in the form header
- OR toggle the "Active" field to
True - Click "Save"
-
Verify Switch
- The "Default Template" should automatically become Inactive
- Only "Light Gray Template" should be Active
- Check the list view - only one template should have the Active toggle ON
Test 3.2: Switch Back to Default Template
-
Open Default Template
- Click on "Default Template" from the list
-
Activate it
- Click "Activate" button or toggle "Active" field
- Click "Save"
-
Verify
- "Light Gray Template" should become inactive
- "Default Template" should be active
Step 4: Test Login Page Appearance
Test 4.1: Test with Default Template (White)
-
Logout from Odoo
- Click on your user menu (top right)
- Click "Log out"
-
Check Login Page
- The login page should have a white background (#FFFFFF)
- All login form elements should be visible and functional
-
Verify JavaScript Loading
- Open browser Developer Tools (F12)
- Go to Console tab
- Check for any errors
- You should see the CSS variable being set:
--expert-login-bg-color
Test 4.2: Test with Gray Template
-
Switch to Gray Template (from Step 3.1)
-
Logout and Check Login Page
- Logout from Odoo
- The login page should now have a light gray background (#F5F5F5)
- Login form should still be visible and functional
-
Verify Background Applied
- Check browser DevTools → Elements tab
- Inspect
<body>or<html>element - Should have
background-color: #F5F5F5applied
Step 5: Test Color Customization
Test 5.1: Edit Template Background Color
-
Edit a Template
- Go to
Login Page Templates - Open any template (e.g., "Default Template")
- Go to
-
Change Background Color
- Click on the "Background Color" field
- Choose a different color (e.g.,
#E3F2FD- light blue) - Click "Save"
-
Test on Login Page
- Logout and check login page
- Background should be the new color you selected
Test 5.2: Create New Template
-
Create New Template
- Go to
Login Page Templates - Click "Create" button
- Go to
-
Fill Template Details
- Name: "Blue Template"
- Background Color:
#2196F3(or any blue color) - Description: "Blue themed login page"
- Sequence: 3
- DO NOT activate it yet
-
Save and Activate
- Click "Save"
- Then click "Activate" button
- Verify other templates become inactive
-
Test on Login Page
- Logout and verify blue background appears
Step 6: Test Edge Cases
Test 6.1: Multiple Templates (Only One Active)
-
Create Multiple Templates
- Create 2-3 templates
- Try to activate multiple templates at once
-
Expected Behavior
- Only the last activated template should be active
- All others should automatically become inactive
- This ensures only one template is applied at a time
Test 6.2: No Active Template
-
Deactivate All Templates
- Go to all templates and set
Active = False - Save all
- Go to all templates and set
-
Check Login Page
- Logout and check login page
- Should still work (fallback to default white or system default)
- OR a default template should be auto-created
Test 6.3: Invalid Color Code
-
Test Invalid Color
- Edit a template
- Enter invalid color code (e.g., "invalid" or "12345")
- Save
-
Expected Behavior
- Should either:
- Show validation error
- OR fallback to default color (#FFFFFF)
- Should either:
Step 7: Test API Endpoint
Test 7.1: Check API Response
-
Open Browser DevTools
- Press F12
- Go to Network tab
-
Access Login Page
- Go to login page (while logged out)
-
Check API Call
- Look for request:
/expert_theme/get_login_template_styles - Click on it to see response
- Should return JSON:
{ "success": true, "styles": { "background_color": "#F5F5F5" } }
- Look for request:
-
Verify Public Access
- The API should work without authentication (public access)
- Try accessing directly:
http://your-odoo-url/expert_theme/get_login_template_styles
Step 8: Test Browser Compatibility
Test the login page in different browsers:
- ✅ Chrome/Edge (Chromium)
- ✅ Firefox
- ✅ Safari (if available)
Verify that:
- Background colors apply correctly
- Login form remains functional
- No JavaScript errors in console
Step 9: Performance Testing
-
Check Page Load Time
- Login page should load quickly
- API call should be fast (< 100ms ideally)
-
Check for Console Errors
- Open DevTools → Console
- Should see no errors
- Only warnings are acceptable (e.g., if API fails, it should gracefully handle)
Step 10: Final Verification Checklist
- Module installs/upgrades without errors
- Menu "Login Page Templates" appears in Expert Home
- Default templates are created (2 templates)
- Can switch between templates
- Only one template can be active at a time
- Login page background changes when template is switched
- Can edit template colors
- Can create new templates
- Login form remains functional with all templates
- API endpoint works (public access)
- No JavaScript errors in console
- Works in multiple browsers
Troubleshooting
Issue: Login page background doesn't change
Solutions:
- Clear browser cache (Ctrl+Shift+Delete)
- Hard refresh login page (Ctrl+F5)
- Check browser console for JavaScript errors
- Verify API endpoint is accessible:
/expert_theme/get_login_template_styles - Check that a template is actually active in the backend
Issue: Menu "Login Page Templates" not visible
Solutions:
- Upgrade the module again
- Check user permissions (should be available to all users)
- Clear browser cache
- Restart Odoo server
Issue: Multiple templates active at once
Solutions:
- This shouldn't happen - check the model's
write()method - Manually deactivate all except one
- Report as a bug if it persists
Issue: API returns error
Solutions:
- Check Odoo logs for Python errors
- Verify the model
expert.login.templateexists - Check database for template records
- Verify controller route is registered
Expected Results Summary
✅ Success Criteria:
- Admin can configure login page templates from backend
- Can switch between templates easily
- Login page background changes immediately after switching
- Only one template active at a time
- Login functionality remains intact
- No errors in console or logs
Notes
- The feature is designed to be simple initially (only background color)
- Future enhancements can add more customization options
- All changes take effect immediately (no server restart needed)
- Templates are stored in database, so they persist after module upgrades