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