[IMP] Minor usability fix, order trays alphabetically, name xml groups

This commit is contained in:
Graeme Gellatly
2017-10-05 05:28:05 +13:00
parent 8bfea53fec
commit 4dcf26232d
5 changed files with 6 additions and 4 deletions

View File

@@ -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(

View File

@@ -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

View File

@@ -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, {

View File

@@ -7,10 +7,10 @@
<field name="inherit_id" ref="base_report_to_printer.printing_printer_view_form"/>
<field name="arch" type="xml">
<xpath expr="//sheet/group[3]" position="after">
<group string="Trays">
<group string="Trays" name="trays">
<field name="tray_ids" nolabel="1">
<form>
<group>
<group name="name_fields">
<field name="name"/>
<field name="system_name"/>
</group>