Commit 167d027a authored by Julien Muchembled's avatar Julien Muchembled

Update MRP to work with variated amount generator

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@43598 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9fa31588
......@@ -685,7 +685,7 @@ class Resource(XMLObject, XMLMatrix, VariatedMixin):
categories=new_category_list,
REQUEST=REQUEST, **kw)
# XXX When called for a generated amount, base_application may point
# to nonexistant base_amount (e.g. "produced_quantity" for
# to nonexistant base_amount (e.g. "base_amount/produced_quantity" for
# transformations), which would make domain tool return nothing.
# Following hack cleans up a category we don't want to test anyway.
# Also, do not use '_setBaseApplication' to bypass interactions.
......
......@@ -97,7 +97,7 @@ class TransformedResource(AmountGeneratorLine):
@classmethod
def getBaseAmountQuantity(cls, delivery_amount, base_application, rounding):
value = delivery_amount.getGeneratedAmountQuantity(base_application)
if base_application == 'produced_quantity':
if base_application == 'base_amount/produced_quantity':
value += delivery_amount.getConvertedQuantity()
return value
......@@ -110,7 +110,8 @@ class TransformedResource(AmountGeneratorLine):
"""
"""
# It is OK to try to acquire
return self._categoryGetBaseApplicationList() or ['produced_quantity']
return self._categoryGetBaseApplicationList() \
or ['base_amount/produced_quantity']
### Variation matrix definition
# XXX-JPS Some explanation needed
......
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