From c3cca02ac83aa9a2d60dd75818af0a2e5ec836db Mon Sep 17 00:00:00 2001 From: Youssef Bashandy Date: Thu, 9 Nov 2023 15:56:02 +0200 Subject: [PATCH] [FIX] crm : Individual contact address auto population MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Steps to reproduce: 1- Install CRM app 2- Go to pipeline and create a new lead 3- Write a name for contact and click on 'Create and edit...' 4- Choose 'individual' as contact type and select the company related to this individual 5- the address will remain empty and will not be auto populated Current behavior before PR: The address is not auto populating when creating a new individual contact through a new lead. This happens because when you choose the contact type to individual the address type is not chosen so it is not populating any of the addresses Desired behavior after PR is merged: The address is now auto populating as I am passing to the form a default value for the contact type which is 'Contact' which is the default value when you create a contact from Contacts app opw-3569833 closes odoo/odoo#143408 X-original-commit: ae51afafc606e5ca568864fdf04a0ea618bf242d Signed-off-by: Jérémy Hennecart (jeh) --- addons/crm/views/crm_lead_views.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index aa941669357..bbfffceb6b5 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -461,6 +461,7 @@ 'default_name': contact_name or partner_name, 'default_is_company': type == 'opportunity' and contact_name == False, 'default_company_name': type == 'opportunity' and partner_name, + 'default_type': 'contact', 'default_phone': phone, 'default_email': email_from, 'default_user_id': user_id,