[add] portal_cutomer_lead module to show their own leads to the customer.

bzr revid: nco@tinyerp.com-20120406094341-m3r0lqawt6ffbxji
This commit is contained in:
Nimesh (Open ERP)
2012-04-06 15:13:41 +05:30
parent b484b37186
commit e52d6ac831
5 changed files with 106 additions and 0 deletions
+23
View File
@@ -0,0 +1,23 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
# vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
@@ -0,0 +1,44 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2011 OpenERP S.A (<http://www.openerp.com>).
#
# 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 <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'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:
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<record id="portal_customer_lead_access_right" model="ir.model.access">
<field name="name">customer lead</field>
<field ref="crm.model_crm_lead" name="model_id"/>
<field name="perm_read">True</field>
<field name="perm_write">True</field>
<field name="perm_create">True</field>
</record>
<record id="customer_own_lead" model="ir.rule">
<field name="name">customer lead</field>
<field ref="crm.model_crm_lead" name="model_id"/>
<field eval="1" name="global"/>
<field name="domain_force">[('partner_id.email','=',user.login)]</field>
</record>
<record model="res.portal" id="res_portal_lead">
<field name="name">portal customer lead</field>
<field name="model_access" eval="[(6,0,[ref('portal_customer_lead_access_right')])]"/>
<field name="menu_access" eval="[(4,ref('menu_customer_portal_leads'))]"/>
<field name="rule_groups" eval="[(4,ref('customer_own_lead'))]"/>
</record>
</data>
</openerp>
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<openerp>
<data>
<menuitem name="Leads" id="menu_customer_portal_leads" parent="portal_customer.customer_portal_track_orders" action="crm.crm_case_category_act_leads_all"/>
</data>
</openerp>
@@ -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
1 id name model_id:id group_id:id perm_read perm_write perm_create perm_unlink
2 access_crm_lead_portal crm.lead crm.model_crm_lead portal_customer.group_sale_salesman 1 1 1 0