mirror of
https://github.com/OCA/report-print-send.git
synced 2025-02-16 07:11:31 +02:00
[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:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user