[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

@@ -40,7 +40,7 @@ class TestPrintingPrinter(TransactionCase):
self.server = self.env["printing.server"].create({})
self.printer = self.env["printing.printer"].create(
{
"name": "Printer",
"name": "",
"server_id": self.server.id,
"system_name": "Sys Name",
"default": True,
@@ -105,10 +105,11 @@ class TestPrintingPrinter(TransactionCase):
Check that the update_printers method calls _prepare_update_from_cups
"""
self.mock_cups_ppd(cups, file_name=False)
self.assertEqual(self.printer.name, "Printer")
self.ServerModel.update_printers()
self.assertEqual(self.printer.name, "info")
self.printer.name = "My custom name"
self.ServerModel.update_printers()
self.assertEqual(self.printer.name, "My custom name")
@mock.patch("%s.cups" % server_model)
def test_prepare_update_from_cups_no_ppd(self, cups):