Skip to content

[FR] Possibility to save more than one Brother printer / configuration #3555

Closed

Description

@miggland

Please verify that this feature request has NOT been suggested before.

  • I checked and didn't find similar feature request

Problem statement

Two scenarios:

  • the labels in the label printer are changed to ones of different size
  • I want to use label printers in different locations, both brother

At the moment, this requires me to reconfigure the plugin. Having different configurations to choose from would be great.

Suggested solution

Add a plugin configuration which points to the same backend, but has a different key - and thus different configuration options.

Describe alternatives you've considered

This could also be done by constant reconfigurations...

Examples of other systems

No response

Do you want to develop this?

  • I want to develop this.

Activity

  1. added
    enhancement
    triage:not-checked
    on Aug 16, 2022
  2. matmair commented on Aug 16, 2022

    @matmair
    Member
  3. removed
    triage:not-checked
    on Aug 16, 2022
  4. miggland commented on Aug 16, 2022

    @miggland
    ContributorAuthor

    Is it something to be solved by the Brother plugin though? I believe this applies to all label printers..

  5. wolflu05 commented on Aug 16, 2022

    @wolflu05
    Member

    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.

  6. SchrodingersGat commented on Aug 16, 2022

    @SchrodingersGat
    Member

    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?

  7. wolflu05 commented on Aug 16, 2022

    @wolflu05
    Member

    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.

  8. SchrodingersGat commented on Aug 16, 2022

    @SchrodingersGat
    Member

    I think a cleaner solution would be:

    1. Allow the brother-printer-plugin to auto-detect the width of the label (based on the label template) and select the tape accordingly
    2. 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)

  9. miggland commented on Aug 17, 2022

    @miggland
    ContributorAuthor

    That would solve the first part - but what about having multiple printers?

    Isn't label_instance actually useful here?

    def print_label(plugin_slug: str, pdf_data, filename=None, label_instance=None, user=None):

  10. wolflu05 commented on Aug 17, 2022

    @wolflu05
    Member

    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.

  11. SchrodingersGat commented on Aug 17, 2022

    @SchrodingersGat
    Member

    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?

  12. miggland commented on Aug 17, 2022

    @miggland
    ContributorAuthor

    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 :)

  13. matmair commented on Aug 17, 2022

    @matmair
    Member

    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.

  14. SchrodingersGat commented on Aug 17, 2022

    @SchrodingersGat
    Member

    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.

  15. 1 remaining item

  16. SchrodingersGat commented on Aug 18, 2022

    @SchrodingersGat
    Member

    @wolflu05 sorry, not sure what you mean here. Can you expand a bit?

  17. matmair commented on Aug 18, 2022

    @matmair
    Member

    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.

  18. matmair commented on Aug 18, 2022

    @matmair
    Member

    @SchrodingersGat I would suggest writing a conclusion - i.e. that something needs to change or not - and then locking this as off-topic.

  19. SchrodingersGat commented on Aug 18, 2022

    @SchrodingersGat
    Member

    @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.

  20. added
    question
    wontfix
    plugin
    and removed
    enhancement
    on Aug 18, 2022
  21. miggland commented on Aug 18, 2022

    @miggland
    ContributorAuthor

    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..)

  22. wolflu05 commented on Aug 18, 2022

    @wolflu05
    Member

    @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.

  23. wolflu05 commented on Aug 18, 2022

    @wolflu05
    Member

    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.

  24. locked and limited conversation to collaborators on Aug 18, 2022
  25. matmair commented on Aug 18, 2022

    @matmair
    Member

    Ok i locked this now as this was continuing to be about a specific plugin

  26. matmair commented on Aug 18, 2022

    @matmair
    Member

    @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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    pluginquestionwontfix

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions