mirror of
https://github.com/inventree/InvenTree.git
synced 2025-07-02 03:30:54 +00:00
Label plugin refactor (#5251)
* Add skeleton for builtin label printing plugin * Force selection of plugin when printing labels * Enhance LabelPrintingMixin class - Add render_to_pdf method - Add render_to_html method * Enhance plugin mixin - Add class attribute to select blocking or non-blocking printing - Add render_to_png method - Add default method for printing multiple labels - Add method for offloding print job * Simplify print_label background function - All arguments now handled by specific plugin * Simplify label printing API - Simply pass data to the particular plugin - Check result type - Return result * Updated sample plugin * Working on client side code * Cleanup * Update sample plugin * Add new model type - LabelOutput model - Stores generated label file to the database - Makes available for download * Update label printing plugin mixin * Add background task to remove any old label outputs * Open file if response contains filename * Remove "default printer" option which does not specify a plugin * Delete old labels after 5 days * Remove debug statements * Update API version * Changed default behaviour to background printing * Update label plugin mixin docs * Provide default printer if none provided (legacy) * Update unit test * unit test updates * Further fixes for unit tests * unit test updates
This commit is contained in:
@ -1794,7 +1794,7 @@ class InvenTreeSetting(BaseInvenTreeSetting):
|
||||
|
||||
def label_printer_options():
|
||||
"""Build a list of available label printer options."""
|
||||
printers = [('', _('No Printer (Export to PDF)'))]
|
||||
printers = []
|
||||
label_printer_plugins = registry.with_mixin('labels')
|
||||
if label_printer_plugins:
|
||||
printers.extend([(p.slug, p.name + ' - ' + p.human_name) for p in label_printer_plugins])
|
||||
|
Reference in New Issue
Block a user