Anto has proposed merging 
lp:~openerp-dev/openobject-addons/trunk-bug-1078037-abo into 
lp:openobject-addons.

Requested reviews:
  OpenERP Core Team (openerp)
Related bugs:
  Bug #1078037 in OpenERP Addons: "CRM leads deletion"
  https://bugs.launchpad.net/openobject-addons/+bug/1078037

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1078037-abo/+merge/133968
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/trunk-bug-1078037-abo/+merge/133968
Your team OpenERP R&D Team is subscribed to branch 
lp:~openerp-dev/openobject-addons/trunk-bug-1078037-abo.
=== modified file 'crm/crm.py'
--- crm/crm.py	2012-10-12 11:42:58 +0000
+++ crm/crm.py	2012-11-12 18:04:34 +0000
@@ -115,7 +115,6 @@
         '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 @@
 
     _defaults = {
         'active': 1,
-        'allow_unlink': 1,
         'stage_ids': _get_stage_common,
         'alias_domain': False, # always hide alias during creation
     }

=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py	2012-11-07 16:30:37 +0000
+++ crm/crm_lead.py	2012-11-12 18:04:34 +0000
@@ -779,14 +779,6 @@
         }
         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

=== modified file 'crm/crm_view.xml'
--- crm/crm_view.xml	2012-11-12 06:13:34 +0000
+++ crm/crm_view.xml	2012-11-12 18:04:34 +0000
@@ -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>

_______________________________________________
Mailing list: https://launchpad.net/~openerp-dev-gtk
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~openerp-dev-gtk
More help   : https://help.launchpad.net/ListHelp

Reply via email to