From 4dcf26232d78247aa08e393eab37d8b11b57347e Mon Sep 17 00:00:00 2001 From: Graeme Gellatly Date: Thu, 5 Oct 2017 05:28:05 +1300 Subject: [PATCH] [IMP] Minor usability fix, order trays alphabetically, name xml groups --- printer_tray/models/printing_tray.py | 2 ++ printer_tray/tests/__init__.py | 2 +- ...est_ir_actions_report_xml.py => test_ir_actions_report.py} | 0 printer_tray/tests/test_printing_printer.py | 2 +- printer_tray/views/printing_printer.xml | 4 ++-- 5 files changed, 6 insertions(+), 4 deletions(-) rename printer_tray/tests/{test_ir_actions_report_xml.py => test_ir_actions_report.py} (100%) diff --git a/printer_tray/models/printing_tray.py b/printer_tray/models/printing_tray.py index 6f045ba..da12e70 100644 --- a/printer_tray/models/printing_tray.py +++ b/printer_tray/models/printing_tray.py @@ -9,6 +9,8 @@ class PrinterTray(models.Model): _name = 'printing.tray' _description = 'Printer Tray' + _order = 'name asc' + name = fields.Char(required=True) system_name = fields.Char(required=True, readonly=True) printer_id = fields.Many2one( diff --git a/printer_tray/tests/__init__.py b/printer_tray/tests/__init__.py index 481d9b7..09189b6 100644 --- a/printer_tray/tests/__init__.py +++ b/printer_tray/tests/__init__.py @@ -2,7 +2,7 @@ # Copyright 2016 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from . import test_ir_actions_report_xml +from . import test_ir_actions_report from . import test_printing_printer from . import test_printing_report_xml_action from . import test_printing_tray diff --git a/printer_tray/tests/test_ir_actions_report_xml.py b/printer_tray/tests/test_ir_actions_report.py similarity index 100% rename from printer_tray/tests/test_ir_actions_report_xml.py rename to printer_tray/tests/test_ir_actions_report.py diff --git a/printer_tray/tests/test_printing_printer.py b/printer_tray/tests/test_printing_printer.py index 336b1e0..7fe7dcb 100644 --- a/printer_tray/tests/test_printing_printer.py +++ b/printer_tray/tests/test_printing_printer.py @@ -280,7 +280,7 @@ class TestPrintingPrinter(TransactionCase): cups_printer = connection.getPrinters()[self.printer.system_name] vals = self.printer._prepare_update_from_cups(connection, cups_printer) - self.assertEqual(vals['tray_ids'], [(0, 0, { + self.assertItemsEqual(vals['tray_ids'], [(0, 0, { 'name': 'Auto (Default)', 'system_name': 'Auto', }), (0, 0, { diff --git a/printer_tray/views/printing_printer.xml b/printer_tray/views/printing_printer.xml index 411b796..3c6d4c1 100644 --- a/printer_tray/views/printing_printer.xml +++ b/printer_tray/views/printing_printer.xml @@ -7,10 +7,10 @@ - +
- +