You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Odoo v10 HR模块自定义联系表单:新增字段值无法同步至申请人档案

Troubleshooting Custom Field Sync in Odoo Website Lead Form

Hey Elena, I’ve run into this exact issue a few times when adding custom fields to Odoo’s website forms—let’s go through the most likely fixes step by step:

  • Verify Field Mapping in the Website Form
    This is the #1 culprit. Odoo doesn’t automatically map frontend form fields to backend model fields unless you explicitly set it up. Here’s how to check:

    1. Go to your website form’s configuration (in the backend, navigate to the form edit page).
    2. Look for the Field Mappings section (you might need to enable developer mode to see this if it’s hidden).
    3. Add a new mapping entry: set the Input Name to x_surname (matching your frontend input’s name attribute) and select your backend x_surname field (under the crm.lead model) as the Field.
    4. Save the form settings and test again.
  • Check Field Permissions for Public Users
    If your backend x_surname field doesn’t allow public users (the ones submitting the form) to write to it, Odoo will silently drop the value. To fix this:

    1. Enable developer mode, then go to Settings > Technical > Models and search for crm.lead.
    2. Open the x_surname field’s configuration.
    3. In the Access Rights tab, make sure the Public user group has at least Write permission (you can check both Read and Write to be safe).
    4. Save the field settings.
  • Ensure No Custom Controller Overrides Are Blocking the Field
    If you’re using a custom controller to handle form submissions instead of Odoo’s default, you need to explicitly handle the x_surname parameter. For example, in your controller code, you should have something like:

    lead = request.env['crm.lead'].sudo().create({
        'name': request.params.get('name'),
        'email_from': request.params.get('email'),
        'x_surname': request.params.get('x_surname'),  # Make sure this line exists!
        # ... other fields
    })
    

    If this line is missing, the surname value won’t be saved to the lead.

  • Clear Caches and Retest
    Odoo loves to cache field definitions and form configurations. After making any of the above changes:

    1. Clear your browser’s cache and hard-refresh the form page.
    2. In the Odoo backend, go to Settings > Technical > Actions > Clear Cache (or use the developer mode’s refresh button at the top right).
    3. Submit a test form with a surname to see if it syncs now.
  • Double-Check Frontend Field Name
    Your frontend code uses name="x_surname" which matches the backend field name—good! Just make sure there are no typos (case sensitivity matters here; Odoo field names are lowercase, so you’re set).

Give these steps a try, and I bet one of them will fix the sync issue. Let me know if you hit any snags!

内容的提问来源于stack exchange,提问作者Elena

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.05.15 07:54:28