Simplify barcode plugin class

This commit is contained in:
Oliver Walters 2022-11-02 22:00:36 +11:00
parent 7b374ec2f1
commit bfe5c40fae
3 changed files with 14 additions and 18 deletions

View File

@ -19,8 +19,14 @@ from plugin.mixins import BarcodeMixin
from stock.models import StockItem, StockLocation
class InvenTreeBarcodePlugin(BarcodeMixin, InvenTreePlugin):
"""Generic base class for handling InvenTree barcodes"""
class InvenTreeInternalBarcodePlugin(BarcodeMixin, InvenTreePlugin):
"""Builtin BarcodePlugin for matching and generating internal barcodes."""
NAME = "InvenTreeInternalBarcode"
TITLE = _("Inventree Barcodes")
DESCRIPTION = _("Provides native support for barcodes")
VERSION = "2.0"
AUTHOR = _("InvenTree contributors")
@staticmethod
def get_supported_barcode_models():
@ -60,16 +66,6 @@ class InvenTreeBarcodePlugin(BarcodeMixin, InvenTreePlugin):
return response
class InvenTreeInternalBarcodePlugin(InvenTreeBarcodePlugin):
"""Builtin BarcodePlugin for matching and generating internal barcodes."""
NAME = "InvenTreeInternalBarcode"
TITLE = _("Inventree Barcodes")
DESCRIPTION = _("Provides native support for barcodes")
VERSION = "2.0"
AUTHOR = _("InvenTree contributors")
def scan(self, barcode_data):
"""Scan a barcode against this plugin.

View File

@ -30,7 +30,7 @@ class CoreNotificationsPlugin(SettingsMixin, InvenTreePlugin):
TITLE = _("InvenTree Notifications")
AUTHOR = _('InvenTree contributors')
DESCRIPTION = _('Integrated outgoing notificaton methods')
VERSION = "0.1"
VERSION = "1.0"
SETTINGS = {
'ENABLE_NOTIFICATION_EMAILS': {

View File

@ -23,16 +23,16 @@
<td>{% trans "Name" %}</td>
<td>{{ plugin.human_name }}{% include "clip.html" %}</td>
</tr>
<tr>
<td><span class='fas fa-user'></span></span></td>
<td>{% trans "Author" %}</td>
<td>{{ plugin.author }}{% include "clip.html" %}</td>
</tr>
<tr>
<td></td>
<td>{% trans "Description" %}</td>
<td>{{ plugin.description }}{% include "clip.html" %}</td>
</tr>
<tr>
<td><span class='fas fa-user'></span></span></td>
<td>{% trans "Author" %}</td>
<td>{{ plugin.author }}{% include "clip.html" %}</td>
</tr>
<tr>
<td><span class='fas fa-calendar-alt'></span></td>
<td>{% trans "Date" %}</td>