diff --git a/README.md b/README.md index 6df09a7..209206e 100644 --- a/README.md +++ b/README.md @@ -35,9 +35,15 @@ The plugin can be found here: [inventree-kicad-plugin](https://pypi.org/project/ ## Configure Plugin Settings -After installing the plugin, head over to the Plugin Settings and activate it. Look for **KiCadLibraryPlugin** in the list of available plugins. Once activated, you'll be able to open the plugin and proceed with the setup process. +After installing the plugin, head over to the Plugin Settings and activate it. Look for **KiCadLibraryPlugin** in the list of available plugins. + +![image](https://raw.githubusercontent.com/afkiwers/inventree_kicad/main/images/plugin_settings.png) + + +Once activated, you'll see a new plugin **KiCad Library Endpoint** on the left hand side. Click on it to open the plugin and proceed with the setup process. + +![image](https://raw.githubusercontent.com/afkiwers/inventree_kicad/main/images/new_plugin.png) -![image](https://raw.githubusercontent.com/afkiwers/inventree_kicad/main/images/admin_add_change_categories.png) ## Adding Categories to KiCad diff --git a/images/new_plugin.png b/images/new_plugin.png new file mode 100644 index 0000000..13a9e1c Binary files /dev/null and b/images/new_plugin.png differ diff --git a/images/plugin_settings.png b/images/plugin_settings.png new file mode 100644 index 0000000..350b03e Binary files /dev/null and b/images/plugin_settings.png differ diff --git a/inventree_kicad/KiCadLibraryPlugin.py b/inventree_kicad/KiCadLibraryPlugin.py index b036db0..672da03 100644 --- a/inventree_kicad/KiCadLibraryPlugin.py +++ b/inventree_kicad/KiCadLibraryPlugin.py @@ -58,11 +58,10 @@ class KiCadLibraryPlugin(UrlsMixin, AppMixin, SettingsMixin, SettingsContentMixi 'default': True, }, 'KICAD_INCLUDE_IPN': { - 'name': _('Include IPN in part fields'), - 'description': _( - 'When activated, the IPN is included in the KiCad fields for a part'), - 'validator': bool, - 'default': False, + 'name': _('Include IPN'), + 'description': _('When activated, the IPN is included in the KiCad fields for a part'), + 'choices': [('0', 'Do not Include'), ('False', 'Include but Hide in Schematic'), ('True', 'Include and Show in Schematic')], + 'default': '0', }, 'KICAD_META_DATA_IMPORT_ADD_DATASHEET': { 'name': _('Add datasheet if URL is valid'), diff --git a/inventree_kicad/serializers.py b/inventree_kicad/serializers.py index 80c9a7d..2a77823 100644 --- a/inventree_kicad/serializers.py +++ b/inventree_kicad/serializers.py @@ -3,7 +3,6 @@ from rest_framework import serializers from rest_framework.reverse import reverse_lazy -from InvenTree.helpers import str2bool from InvenTree.helpers_model import construct_absolute_url from part.models import Part, PartCategory, PartParameter @@ -276,10 +275,10 @@ def get_custom_fields(self, part, excluded_field_names): } } - if str2bool(self.plugin.get_setting('KICAD_INCLUDE_IPN', False)): + if self.plugin.get_setting('KICAD_INCLUDE_IPN', '0') != '0': fields['IPN'] = { 'value': f'{part.IPN}', - 'visible': 'False' + 'visible': self.plugin.get_setting('KICAD_INCLUDE_IPN', 'False') } for parameter in part.parameters.all(): diff --git a/inventree_kicad/version.py b/inventree_kicad/version.py index 397fdb4..e56b49b 100644 --- a/inventree_kicad/version.py +++ b/inventree_kicad/version.py @@ -1 +1 @@ -KICAD_PLUGIN_VERSION = "1.3.15" +KICAD_PLUGIN_VERSION = "1.3.16"