mirror of
https://github.com/inventree/InvenTree.git
synced 2025-06-17 20:45:44 +00:00
Merge branch 'master' of https://github.com/inventree/InvenTree into matmair/issue6281
This commit is contained in:
@ -11,6 +11,9 @@ v296 - 2024-12-22 : https://github.com/inventree/InvenTree/pull/6293
|
||||
- Removes a considerable amount of old auth endpoints
|
||||
- Introduces allauth based REST API
|
||||
|
||||
v296 - 2024-12-25 : https://github.com/inventree/InvenTree/pull/8732
|
||||
- Adjust default "part_detail" behaviour for StockItem API endpoints
|
||||
|
||||
v295 - 2024-12-23 : https://github.com/inventree/InvenTree/pull/8746
|
||||
- Improve API documentation for build APIs
|
||||
|
||||
|
@ -135,15 +135,15 @@ class InvenTreeInternalBarcodePlugin(SettingsMixin, BarcodeMixin, InvenTreePlugi
|
||||
|
||||
def generate(self, model_instance: InvenTreeBarcodeMixin):
|
||||
"""Generate a barcode for a given model instance."""
|
||||
barcode_format = self.get_setting('INTERNAL_BARCODE_FORMAT')
|
||||
|
||||
if barcode_format == 'json':
|
||||
return json.dumps({model_instance.barcode_model_type(): model_instance.pk})
|
||||
barcode_format = self.get_setting(
|
||||
'INTERNAL_BARCODE_FORMAT', backup_value='json'
|
||||
)
|
||||
|
||||
if barcode_format == 'short':
|
||||
prefix = self.get_setting('SHORT_BARCODE_PREFIX')
|
||||
model_type_code = model_instance.barcode_model_type_code()
|
||||
|
||||
return f'{prefix}{model_type_code}{model_instance.pk}'
|
||||
|
||||
return None
|
||||
else:
|
||||
# Default = JSON format
|
||||
return json.dumps({model_instance.barcode_model_type(): model_instance.pk})
|
||||
|
@ -902,8 +902,9 @@ class StockApiMixin:
|
||||
try:
|
||||
params = self.request.query_params
|
||||
|
||||
kwargs['part_detail'] = str2bool(params.get('part_detail', True))
|
||||
|
||||
for key in [
|
||||
'part_detail',
|
||||
'path_detail',
|
||||
'location_detail',
|
||||
'supplier_part_detail',
|
||||
|
Reference in New Issue
Block a user