← Back to team overview

openerp-dev-web team mailing list archive

[Merge] lp:~openerp-dev/openobject-addons/uco-dev-addons1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons1

 

Ujjvala Collins (OpenERP) has proposed merging lp:~openerp-dev/openobject-addons/uco-dev-addons1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons1.

Requested reviews:
  OpenERP R&D Team (openerp-dev)
Related bugs:
  #530681 [trunk - base_calendar] exrule field without functionality [IMP]
  https://bugs.launchpad.net/bugs/530681
  #681463 [6.0][project] template project shouldn't pollute the analytic chart of account
  https://bugs.launchpad.net/bugs/681463
  #697443 Bug in the tree view of the projects, when grouping by parent
  https://bugs.launchpad.net/bugs/697443
  #701556 name trouble in phone call section in partner from view
  https://bugs.launchpad.net/bugs/701556

For more details, see:
https://code.launchpad.net/~openerp-dev/openobject-addons/uco-dev-addons1/+merge/47766

* [FIX] analytic: Fixed analytic chart of accounts problem defined on lp:681463 using suggested patch.

* [REF] crm: Code optimization on next/previous stages for lead and opportunities.
-- 
https://code.launchpad.net/~openerp-dev/openobject-addons/uco-dev-addons1/+merge/47766
Your team OpenERP R&D Team is requested to review the proposed merge of lp:~openerp-dev/openobject-addons/uco-dev-addons1 into lp:~openerp-dev/openobject-addons/trunk-dev-addons1.
=== modified file 'analytic/analytic.py'
--- analytic/analytic.py	2011-01-18 17:31:53 +0000
+++ analytic/analytic.py	2011-01-28 05:08:59 +0000
@@ -116,10 +116,7 @@
             context = {}
         
         for account in self.browse(cr, uid, ids, context=context):
-            for child in account.child_ids:
-                if child.state == 'template':
-                    account.child_ids.pop(account.child_ids.index(child))
-            result[account.id] = map(lambda x: x.id, account.child_ids)
+            result[account.id] = map(lambda x: x.id, [child for child in account.child_ids if child.state != 'template'])
 
         return result
 

=== modified file 'crm/crm_lead.py'
--- crm/crm_lead.py	2011-01-25 13:20:51 +0000
+++ crm/crm_lead.py	2011-01-28 05:08:59 +0000
@@ -296,33 +296,27 @@
             return super(crm_lead,self).write(cr, uid, ids, vals, context=context)
         return super(crm_lead,self).write(cr, uid, ids, vals, context)
     
+    def stage_historize(self, cr, uid, ids, stage, context=None):
+        stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
+        self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
+        for case in self.browse(cr, uid, ids, context=context):
+            if case.type == 'lead':
+                message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
+            elif case.type == 'opportunity':
+                message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, stage_obj.name)
+            self.log(cr, uid, case.id, message)
+        return True
+    
     def stage_next(self, cr, uid, ids, context=None):
         stage = super(crm_lead, self).stage_next(cr, uid, ids, context=context)
         if stage:
-            stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
-            self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
-            for case in self.browse(cr, uid, ids, context=context):
-                if case.type == 'lead':
-                    message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
-                elif case.type == 'opportunity':
-                    message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
-                self.log(cr, uid, case.id, message)            
-            if stage_obj.on_change:
-                data = {'probability': stage_obj.probability}
-                self.write(cr, uid, ids, data)
+            self.stage_historize(cr, uid, ids, stage, context=context)
         return stage
     
     def stage_previous(self, cr, uid, ids, context=None):
         stage = super(crm_lead, self).stage_previous(cr, uid, ids, context)
         if stage:
-            stage_obj = self.pool.get('crm.case.stage').browse(cr, uid, stage, context=context)
-            self.history(cr, uid, ids, _('Stage'), details=stage_obj.name)
-            for case in self.browse(cr, uid, ids, context=context):
-                if case.type == 'lead':
-                    message = _("The stage of lead '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
-                elif case.type == 'opportunity':
-                    message = _("The stage of opportunity '%s' has been changed to '%s'.") % (case.name, case.stage_id.name)
-                self.log(cr, uid, case.id, message)            
+            self.stage_historize(cr, uid, ids, stage, context=context)           
         return stage
     
    

=== modified file 'project/project_demo.xml'
--- project/project_demo.xml	2011-01-14 09:34:28 +0000
+++ project/project_demo.xml	2011-01-28 05:08:59 +0000
@@ -364,7 +364,7 @@
             <field name="remaining_hours">24.0</field>
             <field name="user_id" ref="base.user_root"/>
             <field name="project_id" ref="project_project_21"/>
-            <field name="name">MRP; functional layer</field>
+            <field name="name">MRP functional layer</field>
             <field name="state">done</field>
         </record>
         <record id="project_task_194" model="project.task">


Follow ups