mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-01 11:10:54 +00:00
refactor(backend) rename barcode plugins (#9829)
* refactor(docs): restructure barcode plugin section * rename doc files * add barcode index * add missing link * refactor(backend): rename barcode plugins * fix ref * revert name change * fix name ref
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
"""The DigiKeyPlugin is meant to integrate the DigiKey API into InvenTree.
|
"""The DigiKeyBarcodePlugin is meant to integrate the DigiKey API into InvenTree.
|
||||||
|
|
||||||
This plugin can currently only match DigiKey barcodes to supplier parts.
|
This plugin can currently only match DigiKey barcodes to supplier parts.
|
||||||
"""
|
"""
|
||||||
@ -12,7 +12,8 @@ from plugin.mixins import SettingsMixin, SupplierBarcodeMixin
|
|||||||
class DigiKeyPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
class DigiKeyPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
||||||
"""Plugin to integrate the DigiKey API into InvenTree."""
|
"""Plugin to integrate the DigiKey API into InvenTree."""
|
||||||
|
|
||||||
NAME = 'DigiKeyPlugin'
|
NAME = 'DigiKeyBarcodePlugin'
|
||||||
|
SLUG = 'digikeyplugin'
|
||||||
TITLE = _('Supplier Integration - DigiKey')
|
TITLE = _('Supplier Integration - DigiKey')
|
||||||
DESCRIPTION = _('Provides support for scanning DigiKey barcodes')
|
DESCRIPTION = _('Provides support for scanning DigiKey barcodes')
|
||||||
VERSION = '1.0.1'
|
VERSION = '1.0.1'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""The LCSCPlugin is meant to integrate the LCSC API into InvenTree.
|
"""The LCSCBarcodePlugin is meant to integrate the LCSC API into InvenTree.
|
||||||
|
|
||||||
This plugin can currently only match LCSC barcodes to supplier parts.
|
This plugin can currently only match LCSC barcodes to supplier parts.
|
||||||
"""
|
"""
|
||||||
@ -14,7 +14,8 @@ from plugin.mixins import SettingsMixin, SupplierBarcodeMixin
|
|||||||
class LCSCPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
class LCSCPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
||||||
"""Plugin to integrate the LCSC API into InvenTree."""
|
"""Plugin to integrate the LCSC API into InvenTree."""
|
||||||
|
|
||||||
NAME = 'LCSCPlugin'
|
NAME = 'LCSCBarcodePlugin'
|
||||||
|
SLUG = 'lcscplugin'
|
||||||
TITLE = _('Supplier Integration - LCSC')
|
TITLE = _('Supplier Integration - LCSC')
|
||||||
DESCRIPTION = _('Provides support for scanning LCSC barcodes')
|
DESCRIPTION = _('Provides support for scanning LCSC barcodes')
|
||||||
VERSION = '1.0.1'
|
VERSION = '1.0.1'
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""The MouserPlugin is meant to integrate the Mouser API into InvenTree.
|
"""The MouserBarcodePlugin is meant to integrate the Mouser API into InvenTree.
|
||||||
|
|
||||||
This plugin currently only match Mouser barcodes to supplier parts.
|
This plugin currently only match Mouser barcodes to supplier parts.
|
||||||
"""
|
"""
|
||||||
@ -12,7 +12,8 @@ from plugin.mixins import SettingsMixin, SupplierBarcodeMixin
|
|||||||
class MouserPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
class MouserPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
||||||
"""Plugin to integrate the Mouser API into InvenTree."""
|
"""Plugin to integrate the Mouser API into InvenTree."""
|
||||||
|
|
||||||
NAME = 'MouserPlugin'
|
NAME = 'MouserBarcodePlugin'
|
||||||
|
SLUG = 'mouserplugin'
|
||||||
TITLE = _('Supplier Integration - Mouser')
|
TITLE = _('Supplier Integration - Mouser')
|
||||||
DESCRIPTION = _('Provides support for scanning Mouser barcodes')
|
DESCRIPTION = _('Provides support for scanning Mouser barcodes')
|
||||||
VERSION = '1.0.1'
|
VERSION = '1.0.1'
|
||||||
|
@ -70,7 +70,7 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
|||||||
result = self.post(
|
result = self.post(
|
||||||
self.SCAN_URL, data={'barcode': DIGIKEY_BARCODE}, expected_code=200
|
self.SCAN_URL, data={'barcode': DIGIKEY_BARCODE}, expected_code=200
|
||||||
)
|
)
|
||||||
self.assertEqual(result.data['plugin'], 'DigiKeyPlugin')
|
self.assertEqual(result.data['plugin'], 'DigiKeyBarcodePlugin')
|
||||||
|
|
||||||
supplier_part_data = result.data.get('supplierpart')
|
supplier_part_data = result.data.get('supplierpart')
|
||||||
self.assertIn('pk', supplier_part_data)
|
self.assertIn('pk', supplier_part_data)
|
||||||
@ -84,7 +84,7 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
|||||||
self.SCAN_URL, data={'barcode': DIGIKEY_BARCODE_2}, expected_code=200
|
self.SCAN_URL, data={'barcode': DIGIKEY_BARCODE_2}, expected_code=200
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(result.data['plugin'], 'DigiKeyPlugin')
|
self.assertEqual(result.data['plugin'], 'DigiKeyBarcodePlugin')
|
||||||
|
|
||||||
supplier_part_data = result.data.get('supplierpart')
|
supplier_part_data = result.data.get('supplierpart')
|
||||||
self.assertIn('pk', supplier_part_data)
|
self.assertIn('pk', supplier_part_data)
|
||||||
@ -125,7 +125,7 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
|||||||
self.SCAN_URL, data={'barcode': LCSC_BARCODE}, expected_code=200
|
self.SCAN_URL, data={'barcode': LCSC_BARCODE}, expected_code=200
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(result.data['plugin'], 'LCSCPlugin')
|
self.assertEqual(result.data['plugin'], 'LCSCBarcodePlugin')
|
||||||
|
|
||||||
supplier_part_data = result.data.get('supplierpart')
|
supplier_part_data = result.data.get('supplierpart')
|
||||||
self.assertIn('pk', supplier_part_data)
|
self.assertIn('pk', supplier_part_data)
|
||||||
@ -139,7 +139,7 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
|||||||
self.SCAN_URL, data={'barcode': TME_QRCODE}, expected_code=200
|
self.SCAN_URL, data={'barcode': TME_QRCODE}, expected_code=200
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(result.data['plugin'], 'TMEPlugin')
|
self.assertEqual(result.data['plugin'], 'TMEBarcodePlugin')
|
||||||
|
|
||||||
supplier_part_data = result.data.get('supplierpart')
|
supplier_part_data = result.data.get('supplierpart')
|
||||||
self.assertIn('pk', supplier_part_data)
|
self.assertIn('pk', supplier_part_data)
|
||||||
@ -152,7 +152,7 @@ class SupplierBarcodeTests(InvenTreeAPITestCase):
|
|||||||
self.SCAN_URL, data={'barcode': TME_DATAMATRIX_CODE}, expected_code=200
|
self.SCAN_URL, data={'barcode': TME_DATAMATRIX_CODE}, expected_code=200
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(result.data['plugin'], 'TMEPlugin')
|
self.assertEqual(result.data['plugin'], 'TMEBarcodePlugin')
|
||||||
|
|
||||||
supplier_part_data = result.data.get('supplierpart')
|
supplier_part_data = result.data.get('supplierpart')
|
||||||
self.assertIn('pk', supplier_part_data)
|
self.assertIn('pk', supplier_part_data)
|
||||||
@ -271,7 +271,7 @@ class SupplierBarcodePOReceiveTests(InvenTreeAPITestCase):
|
|||||||
expected_code=200,
|
expected_code=200,
|
||||||
)
|
)
|
||||||
|
|
||||||
self.assertEqual(response.data['plugin'], 'DigiKeyPlugin')
|
self.assertEqual(response.data['plugin'], 'DigiKeyBarcodePlugin')
|
||||||
self.assertIn('action_required', response.data)
|
self.assertIn('action_required', response.data)
|
||||||
item = response.data['lineitem']
|
item = response.data['lineitem']
|
||||||
self.assertEqual(item['quantity'], 10.0)
|
self.assertEqual(item['quantity'], 10.0)
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
"""The TMEPlugin is meant to integrate the TME API into InvenTree.
|
"""The TMEBarcodePlugin is meant to integrate the TME API into InvenTree.
|
||||||
|
|
||||||
This plugin can currently only match TME barcodes to supplier parts.
|
This plugin can currently only match TME barcodes to supplier parts.
|
||||||
"""
|
"""
|
||||||
@ -14,7 +14,8 @@ from plugin.mixins import SettingsMixin, SupplierBarcodeMixin
|
|||||||
class TMEPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
class TMEPlugin(SupplierBarcodeMixin, SettingsMixin, InvenTreePlugin):
|
||||||
"""Plugin to integrate the TME API into InvenTree."""
|
"""Plugin to integrate the TME API into InvenTree."""
|
||||||
|
|
||||||
NAME = 'TMEPlugin'
|
NAME = 'TMEBarcodePlugin'
|
||||||
|
SLUG = 'tmeplugin'
|
||||||
TITLE = _('Supplier Integration - TME')
|
TITLE = _('Supplier Integration - TME')
|
||||||
DESCRIPTION = _('Provides support for scanning TME barcodes')
|
DESCRIPTION = _('Provides support for scanning TME barcodes')
|
||||||
VERSION = '1.0.1'
|
VERSION = '1.0.1'
|
||||||
|
Reference in New Issue
Block a user