[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
parent 8a21ba8261
commit 1d45dac7ef
5 changed files with 13 additions and 4 deletions

View File

@@ -70,7 +70,7 @@ class PrintingPrinter(models.Model):
def _prepare_update_from_cups(self, cups_connection, cups_printer):
mapping = {3: "available", 4: "printing", 5: "error"}
cups_vals = {
"name": cups_printer["printer-info"],
"name": self.name or cups_printer["printer-info"],
"model": cups_printer.get("printer-make-and-model", False),
"location": cups_printer.get("printer-location", False),
"uri": cups_printer.get("device-uri", False),