From e52d6ac831a9af108573ace2913d56d7c218ed4e Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Fri, 6 Apr 2012 15:13:41 +0530 Subject: [PATCH 1/7] [add] portal_cutomer_lead module to show their own leads to the customer. bzr revid: nco@tinyerp.com-20120406094341-m3r0lqawt6ffbxji --- addons/portal_customer_lead/__init__.py | 23 ++++++++++ addons/portal_customer_lead/__openerp__.py | 44 +++++++++++++++++++ .../portal_customer_lead_data.xml | 28 ++++++++++++ .../portal_customer_lead_view.xml | 8 ++++ .../security/ir.model.access.csv | 3 ++ 5 files changed, 106 insertions(+) create mode 100644 addons/portal_customer_lead/__init__.py create mode 100644 addons/portal_customer_lead/__openerp__.py create mode 100644 addons/portal_customer_lead/portal_customer_lead_data.xml create mode 100644 addons/portal_customer_lead/portal_customer_lead_view.xml create mode 100644 addons/portal_customer_lead/security/ir.model.access.csv diff --git a/addons/portal_customer_lead/__init__.py b/addons/portal_customer_lead/__init__.py new file mode 100644 index 00000000000..cb65ea0b3dc --- /dev/null +++ b/addons/portal_customer_lead/__init__.py @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2011 OpenERP S.A (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal_customer_lead/__openerp__.py b/addons/portal_customer_lead/__openerp__.py new file mode 100644 index 00000000000..93878e3e2cd --- /dev/null +++ b/addons/portal_customer_lead/__openerp__.py @@ -0,0 +1,44 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# OpenERP, Open Source Management Solution +# Copyright (C) 2004-2011 OpenERP S.A (). +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affero General Public License as +# published by the Free Software Foundation, either version 3 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Affero General Public License for more details. +# +# You should have received a copy of the GNU Affero General Public License +# along with this program. If not, see . +# +############################################################################## + +{ + 'name' : "Portal", + 'version' : "1.0", + 'depends' : ["portal", "crm"], + 'author' : "OpenERP SA", + 'category': 'Portal', + 'description': """ +This module defines 'portals' to customize the access to your OpenERP database +for external users. + +A portal_customer_lead will show the own leads of the customer. + """, + 'website': 'http://www.openerp.com', + + 'update_xml': [ + 'portal_customer_lead_view.xml', + 'portal_customer_lead_data.xml', +# 'security/ir.model.access.csv', + ], + 'installable': True, +} + +# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4: diff --git a/addons/portal_customer_lead/portal_customer_lead_data.xml b/addons/portal_customer_lead/portal_customer_lead_data.xml new file mode 100644 index 00000000000..e1ff2900732 --- /dev/null +++ b/addons/portal_customer_lead/portal_customer_lead_data.xml @@ -0,0 +1,28 @@ + + + + + + customer lead + + True + True + True + + + + customer lead + + + [('partner_id.email','=',user.login)] + + + + portal customer lead + + + + + + + diff --git a/addons/portal_customer_lead/portal_customer_lead_view.xml b/addons/portal_customer_lead/portal_customer_lead_view.xml new file mode 100644 index 00000000000..d2a0e036527 --- /dev/null +++ b/addons/portal_customer_lead/portal_customer_lead_view.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/addons/portal_customer_lead/security/ir.model.access.csv b/addons/portal_customer_lead/security/ir.model.access.csv new file mode 100644 index 00000000000..7f12625c931 --- /dev/null +++ b/addons/portal_customer_lead/security/ir.model.access.csv @@ -0,0 +1,3 @@ +id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink +access_crm_lead_portal,crm.lead,crm.model_crm_lead,portal_customer.group_sale_salesman,1,1,1,0 + From f2bff59f480ac55b5135b62c7d49192feaf3a7a4 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Fri, 6 Apr 2012 16:42:06 +0530 Subject: [PATCH 2/7] [change]: add the contact . bzr revid: nco@tinyerp.com-20120406111206-04m0wvhr1p920pao --- addons/portal_customer/portal_customer_view.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal_customer/portal_customer_view.xml b/addons/portal_customer/portal_customer_view.xml index c17d23b2542..b8f734ea7c6 100644 --- a/addons/portal_customer/portal_customer_view.xml +++ b/addons/portal_customer/portal_customer_view.xml @@ -4,7 +4,7 @@ - + From 69fcbb8bc3a5a003e3b0c71378eeaa48fe568154 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 10 Apr 2012 11:01:16 +0530 Subject: [PATCH 3/7] Hide the unused menus. bzr revid: nco@tinyerp.com-20120410053116-l8wpzpp95zv3p3mn --- addons/portal_customer_lead/__openerp__.py | 5 ++- .../portal_customer_lead_data.xml | 4 +- .../portal_customer_lead_view.xml | 43 ++++++++++++++++++- 3 files changed, 46 insertions(+), 6 deletions(-) diff --git a/addons/portal_customer_lead/__openerp__.py b/addons/portal_customer_lead/__openerp__.py index 93878e3e2cd..160264278a5 100644 --- a/addons/portal_customer_lead/__openerp__.py +++ b/addons/portal_customer_lead/__openerp__.py @@ -22,7 +22,7 @@ { 'name' : "Portal", 'version' : "1.0", - 'depends' : ["portal", "crm"], + 'depends' : ["portal_customer", "crm"], 'author' : "OpenERP SA", 'category': 'Portal', 'description': """ @@ -34,8 +34,9 @@ A portal_customer_lead will show the own leads of the customer. 'website': 'http://www.openerp.com', 'update_xml': [ - 'portal_customer_lead_view.xml', 'portal_customer_lead_data.xml', + 'portal_customer_lead_view.xml', + # 'security/ir.model.access.csv', ], 'installable': True, diff --git a/addons/portal_customer_lead/portal_customer_lead_data.xml b/addons/portal_customer_lead/portal_customer_lead_data.xml index e1ff2900732..0b892c6da7c 100644 --- a/addons/portal_customer_lead/portal_customer_lead_data.xml +++ b/addons/portal_customer_lead/portal_customer_lead_data.xml @@ -17,12 +17,12 @@ [('partner_id.email','=',user.login)] - + portal customer lead - + diff --git a/addons/portal_customer_lead/portal_customer_lead_view.xml b/addons/portal_customer_lead/portal_customer_lead_view.xml index d2a0e036527..eac0ba872c9 100644 --- a/addons/portal_customer_lead/portal_customer_lead_view.xml +++ b/addons/portal_customer_lead/portal_customer_lead_view.xml @@ -1,8 +1,47 @@ - - + + + + + + + + + + + + + + + + + + + + + + + + + From 4764061016e95cb7aa553b725ab73eb8ef99234e Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Tue, 10 Apr 2012 16:42:42 +0530 Subject: [PATCH 4/7] [change] give the access rights for lead and contact. bzr revid: nco@tinyerp.com-20120410111242-wp1dumxw29evzkz6 --- addons/portal_customer_lead/__openerp__.py | 4 +- .../portal_customer_lead_data.xml | 29 ++++++++++--- .../portal_customer_lead_view.xml | 42 ++++++++----------- 3 files changed, 42 insertions(+), 33 deletions(-) diff --git a/addons/portal_customer_lead/__openerp__.py b/addons/portal_customer_lead/__openerp__.py index 160264278a5..f0d4d043edc 100644 --- a/addons/portal_customer_lead/__openerp__.py +++ b/addons/portal_customer_lead/__openerp__.py @@ -34,9 +34,9 @@ A portal_customer_lead will show the own leads of the customer. 'website': 'http://www.openerp.com', 'update_xml': [ - 'portal_customer_lead_data.xml', + 'portal_customer_lead_view.xml', - + 'portal_customer_lead_data.xml', # 'security/ir.model.access.csv', ], 'installable': True, diff --git a/addons/portal_customer_lead/portal_customer_lead_data.xml b/addons/portal_customer_lead/portal_customer_lead_data.xml index 0b892c6da7c..ff6ccaa8de8 100644 --- a/addons/portal_customer_lead/portal_customer_lead_data.xml +++ b/addons/portal_customer_lead/portal_customer_lead_data.xml @@ -1,9 +1,9 @@ - + - customer lead + Customer Lead True True @@ -11,17 +11,34 @@ - customer lead + Customer Lead [('partner_id.email','=',user.login)] + + + + Customer Contact + + True + True + True + + + + Customer Contact + + + [('email','=',user.login)] + + portal customer lead - - - + + + diff --git a/addons/portal_customer_lead/portal_customer_lead_view.xml b/addons/portal_customer_lead/portal_customer_lead_view.xml index eac0ba872c9..29607054ef3 100644 --- a/addons/portal_customer_lead/portal_customer_lead_view.xml +++ b/addons/portal_customer_lead/portal_customer_lead_view.xml @@ -3,12 +3,9 @@ - - - - - + + @@ -16,32 +13,27 @@ - - - + groups="base.group_sale_salesman"/--> + + + - - - - + + Feeds + 0 + + + + + From 5decc1d4605f8eeb76f4faf3d2f8cf375c6ff10f Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Wed, 11 Apr 2012 14:15:44 +0530 Subject: [PATCH 5/7] [change] set the access rights and groups of customer lead bzr revid: nco@tinyerp.com-20120411084544-v74a1jmur0kwkpjy --- addons/portal_customer_lead/__openerp__.py | 7 ++- .../portal_customer_lead_data.xml | 45 ------------------- ...view.xml => portal_customer_lead_menu.xml} | 0 .../security/ir.model.access.csv | 2 +- .../portal_customer_lead_security.xml | 32 +++++++++++++ 5 files changed, 36 insertions(+), 50 deletions(-) delete mode 100644 addons/portal_customer_lead/portal_customer_lead_data.xml rename addons/portal_customer_lead/{portal_customer_lead_view.xml => portal_customer_lead_menu.xml} (100%) create mode 100644 addons/portal_customer_lead/security/portal_customer_lead_security.xml diff --git a/addons/portal_customer_lead/__openerp__.py b/addons/portal_customer_lead/__openerp__.py index f0d4d043edc..1221da468e5 100644 --- a/addons/portal_customer_lead/__openerp__.py +++ b/addons/portal_customer_lead/__openerp__.py @@ -34,10 +34,9 @@ A portal_customer_lead will show the own leads of the customer. 'website': 'http://www.openerp.com', 'update_xml': [ - - 'portal_customer_lead_view.xml', - 'portal_customer_lead_data.xml', -# 'security/ir.model.access.csv', + 'security/portal_customer_lead_security.xml', + 'security/ir.model.access.csv', + 'portal_customer_lead_menu.xml', ], 'installable': True, } diff --git a/addons/portal_customer_lead/portal_customer_lead_data.xml b/addons/portal_customer_lead/portal_customer_lead_data.xml deleted file mode 100644 index ff6ccaa8de8..00000000000 --- a/addons/portal_customer_lead/portal_customer_lead_data.xml +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - Customer Lead - - True - True - True - - - - Customer Lead - - - [('partner_id.email','=',user.login)] - - - - - - Customer Contact - - True - True - True - - - - Customer Contact - - - [('email','=',user.login)] - - - - portal customer lead - - - - - - - diff --git a/addons/portal_customer_lead/portal_customer_lead_view.xml b/addons/portal_customer_lead/portal_customer_lead_menu.xml similarity index 100% rename from addons/portal_customer_lead/portal_customer_lead_view.xml rename to addons/portal_customer_lead/portal_customer_lead_menu.xml diff --git a/addons/portal_customer_lead/security/ir.model.access.csv b/addons/portal_customer_lead/security/ir.model.access.csv index 7f12625c931..de8873ddb0f 100644 --- a/addons/portal_customer_lead/security/ir.model.access.csv +++ b/addons/portal_customer_lead/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_crm_lead_portal,crm.lead,crm.model_crm_lead,portal_customer.group_sale_salesman,1,1,1,0 +access_portal_crm_lead,portal.crm.lead,crm.model_crm_lead,group_portal_customer_lead,1,1,1,0 diff --git a/addons/portal_customer_lead/security/portal_customer_lead_security.xml b/addons/portal_customer_lead/security/portal_customer_lead_security.xml new file mode 100644 index 00000000000..1e8874930f1 --- /dev/null +++ b/addons/portal_customer_lead/security/portal_customer_lead_security.xml @@ -0,0 +1,32 @@ + + + + + + Customer Contact + + + [('email','=',user.login)] + + + + Personal Lead + + [('partner_id.email','=',user.login)] + + + + + Portal Lead Group + + + + + + + Customer Lead Portal + + + + + From f127c26bfc25c830534742b659aaf8007224df30 Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Wed, 11 Apr 2012 15:38:21 +0530 Subject: [PATCH 6/7] [add] add the access rights for res partner to save the lead without customer name bzr revid: nco@tinyerp.com-20120411100821-3vjro43zaackxbsr --- addons/portal_customer_lead/security/ir.model.access.csv | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/portal_customer_lead/security/ir.model.access.csv b/addons/portal_customer_lead/security/ir.model.access.csv index de8873ddb0f..70fa2db29cf 100644 --- a/addons/portal_customer_lead/security/ir.model.access.csv +++ b/addons/portal_customer_lead/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink access_portal_crm_lead,portal.crm.lead,crm.model_crm_lead,group_portal_customer_lead,1,1,1,0 - +access_portal_res_partner,portal.res.partner,base.model_res_partner,group_portal_customer_lead,1,1,1,0 From d223e6e5265ac7de80e22d4df2bbbdc73dbfcc4c Mon Sep 17 00:00:00 2001 From: "Nimesh (Open ERP)" Date: Mon, 16 Apr 2012 15:17:17 +0530 Subject: [PATCH 7/7] [imp] changes in customer portal lead in depends and menu items. bzr revid: nco@tinyerp.com-20120416094717-6mlr1s9an9ryp12s --- addons/portal_customer_lead/__openerp__.py | 2 +- .../portal_customer_lead_menu.xml | 34 ++++++++----------- .../security/ir.model.access.csv | 4 +-- 3 files changed, 18 insertions(+), 22 deletions(-) diff --git a/addons/portal_customer_lead/__openerp__.py b/addons/portal_customer_lead/__openerp__.py index 1221da468e5..d52a5a14cb7 100644 --- a/addons/portal_customer_lead/__openerp__.py +++ b/addons/portal_customer_lead/__openerp__.py @@ -22,7 +22,7 @@ { 'name' : "Portal", 'version' : "1.0", - 'depends' : ["portal_customer", "crm"], + 'depends' : ["portal","crm"], 'author' : "OpenERP SA", 'category': 'Portal', 'description': """ diff --git a/addons/portal_customer_lead/portal_customer_lead_menu.xml b/addons/portal_customer_lead/portal_customer_lead_menu.xml index 29607054ef3..9ca0539b6a5 100644 --- a/addons/portal_customer_lead/portal_customer_lead_menu.xml +++ b/addons/portal_customer_lead/portal_customer_lead_menu.xml @@ -2,25 +2,19 @@ - - - - - - - - - - - - - - + + + + + - + + + + + + + @@ -31,8 +25,10 @@ Feeds 0 - + + + diff --git a/addons/portal_customer_lead/security/ir.model.access.csv b/addons/portal_customer_lead/security/ir.model.access.csv index 70fa2db29cf..02ee2430cb0 100644 --- a/addons/portal_customer_lead/security/ir.model.access.csv +++ b/addons/portal_customer_lead/security/ir.model.access.csv @@ -1,3 +1,3 @@ id,name,model_id:id,group_id:id,perm_read,perm_write,perm_create,perm_unlink -access_portal_crm_lead,portal.crm.lead,crm.model_crm_lead,group_portal_customer_lead,1,1,1,0 -access_portal_res_partner,portal.res.partner,base.model_res_partner,group_portal_customer_lead,1,1,1,0 +access_portal_crm_lead,portal.crm.lead,crm.model_crm_lead,group_portal_customer_lead,1,0,0,0 +access_portal_customer_contact,portal.customer.contact,base.model_res_partner,group_portal_customer_lead,1,1,0,0 \ No newline at end of file