Commit cbf84e11 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Override _getBaseUnitPrice, as we want to use...

Override _getBaseUnitPrice, as we want to use Movement.getPriceCalculationOperandDict if the context is a Movement.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35597 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent ca73da70
...@@ -225,6 +225,14 @@ class Movement(XMLObject, Amount, CompositionMixin): ...@@ -225,6 +225,14 @@ class Movement(XMLObject, Amount, CompositionMixin):
else: else:
return default return default
def _getBaseUnitPrice(self, context):
# Override Amount._getBaseUnitPrice to use Movement's
# getPriceCalculationOperandDict instead of Resource's.
operand_dict = context.getPriceParameterDict(context=context)
if operand_dict is not None:
base_unit_price = operand_dict.get('base_unit_price', None)
return base_unit_price
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
'getPriceCalculationOperandDict') 'getPriceCalculationOperandDict')
def getPriceCalculationOperandDict(self, default=None, context=None, **kw): def getPriceCalculationOperandDict(self, default=None, context=None, **kw):
......
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