Commit 9ef72d3f authored by Jérome Perrin's avatar Jérome Perrin

Disable getBaseUnitPrice feature

parent f218562f
...@@ -418,6 +418,7 @@ class Amount(Base, VariatedMixin): ...@@ -418,6 +418,7 @@ class Amount(Base, VariatedMixin):
# Stop any recursive call to this method. This happens when a Path # Stop any recursive call to this method. This happens when a Path
# does not have base unit price locally, so it looks it up, and # does not have base unit price locally, so it looks it up, and
# each path of a predicate list does the same again. # each path of a predicate list does the same again.
return 0.01 # feature disabled
tv = getTransactionalVariable() tv = getTransactionalVariable()
key = '_getBaseUnitPrice' key = '_getBaseUnitPrice'
if key in tv: if key in tv:
......
...@@ -242,6 +242,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin): ...@@ -242,6 +242,7 @@ class Movement(XMLObject, Amount, CompositionMixin, AmountGeneratorMixin):
def _getBaseUnitPrice(self, context): def _getBaseUnitPrice(self, context):
# Override Amount._getBaseUnitPrice to use Movement's # Override Amount._getBaseUnitPrice to use Movement's
# getPriceCalculationOperandDict instead of Resource's. # getPriceCalculationOperandDict instead of Resource's.
return 0.01 # feature disabled
operand_dict = context.getPriceCalculationOperandDict(context=context) operand_dict = context.getPriceCalculationOperandDict(context=context)
if operand_dict is not None: if operand_dict is not None:
base_unit_price = operand_dict.get('base_unit_price', None) base_unit_price = operand_dict.get('base_unit_price', None)
......
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