From 296494aaed42ae3a42e9df48dcce7d40fe70cac1 Mon Sep 17 00:00:00 2001 From: dbh Date: Tue, 4 Oct 2016 16:44:20 +0530 Subject: [PATCH] [ADD] crm : add website field into lead and opportunity form view for company/customer information --- addons/crm/models/crm_lead.py | 4 ++++ addons/crm/views/crm_lead_views.xml | 6 ++++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/addons/crm/models/crm_lead.py b/addons/crm/models/crm_lead.py index 0358b35a486..d57a03ab880 100644 --- a/addons/crm/models/crm_lead.py +++ b/addons/crm/models/crm_lead.py @@ -47,6 +47,7 @@ CRM_LEAD_FIELDS_TO_MERGE = [ 'date_action_next', 'email_from', 'email_cc', + 'website', 'partner_name'] @@ -75,6 +76,7 @@ class Lead(FormatAddress, models.Model): date_action_last = fields.Datetime('Last Action', readonly=True) date_action_next = fields.Datetime('Next Action', readonly=True) email_from = fields.Char('Email', help="Email address of the contact", index=True) + website = fields.Char('Website', index=True, help="Website of the contact") team_id = fields.Many2one('crm.team', string='Sales Team', oldname='section_id', default=lambda self: self.env['crm.team'].sudo()._get_default_team_id(user_id=self.env.uid), index=True, track_visibility='onchange', help='When sending mails, the default email address is taken from the sales team.') kanban_state = fields.Selection([('grey', 'No next activity planned'), ('red', 'Next activity late'), ('green', 'Next activity is planned')], @@ -238,6 +240,7 @@ class Lead(FormatAddress, models.Model): 'fax': partner.fax, 'zip': partner.zip, 'function': partner.function, + 'website': partner.website, } return {} @@ -727,6 +730,7 @@ class Lead(FormatAddress, models.Model): 'city': self.city, 'country_id': self.country_id.id, 'state_id': self.state_id.id, + 'website': self.website, 'is_company': is_company, 'type': 'contact' } diff --git a/addons/crm/views/crm_lead_views.xml b/addons/crm/views/crm_lead_views.xml index 6565ec972f5..b062119b151 100644 --- a/addons/crm/views/crm_lead_views.xml +++ b/addons/crm/views/crm_lead_views.xml @@ -62,7 +62,7 @@ + context="{'default_name': contact_name, 'default_street': street, 'default_city': city, 'default_state_id': state_id, 'default_zip': zip, 'default_country_id': country_id, 'default_function': function, 'default_phone': phone, 'default_mobile': mobile, 'default_fax': fax, 'default_email': email_from, 'default_user_id': user_id, 'default_team_id': team_id, 'default_website': website}" groups="base.group_no_one"/>