From 5c7099863d1dbe324755bcd4a30b39b66887b80b Mon Sep 17 00:00:00 2001 From: Kaushal Prajapati Date: Mon, 25 Dec 2017 10:36:47 +0530 Subject: [PATCH] [IMP] "website_crm" compatible with Multi-Website --- addons/website_crm/__manifest__.py | 1 + addons/website_crm/data/website_crm_data.xml | 1 + addons/website_crm/models/crm_lead.py | 2 ++ addons/website_crm/views/crm_lead_view.xml | 25 +++++++++++++++++++ .../views/website_crm_templates.xml | 9 +++++++ 5 files changed, 38 insertions(+) create mode 100644 addons/website_crm/views/crm_lead_view.xml diff --git a/addons/website_crm/__manifest__.py b/addons/website_crm/__manifest__.py index 481290bd..da43501a 100644 --- a/addons/website_crm/__manifest__.py +++ b/addons/website_crm/__manifest__.py @@ -10,6 +10,7 @@ 'depends': ['website_form', 'website_partner', 'crm'], 'data': [ 'data/website_crm_data.xml', + 'views/crm_lead_view.xml', 'views/website_crm_templates.xml', 'views/res_config_settings_views.xml', ], diff --git a/addons/website_crm/data/website_crm_data.xml b/addons/website_crm/data/website_crm_data.xml index 57cfceec..3a9a0716 100644 --- a/addons/website_crm/data/website_crm_data.xml +++ b/addons/website_crm/data/website_crm_data.xml @@ -15,6 +15,7 @@ 'name', 'partner_name', 'phone', + 'website_id', ]"/> diff --git a/addons/website_crm/models/crm_lead.py b/addons/website_crm/models/crm_lead.py index a4704829..32442045 100644 --- a/addons/website_crm/models/crm_lead.py +++ b/addons/website_crm/models/crm_lead.py @@ -7,6 +7,8 @@ from flectra import fields, models class Lead(models.Model): _inherit = 'crm.lead' + website_id = fields.Many2one('website', string="Website") + def website_form_input_filter(self, request, values): values['medium_id'] = values.get('medium_id') or \ self.default_get(['medium_id']).get('medium_id') or \ diff --git a/addons/website_crm/views/crm_lead_view.xml b/addons/website_crm/views/crm_lead_view.xml new file mode 100644 index 00000000..dd267b5c --- /dev/null +++ b/addons/website_crm/views/crm_lead_view.xml @@ -0,0 +1,25 @@ + + + + crm.lead.form.lead.inherit + crm.lead + + + + + + + + + + crm.lead.search.lead + crm.lead + + + + + + + + \ No newline at end of file diff --git a/addons/website_crm/views/website_crm_templates.xml b/addons/website_crm/views/website_crm_templates.xml index 76f74c08..77c83fea 100644 --- a/addons/website_crm/views/website_crm_templates.xml +++ b/addons/website_crm/views/website_crm_templates.xml @@ -46,6 +46,15 @@ +
+ +
+ +
+