Improve ModelStorage.copy
* Allow callable in copy default * Support dotted notation in copy default * Use setdefault in copy * Copy default when needed * Do not set default state in copy * Use callable and dotted notation in copy default issue5576 issue7648 review72291002
This commit is contained in:
@@ -351,8 +351,9 @@ class ShipmentDrop(Workflow, ModelSQL, ModelView):
|
||||
def copy(cls, shipments, default=None):
|
||||
if default is None:
|
||||
default = {}
|
||||
default = default.copy()
|
||||
default['moves'] = None
|
||||
else:
|
||||
default = default.copy()
|
||||
default.setdefault('moves', None)
|
||||
return super(ShipmentDrop, cls).copy(shipments, default=default)
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user