From ee2c9ebf88d6361d79494f1c9f2afc100eefc3f0 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Mon, 24 Jan 2011 14:25:25 +0530 Subject: [PATCH 1/4] [FIX] project: Fixed demo data to avoid name error on webdav. lp bug: https://launchpad.net/bugs/704444 fixed bzr revid: uco@tinyerp.com-20110124085525-llr8jyupo2iu01ly --- addons/project/project_demo.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/addons/project/project_demo.xml b/addons/project/project_demo.xml index a2a5bb8c17c..ae98daff184 100644 --- a/addons/project/project_demo.xml +++ b/addons/project/project_demo.xml @@ -364,7 +364,7 @@ 24.0 - MRP; functional layer + MRP functional layer done From 07cd879c3ebd104bd70ab85c2bd0fcf674b4fcbc Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 27 Jan 2011 14:45:53 +0530 Subject: [PATCH 2/4] [FIX] analytic: Fixed analytic chart of accounts problem defined on lp:681463 using suggested patch. bzr revid: uco@tinyerp.com-20110127091553-8fn70mh3tyqaxdax --- addons/analytic/analytic.py | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/addons/analytic/analytic.py b/addons/analytic/analytic.py index 124607112a9..958f8317687 100644 --- a/addons/analytic/analytic.py +++ b/addons/analytic/analytic.py @@ -116,10 +116,7 @@ class account_analytic_account(osv.osv): 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 From 41fafc4ae7219755ba054178cfb4ac36b92eed43 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 27 Jan 2011 16:35:13 +0530 Subject: [PATCH 3/4] [FIX] project_retro_planning: Fixed yml. bzr revid: uco@tinyerp.com-20110127110513-bo02efgj3jr4qjdg --- addons/project_retro_planning/test/deadline_change.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/addons/project_retro_planning/test/deadline_change.yml b/addons/project_retro_planning/test/deadline_change.yml index 39dec6bf42a..661e4ba56e6 100644 --- a/addons/project_retro_planning/test/deadline_change.yml +++ b/addons/project_retro_planning/test/deadline_change.yml @@ -10,8 +10,8 @@ Create task 'Plan all projects' - !record {model: project.task, id: project_task_planallprojects0}: - date_deadline: !eval "'%s-%s-%s' %(datetime.now().year,datetime.now().month,datetime.now().day+6)" - date_end: !eval "'%s-%s-%s %s:%s:%s' %(datetime.now().year,datetime.now().month,datetime.now().day+3,datetime.now().hour,datetime.now().minute,datetime.now().second)" + date_deadline: !eval "'%s-%s-%s' %(datetime.now().year, datetime.now().month, datetime.now().day)" + date_end: !eval "'%s-%s-%s %s:%s:%s' %(datetime.now().year, datetime.now().month, datetime.now().day, datetime.now().hour, datetime.now().minute, datetime.now().second)" date_start: !eval time.strftime('%Y-%m-%d %H:%M:%S') name: Plan all projects planned_hours: 24.0 From fdd8a68cf24b57eef4bf18d94805c390c7c9d198 Mon Sep 17 00:00:00 2001 From: "Ujjvala Collins (OpenERP)" Date: Thu, 27 Jan 2011 18:28:29 +0530 Subject: [PATCH 4/4] [REF] crm: Code optimization on next/previous stages for lead and opportunities. bzr revid: uco@tinyerp.com-20110127125829-1oc4dexmi48tggr2 --- addons/crm/crm_lead.py | 32 +++++++++++++------------------- 1 file changed, 13 insertions(+), 19 deletions(-) diff --git a/addons/crm/crm_lead.py b/addons/crm/crm_lead.py index 181a561a7cb..b055943d785 100644 --- a/addons/crm/crm_lead.py +++ b/addons/crm/crm_lead.py @@ -296,33 +296,27 @@ class crm_lead(crm_case, osv.osv): 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