Printer mapping

Hello community,

where can I change the printer mapping after I linked a printer to a specific doctype?

Can’t find anything with awesome search bar or anything.

thanks in adanvce

no one?

In ERPNext, printer mappings for specific DocTypes are managed through the Print Settings and Print Format configurations. If you have linked a printer to a specific DocType and need to change this mapping, you will need to update the relevant settings.

Steps to Change Printer Mapping for a Specific DocType

  1. Access Print Settings:

    • Go to Settings.
    • Navigate to Print Settings.
  2. Modify Printer Settings:

    • In Print Settings, you can set default printers for different document types. This setting generally applies globally.
  3. Check Print Format:

    • Go to Print Format list by searching for Print Format in the awesome search bar.
    • Open the specific Print Format you want to modify.
    • Ensure the correct printer settings are applied here.

Specific Printer Mapping for a DocType

If you are using custom scripts or configurations to manage printer mappings for specific DocTypes, you might need to update the configuration in your custom scripts or the respective server-side code.

Example: Changing Printer Mapping via Custom Script

If a custom script is handling the printer mapping, locate the script and update the relevant lines of code.

  1. Go to Custom Script:

    • Navigate to Custom Script from the awesome search bar.
  2. Edit the Relevant Script:

    • Find the custom script linked to your DocType.
    • Modify the printer settings within the script.

Here is an example of how you might set a printer in a custom script:

frappe.ui.form.on('Sales Invoice', {
    print_doc: function(frm) {
        // Custom script to set printer
        frm.set_df_property('printer', 'options', ['Printer1', 'Printer2', 'Printer3']);
        frm.set_value('printer', 'Printer2');  // Set the default printer
        frm.print();
    }
});

Specific Scenario: Using Print Format Mappings

If your printer mapping logic is tied to specific print formats, ensure you update the correct print format.

  1. Navigate to Print Format:

    • Go to Print Format via the awesome search bar.
    • Select the print format linked to your DocType.
  2. Edit Printer Settings:

    • Modify any printer-related settings within the print format.

Final Steps

  • Check User Permissions: Ensure the user attempting to change the printer settings has the appropriate permissions to modify print formats and settings.
  • Clear Cache: After making changes, clear the cache to ensure the settings take effect.
    bench clear-cache
    

@AmeerBaathar thank you very much. Unfortunately I can’t see any setting to set printers per document type (see screenshot=

I usually check the Print Settings first to see if I can switch the default printer there. If that doesn’t do it, I dig into the Print Format linked to the doctype and tweak the settings. One time, I had to fix it through a custom script—just searched for “Custom Script,” found the right one, and updated it.
Also, while messing with my setup, I came across some good options for the cheapest dtf printer. If you’re thinking of upgrading, it’s worth a look. Saved me a headache when I needed something reliable.