[MERGE] trunk-bug-1078037-abo: improve crm usability by removing restrictions on leads deletion

Read bug ticket for more information: https://bugs.launchpad.net/openobject-addons/+bug/1078037

lp bug: https://launchpad.net/bugs/1078037 fixed

bzr revid: abo@openerp.com-20121113115004-691uktwb9qmgblpx
This commit is contained in:
Antonin Bourguignon 2012-11-13 12:50:04 +01:00
commit 209ad67cf4
3 changed files with 14 additions and 25 deletions

View File

@ -115,7 +115,6 @@ class crm_case_section(osv.osv):
'code': fields.char('Code', size=8),
'active': fields.boolean('Active', help="If the active field is set to "\
"true, it will allow you to hide the sales team without removing it."),
'allow_unlink': fields.boolean('Allow Delete', help="Allows to delete non draft cases"),
'change_responsible': fields.boolean('Reassign Escalated', help="When escalating to this team override the salesman with the team leader."),
'user_id': fields.many2one('res.users', 'Team Leader'),
'member_ids':fields.many2many('res.users', 'sale_member_rel', 'section_id', 'member_id', 'Team Members'),
@ -137,7 +136,6 @@ class crm_case_section(osv.osv):
_defaults = {
'active': 1,
'allow_unlink': 1,
'stage_ids': _get_stage_common,
'alias_domain': False, # always hide alias during creation
}

View File

@ -779,14 +779,6 @@ class crm_lead(base_stage, format_address, osv.osv):
}
return res
def unlink(self, cr, uid, ids, context=None):
for lead in self.browse(cr, uid, ids, context):
if (not lead.section_id.allow_unlink) and (lead.state != 'draft'):
raise osv.except_osv(_('Error!'),
_("You cannot delete lead '%s' because it is not in 'Draft' state. " \
"You can still cancel it, instead of deleting it.") % lead.name)
return super(crm_lead, self).unlink(cr, uid, ids, context)
def write(self, cr, uid, ids, vals, context=None):
if vals.get('stage_id') and not vals.get('probability'):
# change probability of lead(s) if required by stage

View File

@ -24,7 +24,7 @@
parent="base.menu_base_config" sequence="45" groups="base.group_sale_salesman"/>
<menuitem id="base.next_id_64" name="Sales"
parent="base.menu_reporting" sequence="1" />
parent="base.menu_reporting" sequence="1"/>
<menuitem id="base.menu_sales_configuration_misc" name="Miscellaneous" parent="base.menu_base_config" sequence="81"/>
@ -86,7 +86,7 @@
<field name="parent_id"/>
<field name="code"/>
</group>
<group>
<field name="user_id"/>
<field name="resource_calendar_id"/>
@ -102,7 +102,6 @@
<field name="alias_name" class="oe_inline" attrs="{'required': [('alias_id', '!=', False)]}"/>@<field name="alias_domain" class="oe_inline"/>
</div>
<field name="change_responsible"/>
<field name="allow_unlink"/>
</group>
<separator string="Team Members"/>
<field name="member_ids" widget="many2many_kanban">
@ -163,7 +162,7 @@
<field name="view_id" ref="crm_case_section_view_tree"/>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new sales team.
Click to define a new sales team.
</p><p>
Use sales team to organize your different salespersons or
departments into separate teams. Each team will work in
@ -203,7 +202,7 @@
<form string="Stage" version="7.0">
<group col="4">
<field name="name"/>
<field name="state" />
<field name="state"/>
<field name="probability"/>
<field name="type"/>
<field name="on_change"/>
@ -228,7 +227,7 @@
</record>
<!-- Case Categories Form View -->
<!-- Case Categories Form View -->
<record id="crm_case_categ-view" model="ir.ui.view">
<field name="name">crm.case.categ.form</field>
@ -238,7 +237,7 @@
<group>
<field name="name"/>
<field name="section_id"/>
<field name="object_id" invisible="1" />
<field name="object_id" invisible="1"/>
</group>
</form>
</field>
@ -297,7 +296,7 @@
<menuitem action="crm_case_resource_type_act"
id="menu_crm_case_resource_type_act" sequence="4"
groups="base.group_no_one"
parent="base.menu_crm_config_lead" />
parent="base.menu_crm_config_lead"/>
<record id="crm_case_section_act_tree" model="ir.actions.act_window">
<field name="name">Cases by Sales Team</field>
@ -354,13 +353,13 @@
<button name="process_start"
states="not running"
string="Compute Segmentation" type="object"
icon="gtk-execute" />
icon="gtk-execute"/>
<button name="process_stop" states="running"
string="Stop Process" type="object"
icon="gtk-cancel" />
icon="gtk-cancel"/>
<button name="process_continue" states="running"
string="Continue Process" type="object"
icon="gtk-go-forward" />
icon="gtk-go-forward"/>
<field name="state" widget="statusbar"/>
</header>
<group col="4">
@ -412,7 +411,7 @@
<field name="view_mode">tree,form</field>
<field name="help" type="html">
<p class="oe_view_nocontent_create">
Click to define a new customer segmentation.
Click to define a new customer segmentation.
</p><p>
Create specific categories which you can assign to your
contacts to better manage your interactions with them. The
@ -425,7 +424,7 @@
<menuitem action="crm_segmentation_tree-act"
id="menu_crm_segmentation-act"
groups="base.group_no_one" sequence="15"
parent="base.menu_base_config" />
parent="base.menu_base_config"/>
<!-- menu for the working time -->
<menuitem action="resource.action_resource_calendar_form" id="menu_action_resource_calendar_form" parent="resource.menu_resource_config" sequence="1"/>
@ -466,11 +465,11 @@
<field name="view_type">form</field>
<field name="view_mode">tree,form</field>
</record>
<menuitem action="action_crm_payment_mode"
id="menu_crm_payment_mode_act"
groups="base.group_no_one"
name="Payment Modes"
parent="base.menu_crm_config_lead" />
parent="base.menu_crm_config_lead"/>
</data>
</openerp>