[IMP] base_report_to_printer: Add test coverage

* Add test coverage
* Minor touch ups in wizard
* Prefer UserError to Warning
This commit is contained in:
Dave Lasley
2016-07-05 17:12:08 -07:00
parent 4b080d7a63
commit 8e896af6a9
9 changed files with 359 additions and 8 deletions

View File

@@ -26,9 +26,8 @@ class PrintingPrinterUpdateWizard(models.TransientModel):
_name = 'printing.printer.update.wizard'
_description = 'Printing Printer Update Wizard'
@api.multi
@api.model
def action_ok(self):
self.ensure_one()
# Update Printers
printer_obj = self.env['printing.printer']
try:
@@ -57,7 +56,7 @@ class PrintingPrinterUpdateWizard(models.TransientModel):
'location': printer.get('printer-location', False),
'uri': printer.get('device-uri', False),
}
self.env['printing.printer'].create(values)
printer_obj.create(values)
_logger.info(
'Created new printer %s with URI %s'
% (values['name'], values['uri']))