Commit ca73da70 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Make getBaseUnitPrice context-aware.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@35596 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 369bfc43
No related merge requests found
...@@ -426,7 +426,7 @@ class Amount(Base, Variated): ...@@ -426,7 +426,7 @@ class Amount(Base, Variated):
return return
tv[key] = 1 tv[key] = 1
try: try:
resource = self.getResourceValue() resource = context.getResourceValue()
if resource is not None: if resource is not None:
operand_dict = resource.getPriceParameterDict(context=context) operand_dict = resource.getPriceParameterDict(context=context)
if operand_dict is not None: if operand_dict is not None:
...@@ -436,7 +436,7 @@ class Amount(Base, Variated): ...@@ -436,7 +436,7 @@ class Amount(Base, Variated):
del tv[key] del tv[key]
security.declareProtected(Permissions.AccessContentsInformation, 'getBaseUnitPrice') security.declareProtected(Permissions.AccessContentsInformation, 'getBaseUnitPrice')
def getBaseUnitPrice(self, **kw): def getBaseUnitPrice(self, context=None, **kw):
""" """
Get the base unit price. Get the base unit price.
...@@ -445,7 +445,9 @@ class Amount(Base, Variated): ...@@ -445,7 +445,9 @@ class Amount(Base, Variated):
local_base_unit_price = self._baseGetBaseUnitPrice() local_base_unit_price = self._baseGetBaseUnitPrice()
if local_base_unit_price is None: if local_base_unit_price is None:
# We must find a base unit price for this movement # We must find a base unit price for this movement
local_base_unit_price = self._getBaseUnitPrice(context=self) if context is None:
context = self
local_base_unit_price = self._getBaseUnitPrice(context=context)
return local_base_unit_price return local_base_unit_price
security.declareProtected(Permissions.AccessContentsInformation, security.declareProtected(Permissions.AccessContentsInformation,
......
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