You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FR] Possibility to save more than one Brother printer / configuration #3555
Tonight I also thought about Auto selecting the tape size based on the stocklocation type (no idea how to store the type). E.g. I have little drawers with different sizes which each also need different label sizes.
Allow the brother-printer-plugin to auto-detect the width of the label (based on the label template) and select the tape accordingly
Configure the different labels to match different locations
You can configure each label template with "filters" to match certain items. e.g. for a stocklocation label, filter like name="boxes" (or something similar)
You can configure each label template with "filters" to match certain items. e.g. for a stocklocation label, filter like name="boxes" (or something similar)
Filtering by name would not fit my needs, as I'm having different drawers which are all named the same, but differ in the size so the label slot is also longer.
I think a way of allowing multiple "instances" of a plugin would provide the functionality you need here. I'm just not sure how to implement that or if it is even possible. @matmair any ideas?
At the moment, changing the key (eg on http://ubuntuvm:8000/api/plugin/18/) is allowed, but this plugin then forgets its metadata, so it is no longer recognised.
I imagine having multiple instances isn't only relevant for label printers - potentially, API calls (external site with different user names?), schedules with different command arguments,... could be further examples.
..I've started on something which might work. I'll keep you posted :)
The current system is not designed to support multiple instances and I think implementing that would be a bad idea as it would make plugin development harder.
You could add a model that holds plugin instances and reference settings to that. But that would require plugin creators to be aware of the possibility that the same plugin is running at the same time. The second you start writing config files etc. it gets tricky as plugins might interfere with each other.
Therefore I think this should be handled by the plugin in question.
As for the examples that @miggland listed: API calls are often limited, a single plugin should handle those to ensure call-limits are not broken; you can dynamically name your schedules - that is core functionality; I do not think a valid point towards multiple instances in core plugins is made. In theory, it could be added as a mixin or just be a 3rd party mixin - that is also possible.
This does seem like it's an untenable approach with the current system. My suggestion would be to adjust the tape width setting each time you change the tape in the printer.
@miggland if you have any further discussion of this please direct over to the plugin repo. Multiple plugin instances is in the "too hard basket" for now.
I agree it's not easy, but I can't see that it'll be a problem for plugin developers (who as a programmer assumes their code will only ever run in one instance??). I think putting multiple configurations in each plugin is the wrong way to go, meaning each plugin developer will have to solve the same problem...
I've fixed my problem by downloading the PDF and printing it via command line. Much easier, and more flexible (plus, gets around the installation problem in the current stable branch..)
@wolflu05 sorry, not sure what you mean here. Can you expand a bit?
@SchrodingersGat There are label printer which print from a coil of presized labels which have fix dimensions [1]. But there are also labels which are on a tape and the printer cut it as long as you want [2].
Hope this makes it clear. So tape labels can be as long as you want that the labels be. And you said, the I have to adjust the labels size each time I chains the coil of labels.
Ideally I want to save the kind of storage box for a stock location and decide on that how long my tape should be.
I agree it's not easy, but I can't see that it'll be a problem for plugin developers (who as a programmer assumes their code will only ever run in one instance??). I think putting multiple configurations in each plugin is the wrong way to go, meaning each plugin developer will have to solve the same problem...
I can fully agree to that. I think this is a problem where every plugin developer has to deal with. What about defining an option ALLOW_MULTIPLE_INSTANCES next to name, slug and description as plugin class variable? So the developer can say no, my plugins my interfer with each other if there are multiple instances or no, they might work fine with different configs. Otherwise each plugin developer has to implement the AppMixin to create some kind of array system which holds different configs as it's not possible with the SettingsMixin. And even if it would be possible, I think it's much easier for a developer to just set a ALLOW_MULTIPLE_INSTANCES = True.
These are my thoughts on this topic and I think, this issue needs to be reopened.
@wolflu05 it takes 4 lines to create multiarray settings.
If this is of interest please create a clean FR with all details.
Our target audience for plugins is the general user base. Plugins should be easy to create and share even for ppl. not to familiar with debian. That is why there are so many domain-specific mixins: do keep the plugins small and easy to understand. The goal is an octoprint-like plugin scene in which InvenTree is the reliable base but plugins solve niche problems.
Activity
matmair commentedon Aug 16, 2022
@miggland this seems off-topic to me, please submit issues with a plugin to the right plugin https://github.com/inventree/inventree-brother-plugin
miggland commentedon Aug 16, 2022
Is it something to be solved by the Brother plugin though? I believe this applies to all label printers..
wolflu05 commentedon Aug 16, 2022
Isnt it possible to enable the plugin multiple times? I remember seeing these Button in Django admin. But I have no idea if it will work so easily.
SchrodingersGat commentedon Aug 16, 2022
I'm not sure how we would add multiple "copies" of a plugin like you are requesting.
What if we updated the plugin to allow the tape width to be automatically selected based on the dimensions of the label being printed?
wolflu05 commentedon Aug 16, 2022
Tonight I also thought about Auto selecting the tape size based on the stocklocation type (no idea how to store the type). E.g. I have little drawers with different sizes which each also need different label sizes.
SchrodingersGat commentedon Aug 16, 2022
I think a cleaner solution would be:
You can configure each label template with "filters" to match certain items. e.g. for a stocklocation label, filter like
name="boxes"(or something similar)miggland commentedon Aug 17, 2022
That would solve the first part - but what about having multiple printers?
Isn't
label_instanceactually useful here?InvenTree/InvenTree/plugin/base/label/label.py
Line 18 in 1d4a20d
wolflu05 commentedon Aug 17, 2022
Filtering by name would not fit my needs, as I'm having different drawers which are all named the same, but differ in the size so the label slot is also longer.
SchrodingersGat commentedon Aug 17, 2022
I think a way of allowing multiple "instances" of a plugin would provide the functionality you need here. I'm just not sure how to implement that or if it is even possible. @matmair any ideas?
miggland commentedon Aug 17, 2022
At the moment, changing the key (eg on
http://ubuntuvm:8000/api/plugin/18/) is allowed, but this plugin then forgets its metadata, so it is no longer recognised.I imagine having multiple instances isn't only relevant for label printers - potentially, API calls (external site with different user names?), schedules with different command arguments,... could be further examples.
..I've started on something which might work. I'll keep you posted :)
matmair commentedon Aug 17, 2022
The current system is not designed to support multiple instances and I think implementing that would be a bad idea as it would make plugin development harder.
You could add a model that holds plugin instances and reference settings to that. But that would require plugin creators to be aware of the possibility that the same plugin is running at the same time. The second you start writing config files etc. it gets tricky as plugins might interfere with each other.
Therefore I think this should be handled by the plugin in question.
As for the examples that @miggland listed: API calls are often limited, a single plugin should handle those to ensure call-limits are not broken; you can dynamically name your schedules - that is core functionality; I do not think a valid point towards multiple instances in core plugins is made. In theory, it could be added as a mixin or just be a 3rd party mixin - that is also possible.
SchrodingersGat commentedon Aug 17, 2022
This does seem like it's an untenable approach with the current system. My suggestion would be to adjust the tape width setting each time you change the tape in the printer.
1 remaining item
SchrodingersGat commentedon Aug 18, 2022
@wolflu05 sorry, not sure what you mean here. Can you expand a bit?
matmair commentedon Aug 18, 2022
I am sorry to bring this up again but this is clearly a discussion about https://github.com/inventree/inventree-brother-plugin - a plugin which has its own repo for discussions.
If we start mixing core-project and plugin issues the noise will become unmaintainable with a growing number of plugins.
matmair commentedon Aug 18, 2022
@SchrodingersGat I would suggest writing a conclusion - i.e. that something needs to change or not - and then locking this as off-topic.
SchrodingersGat commentedon Aug 18, 2022
@matmair fair point!
@miggland if you have any further discussion of this please direct over to the plugin repo. Multiple plugin instances is in the "too hard basket" for now.
miggland commentedon Aug 18, 2022
I agree it's not easy, but I can't see that it'll be a problem for plugin developers (who as a programmer assumes their code will only ever run in one instance??). I think putting multiple configurations in each plugin is the wrong way to go, meaning each plugin developer will have to solve the same problem...
I've fixed my problem by downloading the PDF and printing it via command line. Much easier, and more flexible (plus, gets around the installation problem in the current stable branch..)
wolflu05 commentedon Aug 18, 2022
@SchrodingersGat There are label printer which print from a coil of presized labels which have fix dimensions [1]. But there are also labels which are on a tape and the printer cut it as long as you want [2].
Hope this makes it clear. So tape labels can be as long as you want that the labels be. And you said, the I have to adjust the labels size each time I chains the coil of labels.
Ideally I want to save the kind of storage box for a stock location and decide on that how long my tape should be.
wolflu05 commentedon Aug 18, 2022
I can fully agree to that. I think this is a problem where every plugin developer has to deal with. What about defining an option
ALLOW_MULTIPLE_INSTANCESnext to name, slug and description as plugin class variable? So the developer can say no, my plugins my interfer with each other if there are multiple instances or no, they might work fine with different configs. Otherwise each plugin developer has to implement the AppMixin to create some kind of array system which holds different configs as it's not possible with the SettingsMixin. And even if it would be possible, I think it's much easier for a developer to just set aALLOW_MULTIPLE_INSTANCES = True.These are my thoughts on this topic and I think, this issue needs to be reopened.
matmair commentedon Aug 18, 2022
Ok i locked this now as this was continuing to be about a specific plugin
matmair commentedon Aug 18, 2022
@wolflu05 it takes 4 lines to create multiarray settings.
If this is of interest please create a clean FR with all details.
Our target audience for plugins is the general user base. Plugins should be easy to create and share even for ppl. not to familiar with debian. That is why there are so many domain-specific mixins: do keep the plugins small and easy to understand. The goal is an octoprint-like plugin scene in which InvenTree is the reliable base but plugins solve niche problems.