From 56ff100b3b269b20ccfceb26963c98559650bab7 Mon Sep 17 00:00:00 2001
From: Sebastien Robin <seb@nexedi.com>
Date: Mon, 28 Feb 2011 14:50:06 +0000
Subject: [PATCH] Revert "do not change id when reference is set" This change
 should be commited again once installation problems are solved

This reverts commit 43807.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43814 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/tests/testTaskReporting.py | 2 +-
 product/ERP5Type/id_as_reference.py     | 7 +++++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/product/ERP5/tests/testTaskReporting.py b/product/ERP5/tests/testTaskReporting.py
index c6bf43c89b..65d88b05a1 100644
--- a/product/ERP5/tests/testTaskReporting.py
+++ b/product/ERP5/tests/testTaskReporting.py
@@ -208,7 +208,7 @@ class TestTaskReporting(ERP5ReportTestCase):
     report_section_list = self.getReportSectionList(
         self.portal.project_module.Project_1,
         'Project_viewMonthlyReport')
-    self.assertEquals(2, len(report_section_list))
+    self.assertEquals(1, len(report_section_list))
 
     line_list = self.getListBoxLineList(report_section_list[0])
     data_line_list = [l for l in line_list if l.isDataLine()]
diff --git a/product/ERP5Type/id_as_reference.py b/product/ERP5Type/id_as_reference.py
index 042d18b76d..65589cd6fd 100644
--- a/product/ERP5Type/id_as_reference.py
+++ b/product/ERP5Type/id_as_reference.py
@@ -77,4 +77,11 @@ def IdAsReferenceMixin(suffix):
         return reference
       return default
 
+    def _setReference(self, value):
+      self.__dict__.pop('default_reference', None) # BBB
+      self.setId(value + suffix)
+
+    security.declareProtected(Permissions.ModifyPortalContent, 'setReference')
+    setReference = _setReference
+
   return IdAsReferenceMixin
-- 
2.30.9