Website Form Submission Errors
When visitors submit forms on the Odoo website, they may fail silently or show errors:
Issues:
- Form shows "An error occurred" after submit
- Form submits but no record is created in Odoo
- CAPTCHA validation fails every time
- Custom form fields not saving to the correct model
- Form redirect after submit goes to wrong page
- Email notification not sent after form submissionFix 1: Check Form Action Configuration
# Odoo website forms are configured with action attributes:
Fix 2: Form Fields Not Mapping
# Each form field must map to a model field:
# Verify field names exist on the model:
sudo -u postgres psql -d mydb -c "
SELECT name, field_description, ttype, required
FROM ir_model_fields
WHERE model = 'crm.lead'
AND name IN ('contact_name', 'email_from', 'phone', 'description');
"Fix 3: reCAPTCHA Issues
# Odoo supports Google reCAPTCHA on website forms
# If CAPTCHA always fails:
# 1. Check reCAPTCHA keys:
# Website > Configuration > Settings > reCAPTCHA section
# Site Key and Secret Key must match your Google reCAPTCHA config
# 2. Verify the domain:
# In Google reCAPTCHA admin, ensure your Odoo domain is listed
# Both www.example.com and example.com should be added
# 3. Disable to test:
# Temporarily disable reCAPTCHA in website settings
# If the form works without it, the issue is reCAPTCHA configuration
# 4. Check for proxy/CDN interference:
# Cloudflare or other CDN may interfere with reCAPTCHA
# Add an exception for the reCAPTCHA verification endpointFix 4: Email Notification After Form Submit
# If form submits successfully but no email notification:
# Check the form's email settings:
# In the website builder, select the form
# Look for "Send to" email address in form properties
# Or check mail template:
# Settings > Technical > Email Templates
# Find the template for the model (e.g., crm.lead)
# Check the outgoing mail server:
# Settings > Technical > Outgoing Mail Servers
# Verify SMTP is configured and working
# Check mail queue:
# Settings > Technical > Emails
# Filter by state = "Outgoing" or "Exception"Fix 5: Form Returns Server Error (500)
# Check Odoo logs for the actual error:
grep "website/form" /var/log/odoo/odoo.log | tail -20
# Common server-side errors:
# - Required field missing in form data
# - Field type mismatch (e.g., text in a Many2one field)
# - Access rights (public user cannot create records)
# - Model not whitelisted for website forms
# Whitelist model for website forms:
# The model must have website_form_access = True
# Or be in the list of allowed models:
sudo -u postgres psql -d mydb -c "
SELECT name, website_form_access FROM ir_model
WHERE model = 'crm.lead';
"Fix 6: Custom Form Model Access
# For custom models, grant form submission access:
class MyModel(models.Model):
_name = 'my.form.model'
_description = 'My Form Model'
# Allow website form submissions
_inherit = ['website.published.mixin'] # Optional
name = fields.Char(required=True)
email = fields.Char()
message = fields.Text()
# In security/ir.model.access.csv:
id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink
access_my_form_public,my.form.model.public,model_my_form_model,base.group_public,0,0,1,0
# The public group needs CREATE permission for form submissionsFix 7: Success Page Redirect
# After submission, the form should redirect:
Prevention
DeployMonkey's AI agent validates website form configurations including field mappings, model access rights, and email notification setup. Form functionality is tested during deployment to prevent submission errors.