Commit 2a494c80 authored by Yoshinori Okuji's avatar Yoshinori Okuji

Deprecate optional arguments to Movement.getPrice, as they do not make sense.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@14469 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 9acfafca
......@@ -212,7 +212,7 @@ class Movement(XMLObject, Amount):
return default
security.declareProtected(Permissions.AccessContentsInformation, 'getPrice')
def getPrice(self, default=None, context=None, REQUEST=None, **kw):
def getPrice(self, default=None, **kw):
"""
Get the Price in the context.
......@@ -234,11 +234,14 @@ class Movement(XMLObject, Amount):
context = default
default = None
if len(kw):
warn('Passing keyword arguments to Movement.getPrice has no effect',
DeprecationWarning)
local_price = self._baseGetPrice()
if local_price is None:
# We must find a price for this movement
local_price = self._getPrice(context=self.asContext(
context=context, REQUEST=REQUEST, **kw))
local_price = self._getPrice(context=self)
# And store it localy
if local_price is not None:
self.setPrice(local_price)
......
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