mirror of
https://github.com/inventree/InvenTree
synced 2024-08-30 18:33:04 +00:00
fix default empy dict
This commit is contained in:
parent
b2eb4e131a
commit
cbd84a23f9
@ -315,7 +315,7 @@ def WrapWithQuotes(text, quote='"'):
|
|||||||
return text
|
return text
|
||||||
|
|
||||||
|
|
||||||
def MakeBarcode(object_name, object_pk, object_data={}, **kwargs):
|
def MakeBarcode(object_name, object_pk, object_data=None, **kwargs):
|
||||||
""" Generate a string for a barcode. Adds some global InvenTree parameters.
|
""" Generate a string for a barcode. Adds some global InvenTree parameters.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
@ -327,6 +327,8 @@ def MakeBarcode(object_name, object_pk, object_data={}, **kwargs):
|
|||||||
Returns:
|
Returns:
|
||||||
json string of the supplied data plus some other data
|
json string of the supplied data plus some other data
|
||||||
"""
|
"""
|
||||||
|
if object_data is None:
|
||||||
|
object_data = {}
|
||||||
|
|
||||||
url = kwargs.get('url', False)
|
url = kwargs.get('url', False)
|
||||||
brief = kwargs.get('brief', True)
|
brief = kwargs.get('brief', True)
|
||||||
|
@ -1022,7 +1022,7 @@ class StockItem(MPTTModel):
|
|||||||
def has_tracking_info(self):
|
def has_tracking_info(self):
|
||||||
return self.tracking_info_count > 0
|
return self.tracking_info_count > 0
|
||||||
|
|
||||||
def add_tracking_entry(self, entry_type, user, deltas={}, notes='', **kwargs):
|
def add_tracking_entry(self, entry_type, user, deltas=None, notes='', **kwargs):
|
||||||
"""
|
"""
|
||||||
Add a history tracking entry for this StockItem
|
Add a history tracking entry for this StockItem
|
||||||
|
|
||||||
@ -1033,6 +1033,8 @@ class StockItem(MPTTModel):
|
|||||||
notes - User notes associated with this tracking entry
|
notes - User notes associated with this tracking entry
|
||||||
url - Optional URL associated with this tracking entry
|
url - Optional URL associated with this tracking entry
|
||||||
"""
|
"""
|
||||||
|
if deltas is None:
|
||||||
|
deltas = {}
|
||||||
|
|
||||||
# Has a location been specified?
|
# Has a location been specified?
|
||||||
location = kwargs.get('location', None)
|
location = kwargs.get('location', None)
|
||||||
|
Loading…
Reference in New Issue
Block a user