From 6a7d04b26546919815f6f861e59efe7d61a9e2f3 Mon Sep 17 00:00:00 2001
From: Nicolas Dumazet <nicolas.dumazet@nexedi.com>
Date: Mon, 8 Mar 2010 05:31:22 +0000
Subject: [PATCH] use newTempAmount instead of
 newContent(portal_type="Transformed Resource")

Using newTemp(Amount|TransformedResource) over newContent allows to go through
conversion_interaction_workflow without triggered any interaction set on
TransformedResource._set(Quantity|Resource.*)

Amount is enough to gather Aggregated data.


git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@33486 20353a03-c40f-0410-a6d1-a30d3c3de9de
---
 product/ERP5/Document/TransformedResource.py | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/product/ERP5/Document/TransformedResource.py b/product/ERP5/Document/TransformedResource.py
index fd2e567317..7f6e53ecf9 100644
--- a/product/ERP5/Document/TransformedResource.py
+++ b/product/ERP5/Document/TransformedResource.py
@@ -172,6 +172,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
       """
         Get all interesting amount value and return AggregatedAmountList
       """
+      from Products.ERP5Type.Document import newTempAmount
+
       context = self.asContext(context=context, REQUEST=REQUEST, **kw)
       # Create the result object
       aggregated_amount_list = AggregatedAmountList()
@@ -186,8 +188,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
         # changing. Failure to do so exposes to possible erroneous cache hits
         # for physical path based caching.
         tmp_id = '_'.join((parent.getId(), self.getId(), context.getId()))
-        tmp_amount = parent.newContent(id=tmp_id,
-                        temp_object=1, portal_type=self.getPortalType())
+        tmp_amount = newTempAmount(parent, tmp_id)
+
         # Create error string
         error_string = ''
         # Add resource relation
-- 
2.30.9