diff options
| author | dbh <dbh@odoo.com> | 2016-10-04 16:44:20 +0530 |
|---|---|---|
| committer | Denis Vermylen (dve) <dve@odoo.com> | 2016-10-12 13:47:05 +0200 |
| commit | 296494aaed42ae3a42e9df48dcce7d40fe70cac1 (patch) | |
| tree | 1d39b7c644b84b83ce0c6235b4b0737ae2889b4b /addons | |
| parent | 0f19e9fff25bd7cbb78cb58bb62af621e50b32da (diff) | |
[ADD] crm : add website field into lead and opportunity form view for company/customer information
Diffstat (limited to 'addons')
| -rw-r--r-- | addons/crm/models/crm_lead.py | 4 | ||||
| -rw-r--r-- | 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 @@ <!-- Preload all the partner's information --> <field name="partner_id" string="Customer" options='{"create_name_field": "name"}' - 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}" groups="base.group_no_one"/> + 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"/> <field name="partner_name" string="Company Name"/> <label for="street" string="Address"/> <div class="o_address_format"> @@ -73,6 +73,7 @@ <field name="zip" placeholder="ZIP" class="o_address_zip"/> <field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/> </div> + <field name="website" widget="url" placeholder="e.g. www.odoo.com"/> </group> <group> <label for="contact_name"/> @@ -419,7 +420,7 @@ '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_user_id': user_id, 'default_team_id': team_id, 'default_website': website}"/> <field name="email_from" string="Email" widget="email"/> <field name="phone" widget="phone"/> </group> @@ -472,6 +473,7 @@ <field name="zip" placeholder="ZIP" class="o_address_zip"/> <field name="country_id" placeholder="Country" class="o_address_country" options='{"no_open": True, "no_create": True}'/> </div> + <field name="website" widget="url" placeholder="e.g. www.odoo.com"/> </group> <group> |
