Commit 7ba0f739 authored by Yoshinori Okuji's avatar Yoshinori Okuji

It is not a good idea to simply replace rule_id with rule_reference, because...

It is not a good idea to simply replace rule_id with rule_reference, because python accepts a keyword parameter for a positional parameter. So only deprecate rule_id for backward compatibility.

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@17572 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 7e9f94df
......@@ -654,7 +654,8 @@ class Delivery(XMLObject, ImmobilisationDelivery):
##########################################################################
# Applied Rule stuff
def updateAppliedRule(self, rule_reference, force=0, **kw):
def updateAppliedRule(self, rule_reference=None, rule_id=None, force=0,
**kw):
"""
Create a new Applied Rule if none is related, or call expand
on the existing one.
......@@ -665,6 +666,12 @@ class Delivery(XMLObject, ImmobilisationDelivery):
If no rule is found, simply pass rule_reference to _createAppliedRule,
to keep compatibility vith the previous behaviour
"""
if rule_id is not None:
from warnings import warn
warn('rule_id to updateAppliedRule is deprecated; use rule_reference instead',
DeprecationWarning)
rule_reference = rule_id
if rule_reference is None:
return
......
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