Commit 6a7d04b2 authored by Nicolas Dumazet's avatar Nicolas Dumazet

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
parent aea3494c
...@@ -172,6 +172,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount): ...@@ -172,6 +172,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
""" """
Get all interesting amount value and return AggregatedAmountList Get all interesting amount value and return AggregatedAmountList
""" """
from Products.ERP5Type.Document import newTempAmount
context = self.asContext(context=context, REQUEST=REQUEST, **kw) context = self.asContext(context=context, REQUEST=REQUEST, **kw)
# Create the result object # Create the result object
aggregated_amount_list = AggregatedAmountList() aggregated_amount_list = AggregatedAmountList()
...@@ -186,8 +188,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount): ...@@ -186,8 +188,8 @@ class TransformedResource(Predicate, XMLObject, XMLMatrix, Amount):
# changing. Failure to do so exposes to possible erroneous cache hits # changing. Failure to do so exposes to possible erroneous cache hits
# for physical path based caching. # for physical path based caching.
tmp_id = '_'.join((parent.getId(), self.getId(), context.getId())) tmp_id = '_'.join((parent.getId(), self.getId(), context.getId()))
tmp_amount = parent.newContent(id=tmp_id, tmp_amount = newTempAmount(parent, tmp_id)
temp_object=1, portal_type=self.getPortalType())
# Create error string # Create error string
error_string = '' error_string = ''
# Add resource relation # Add resource relation
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment