Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
Otázka byla uzavřena pro důvod: Duplicitní příspěvek od mr.sotheakong@gmail.com na 01.08.2025 00:15:02
2 Odpovědi
1412 Zobrazení

I have create a custom field in the lead and want to copy to the Contact and Opportunity form.

i have try to Automation but still not work. please help to advise as am new to Odoo studio

Avatar
Zrušit

Go to settings>Technical>Database Structure>fields, filter on crm.lead model and search your custom filed name
Note down the field technical name, e.g. x_custom_field.
Add the field to Opportunity form view:
Go to Settings > Technical > User Interface > Views, search for crm.lead form views.

Find the one used by Opportunities. Usually, Odoo has two different views or one view with conditional groups for Lead vs Opportunity.

Edit that view to add your custom field (x_custom_field).

Nejlepší odpověď

Yes, you can copy the custom field value from the Lead (crm.lead) to the linked Contact (res.partner) automatically using Odoo’s Automated Actions without any external code.

Here’s exactly what you should do:

  1. Go to Settings > Technical > Automated Actions (enable Developer Mode if needed).
  2. Create a new automated action:
    • Model: Lead/Opportunity (crm.lead)
    • Trigger: On Creation and On Update
  3. Under Action To Do, select Execute Python Code.

if record.partner_id:

    record.partner_id.write({'x_custom_info': record.x_custom_info})
i hoe it is usefull​

Avatar
Zrušit
Autor

it work now, but why i can't find the custom field that i create in Lead show in Opportunity? i try to find it in Existing Field but can't find and if i create again it give other name.

Is i missing something?

Nejlepší odpověď

To copy custom field from Lead to Contact:

  1. Go to Studio > CRM > Leads.
  2. Add same custom field in res.partner (Contacts).
  3. Create Automated Action on crm.lead:
    • Trigger: On Update.
    • Python Code:

 To copy custom field to Opportunity:

No need to copy — Lead becomes Opportunity, so the field stays if present in both views.

Just ensure:

  1. The same custom field exists in crm.lead.
  2. Add it to the Opportunity form via Studio
pythonCopyEditif record.partner_id:
    record.partner_id.x_custom_field = record.x_custom_field
 

Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
2
srp 25
413
0
úno 25
1529
1
srp 25
2136
2
pro 24
1776
1
lis 24
155