[FIX] base_report_to_printer: update printers wizard

- Add access rules to the wizard
- Set a fallback name for the printers and respect the user custom ones

TT45159
This commit is contained in:
David
2023-09-20 11:19:15 +02:00
committed by trisdoan
parent 43eab67b60
commit 92723f3b7c
5 changed files with 13 additions and 4 deletions

View File

@@ -121,6 +121,11 @@ class PrintingServer(models.Model):
printer_values["server_id"] = server.id
updated_printers.append(name)
# We want to keep any existing customized name over existing printer
# We want also to rely in the system name as a fallback to avoid
# empty names.
if not printer_values.get("name") and not printer.name:
printer_values["name"] = name
if not printer:
printer_values["system_name"] = name
printer.create(printer_values)