Commit a2dbbde0 authored by Nicolas Wavrant's avatar Nicolas Wavrant

DeliveryType.py: constructInstance can receive as a parameter any derivative from "ledger_"

parent 895e7ce5
......@@ -43,10 +43,11 @@ class DeliveryType(ERP5TypeInformation):
security.declarePublic('constructInstance')
def constructInstance(self, *args, **kw):
has_ledger_parameter = False
for k in kw:
if k.startswith('ledger_'):
raise ValueError
if 'ledger' not in kw:
has_ledger_parameter = True
if not has_ledger_parameter:
ledger = self.getDefaultLedger()
if ledger:
kw['ledger'] = ledger
......
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