From 9c12be1f308c7337fca999f2ad7ab3b94e301de2 Mon Sep 17 00:00:00 2001 From: vrenaville Date: Mon, 12 Oct 2015 14:00:04 +0200 Subject: [PATCH 1/9] typo, tray_id doesn't exist only printer_tray_id exist on the object --- printer_tray/printer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer_tray/printer.py b/printer_tray/printer.py index 3030ea0..ebbf735 100644 --- a/printer_tray/printer.py +++ b/printer_tray/printer.py @@ -93,7 +93,7 @@ class Printer(models.Model): ('action', '!=', 'user_default')], limit=1) if action and action.printer_tray_id: - tray = action.tray_id + tray = action.printer_tray_id if tray: options['InputSlot'] = str(tray.system_name) From 121c2b10e2608388f228884e62a755de1d15a437 Mon Sep 17 00:00:00 2001 From: Yannick Vaucher Date: Tue, 24 Nov 2015 14:04:01 +0100 Subject: [PATCH 2/9] FIX typo in previous merge --- printer_tray/printer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer_tray/printer.py b/printer_tray/printer.py index ebbf735..33ed768 100644 --- a/printer_tray/printer.py +++ b/printer_tray/printer.py @@ -92,7 +92,7 @@ class Printer(models.Model): ('user_id', '=', self.env.uid), ('action', '!=', 'user_default')], limit=1) - if action and action.printer_tray_id: + if action.printer_tray_id: tray = action.printer_tray_id if tray: From b6e7a78529899332a4a3eaf5a2e220644b8ed617 Mon Sep 17 00:00:00 2001 From: Maik Steinfeld Date: Mon, 4 Jan 2016 09:24:31 +0100 Subject: [PATCH 3/9] FIX: print with copies and installed printer_tray module Added new Argument to printer_tray also. --- printer_tray/printer.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/printer_tray/printer.py b/printer_tray/printer.py index 33ed768..f2790cb 100644 --- a/printer_tray/printer.py +++ b/printer_tray/printer.py @@ -74,7 +74,7 @@ class Printer(models.Model): return vals @api.multi - def print_options(self, report, format): + def print_options(self, report, format, copies=1): """ Hook to define Tray """ printing_act_obj = self.env['printing.report.xml.action'] options = super(Printer, self).print_options(report, format) From 3cb350c945ebbec45b9b17812d70490f5c44acbc Mon Sep 17 00:00:00 2001 From: OCA Transbot Date: Sun, 31 Jul 2016 10:29:53 -0400 Subject: [PATCH 4/9] OCA Transbot updated translations from Transifex --- printer_tray/i18n/am.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/bg.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/ca.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/de.po | 108 +++++++++++++++++++++++++++++++++++++ printer_tray/i18n/el_GR.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/es.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/es_ES.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/fi.po | 107 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/fr.po | 50 +++++++++++------ printer_tray/i18n/gl.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/hr.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/hr_HR.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/it.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/nl.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/pt.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/pt_BR.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/pt_PT.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/sl.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/tr.po | 106 ++++++++++++++++++++++++++++++++++++ printer_tray/i18n/zh_CN.po | 106 ++++++++++++++++++++++++++++++++++++ 20 files changed, 2051 insertions(+), 16 deletions(-) create mode 100644 printer_tray/i18n/am.po create mode 100644 printer_tray/i18n/bg.po create mode 100644 printer_tray/i18n/ca.po create mode 100644 printer_tray/i18n/de.po create mode 100644 printer_tray/i18n/el_GR.po create mode 100644 printer_tray/i18n/es.po create mode 100644 printer_tray/i18n/es_ES.po create mode 100644 printer_tray/i18n/fi.po create mode 100644 printer_tray/i18n/gl.po create mode 100644 printer_tray/i18n/hr.po create mode 100644 printer_tray/i18n/hr_HR.po create mode 100644 printer_tray/i18n/it.po create mode 100644 printer_tray/i18n/nl.po create mode 100644 printer_tray/i18n/pt.po create mode 100644 printer_tray/i18n/pt_BR.po create mode 100644 printer_tray/i18n/pt_PT.po create mode 100644 printer_tray/i18n/sl.po create mode 100644 printer_tray/i18n/tr.po create mode 100644 printer_tray/i18n/zh_CN.po diff --git a/printer_tray/i18n/am.po b/printer_tray/i18n/am.po new file mode 100644 index 0000000..e3b72a3 --- /dev/null +++ b/printer_tray/i18n/am.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Amharic (https://www.transifex.com/oca/teams/23907/am/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: am\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/bg.po b/printer_tray/i18n/bg.po new file mode 100644 index 0000000..2a47aca --- /dev/null +++ b/printer_tray/i18n/bg.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# Kaloyan Naumov , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: Kaloyan Naumov , 2016\n" +"Language-Team: Bulgarian (https://www.transifex.com/oca/teams/23907/bg/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: bg\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Създадено от" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Създадено на" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Последно обновено на" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Последно обновено от" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Последно обновено на" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Име" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/ca.po b/printer_tray/i18n/ca.po new file mode 100644 index 0000000..942d696 --- /dev/null +++ b/printer_tray/i18n/ca.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Catalan (https://www.transifex.com/oca/teams/23907/ca/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: ca\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creat per" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creat el" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Darrera Actualització per" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Darrera Actualització el" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/de.po b/printer_tray/i18n/de.po new file mode 100644 index 0000000..5755437 --- /dev/null +++ b/printer_tray/i18n/de.po @@ -0,0 +1,108 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +# Ermin Trevisan , 2016 +# Philipp Hug , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: Philipp Hug , 2016\n" +"Language-Team: German (https://www.transifex.com/oca/teams/23907/de/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: de\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Erstellt von" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Erstellt am:" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Anzeigename" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Zuletzt geändert am" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Zuletzt aktualisiert von" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Zuletzt aktualisiert am" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Bezeichnung" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/el_GR.po b/printer_tray/i18n/el_GR.po new file mode 100644 index 0000000..f557fd6 --- /dev/null +++ b/printer_tray/i18n/el_GR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Greek (Greece) (https://www.transifex.com/oca/teams/23907/el_GR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: el_GR\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Δημιουργήθηκε από " + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Δημιουργήθηκε στις" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "Κωδικός" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Τελευταία ενημέρωση από" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Τελευταία ενημέρωση στις" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/es.po b/printer_tray/i18n/es.po new file mode 100644 index 0000000..f7b5230 --- /dev/null +++ b/printer_tray/i18n/es.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (https://www.transifex.com/oca/teams/23907/es/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Nombre mostrado" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Última modificación el" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización el" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Nombre" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/es_ES.po b/printer_tray/i18n/es_ES.po new file mode 100644 index 0000000..0fe71fd --- /dev/null +++ b/printer_tray/i18n/es_ES.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Spanish (Spain) (https://www.transifex.com/oca/teams/23907/es_ES/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: es_ES\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Última actualización por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/fi.po b/printer_tray/i18n/fi.po new file mode 100644 index 0000000..cd65107 --- /dev/null +++ b/printer_tray/i18n/fi.po @@ -0,0 +1,107 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +# Jarmo Kortetjärvi , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: Jarmo Kortetjärvi , 2016\n" +"Language-Team: Finnish (https://www.transifex.com/oca/teams/23907/fi/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: fi\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Luonut" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Luotu" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Nimi" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Viimeksi muokattu" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Viimeksi päivittänyt" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Viimeksi päivitetty" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/fr.po b/printer_tray/i18n/fr.po index 211826d..b898729 100644 --- a/printer_tray/i18n/fr.po +++ b/printer_tray/i18n/fr.po @@ -1,50 +1,62 @@ -# Translation of OpenERP Server. +# Translation of Odoo Server. # This file contains the translation of the following modules: -# * printer_tray -# +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 msgid "" msgstr "" -"Project-Id-Version: OpenERP Server 7.0\n" +"Project-Id-Version: Odoo Server 8.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-01-31 15:44+0000\n" -"PO-Revision-Date: 2014-01-31 16:48+0100\n" -"Last-Translator: Yannick Vaucher \n" -"Language-Team: \n" -"Language: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: French (https://www.transifex.com/oca/teams/23907/fr/)\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" -"Content-Transfer-Encoding: 8bit\n" -"Plural-Forms: \n" +"Content-Transfer-Encoding: \n" +"Language: fr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" #. module: printer_tray #: field:printing.tray,create_uid:0 msgid "Created by" -msgstr "" +msgstr "Créé par" #. module: printer_tray #: field:printing.tray,create_date:0 msgid "Created on" -msgstr "" +msgstr "Date" #. module: printer_tray #: field:res.users,printer_tray_id:0 msgid "Default Printer Paper Source" msgstr "Source de papier par défaut" +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Nom à afficher" + #. module: printer_tray #: field:printing.tray,id:0 msgid "ID" -msgstr "" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Dernière modification le" #. module: printer_tray #: field:printing.tray,write_uid:0 msgid "Last Updated by" -msgstr "" +msgstr "Dernière mise à jour par" #. module: printer_tray #: field:printing.tray,write_date:0 msgid "Last Updated on" -msgstr "" +msgstr "Dernière mise à jour le" #. module: printer_tray #: field:printing.tray,name:0 @@ -53,6 +65,7 @@ msgstr "Nom" #. module: printer_tray #: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 msgid "Paper Source" msgstr "Source de papier" @@ -72,6 +85,11 @@ msgstr "Imprimante" msgid "Printer Tray" msgstr "Bac d'impression" +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + #. module: printer_tray #: field:printing.tray,system_name:0 msgid "System name" diff --git a/printer_tray/i18n/gl.po b/printer_tray/i18n/gl.po new file mode 100644 index 0000000..6b97f92 --- /dev/null +++ b/printer_tray/i18n/gl.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Galician (https://www.transifex.com/oca/teams/23907/gl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: gl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creado en" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "ültima actualización por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Última actualización en" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/hr.po b/printer_tray/i18n/hr.po new file mode 100644 index 0000000..a662ff2 --- /dev/null +++ b/printer_tray/i18n/hr.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: Bole , 2016\n" +"Language-Team: Croatian (https://www.transifex.com/oca/teams/23907/hr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Kreirao" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Kreirano" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Naziv " + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Zadnje modificirano" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnji ažurirao" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Zadnje ažuriranje" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/hr_HR.po b/printer_tray/i18n/hr_HR.po new file mode 100644 index 0000000..4e4c2ab --- /dev/null +++ b/printer_tray/i18n/hr_HR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# Bole , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: Bole , 2016\n" +"Language-Team: Croatian (Croatia) (https://www.transifex.com/oca/teams/23907/hr_HR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: hr_HR\n" +"Plural-Forms: nplurals=3; plural=n%10==1 && n%100!=11 ? 0 : n%10>=2 && n%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2;\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Kreirao" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Kreirano" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Naziv" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Zadnje modificirano" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnji ažurirao" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Zadnje ažurirano" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/it.po b/printer_tray/i18n/it.po new file mode 100644 index 0000000..2c227c9 --- /dev/null +++ b/printer_tray/i18n/it.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Italian (https://www.transifex.com/oca/teams/23907/it/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: it\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Creato da" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Creato il" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Nome da visualizzare" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Ultima modifica il" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Ultimo aggiornamento di" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Ultimo aggiornamento il" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Nome" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "Stampante" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "Azioni di stampa report" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/nl.po b/printer_tray/i18n/nl.po new file mode 100644 index 0000000..5b81982 --- /dev/null +++ b/printer_tray/i18n/nl.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Dutch (https://www.transifex.com/oca/teams/23907/nl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: nl\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Te tonen naam" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Laatst bijgewerkt op" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Naam" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/pt.po b/printer_tray/i18n/pt.po new file mode 100644 index 0000000..db68319 --- /dev/null +++ b/printer_tray/i18n/pt.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (https://www.transifex.com/oca/teams/23907/pt/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Criado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Criado em" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Atualizado pela última vez por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Atualizado pela última vez em" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/pt_BR.po b/printer_tray/i18n/pt_BR.po new file mode 100644 index 0000000..82fb4a2 --- /dev/null +++ b/printer_tray/i18n/pt_BR.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (Brazil) (https://www.transifex.com/oca/teams/23907/pt_BR/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_BR\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Criado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Criado em" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Nome para Mostrar" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "Identificação" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Última atualização em" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Última atualização por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Última atualização em" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/pt_PT.po b/printer_tray/i18n/pt_PT.po new file mode 100644 index 0000000..a1ce3a6 --- /dev/null +++ b/printer_tray/i18n/pt_PT.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Portuguese (Portugal) (https://www.transifex.com/oca/teams/23907/pt_PT/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: pt_PT\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Criado por" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Criado em" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Atualizado pela última vez por" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Atualizado pela última vez em" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/sl.po b/printer_tray/i18n/sl.po new file mode 100644 index 0000000..e2a93cd --- /dev/null +++ b/printer_tray/i18n/sl.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# Matjaž Mozetič , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-07-12 10:08+0000\n" +"PO-Revision-Date: 2016-07-12 10:08+0000\n" +"Last-Translator: Matjaž Mozetič , 2016\n" +"Language-Team: Slovenian (https://www.transifex.com/oca/teams/23907/sl/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: sl\n" +"Plural-Forms: nplurals=4; plural=(n%100==1 ? 0 : n%100==2 ? 1 : n%100==3 || n%100==4 ? 2 : 3);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Ustvaril" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Ustvarjeno" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "Privzeti vir tiskalnega papirja" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "Prikazni naziv" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "Zadnjič spremenjeno" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Zadnji posodobil" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Zadnjič posodobljeno" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "Naziv" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "Vir papirja" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "Viri papirja" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "Tiskalnik" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "Tiskalni pladenj" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "Poročilo tiskalnih dejanj" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "Naziv sistema" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "Pladnji" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "Uporabniki" diff --git a/printer_tray/i18n/tr.po b/printer_tray/i18n/tr.po new file mode 100644 index 0000000..3e1442c --- /dev/null +++ b/printer_tray/i18n/tr.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-08-15 21:56+0000\n" +"PO-Revision-Date: 2016-08-15 21:56+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Turkish (https://www.transifex.com/oca/teams/23907/tr/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: tr\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "Oluşturan" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "Oluşturuldu" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "Son güncelleyen" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "Son güncelleme" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" diff --git a/printer_tray/i18n/zh_CN.po b/printer_tray/i18n/zh_CN.po new file mode 100644 index 0000000..e95a4bf --- /dev/null +++ b/printer_tray/i18n/zh_CN.po @@ -0,0 +1,106 @@ +# Translation of Odoo Server. +# This file contains the translation of the following modules: +# * printer_tray +# +# Translators: +# OCA Transbot , 2016 +msgid "" +msgstr "" +"Project-Id-Version: Odoo Server 8.0\n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2016-09-18 04:58+0000\n" +"PO-Revision-Date: 2016-09-18 04:58+0000\n" +"Last-Translator: OCA Transbot , 2016\n" +"Language-Team: Chinese (China) (https://www.transifex.com/oca/teams/23907/zh_CN/)\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: \n" +"Language: zh_CN\n" +"Plural-Forms: nplurals=1; plural=0;\n" + +#. module: printer_tray +#: field:printing.tray,create_uid:0 +msgid "Created by" +msgstr "创建者" + +#. module: printer_tray +#: field:printing.tray,create_date:0 +msgid "Created on" +msgstr "创建时间" + +#. module: printer_tray +#: field:res.users,printer_tray_id:0 +msgid "Default Printer Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,display_name:0 +msgid "Display Name" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,id:0 +msgid "ID" +msgstr "ID" + +#. module: printer_tray +#: field:printing.tray,__last_update:0 +msgid "Last Modified on" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,write_uid:0 +msgid "Last Updated by" +msgstr "最后更新者" + +#. module: printer_tray +#: field:printing.tray,write_date:0 +msgid "Last Updated on" +msgstr "上次更新日期" + +#. module: printer_tray +#: field:printing.tray,name:0 +msgid "Name" +msgstr "" + +#. module: printer_tray +#: field:ir.actions.report.xml,printer_tray_id:0 +#: field:printing.report.xml.action,printer_tray_id:0 +msgid "Paper Source" +msgstr "" + +#. module: printer_tray +#: field:printing.printer,tray_ids:0 +msgid "Paper Sources" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_printer +#: field:printing.tray,printer_id:0 +msgid "Printer" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_tray +msgid "Printer Tray" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_printing_report_xml_action +msgid "Report Printing Actions" +msgstr "" + +#. module: printer_tray +#: field:printing.tray,system_name:0 +msgid "System name" +msgstr "" + +#. module: printer_tray +#: view:printing.printer:printer_tray.view_printing_printer_form +msgid "Trays" +msgstr "" + +#. module: printer_tray +#: model:ir.model,name:printer_tray.model_res_users +msgid "Users" +msgstr "" From e59f1e4c64cc828785bd179490d4a37e017ab459 Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Tue, 8 Nov 2016 13:13:30 +0100 Subject: [PATCH 5/9] printer_tray: Add unit tests --- printer_tray/tests/__init__.py | 6 + printer_tray/tests/test_printing_printer.py | 275 ++++++++++++++++++++ printer_tray/tests/test_printing_tray.py | 50 ++++ 3 files changed, 331 insertions(+) create mode 100644 printer_tray/tests/__init__.py create mode 100644 printer_tray/tests/test_printing_printer.py create mode 100644 printer_tray/tests/test_printing_tray.py diff --git a/printer_tray/tests/__init__.py b/printer_tray/tests/__init__.py new file mode 100644 index 0000000..7e74318 --- /dev/null +++ b/printer_tray/tests/__init__.py @@ -0,0 +1,6 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 LasLabs Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from . import test_printing_printer +from . import test_printing_tray diff --git a/printer_tray/tests/test_printing_printer.py b/printer_tray/tests/test_printing_printer.py new file mode 100644 index 0000000..14559ac --- /dev/null +++ b/printer_tray/tests/test_printing_printer.py @@ -0,0 +1,275 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 LasLabs Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +import mock +import tempfile +from openerp.tests.common import TransactionCase + + +model = 'openerp.addons.base_report_to_printer.printing' + +ppd_header = '*PPD-Adobe: "4.3"' +ppd_input_slot_header = """ +*OpenUI *InputSlot: PickOne +*DefaultInputSlot: Auto +*InputSlot Auto/Auto (Default): " + << /DeferredMediaSelection true /ManualFeed false + /MediaPosition null /MediaType null >> setpagedevice + userdict /TSBMediaType 0 put" +*End +""" +ppd_input_slot_body = """ +*InputSlot {name}/{text}: " + << /DeferredMediaSelection true /ManualFeed false + /MediaPosition null /MediaType null >> setpagedevice + userdict /TSBMediaType 0 put" +*End +""" +ppd_input_slot_footer = """ +*CloseUI: *InputSlot +""" + + +class TestPrintingPrinter(TransactionCase): + + def setUp(self): + super(TestPrintingPrinter, self).setUp() + self.Model = self.env['printing.printer'] + self.printer = self.env['printing.printer'].create({ + 'name': 'Printer', + 'system_name': 'Sys Name', + 'default': True, + 'status': 'unknown', + 'status_message': 'Msg', + 'model': 'res.users', + 'location': 'Location', + 'uri': 'URI', + }) + self.tray_vals = { + 'name': 'Tray', + 'system_name': 'TrayName', + 'printer_id': self.printer.id, + } + + def new_tray(self, vals=None): + values = self.tray_vals + if vals is not None: + values.update(vals) + return self.env['printing.tray'].create(values) + + def build_ppd(self, input_slots=None): + """ + Builds a fake PPD file declaring defined input slots + """ + ppd_contents = ppd_header + ppd_contents += ppd_input_slot_header + if input_slots is not None: + for input_slot in input_slots: + ppd_contents += ppd_input_slot_body.format( + name=input_slot['name'], + text=input_slot['text'], + ) + ppd_contents += ppd_input_slot_footer + + return ppd_contents + + def mock_cups_ppd(self, cups, file_name=None, input_slots=None): + """ + Create a fake PPD file (if needed), then mock the getPPD3 method + return value to give that file + """ + if file_name is None: + fd, file_name = tempfile.mkstemp() + + if file_name: + ppd_contents = self.build_ppd(input_slots=input_slots) + with open(file_name, 'w') as fp: + fp.write(ppd_contents) + + cups.Connection().getPPD3.return_value = (200, 0, file_name) + + def test_print_options(self): + """ + It should generate the right options dictionnary + """ + report = self.env['ir.actions.report.xml'].search([], limit=1) + action = self.env['printing.report.xml.action'].create({ + 'user_id': self.env.user.id, + 'report_id': report.id, + 'action': 'server', + }) + user_tray = self.new_tray({ + 'system_name': 'User tray', + }) + report_tray = self.new_tray({ + 'system_name': 'Report tray', + }) + action_tray = self.new_tray({ + 'system_name': 'Action tray', + }) + + # No tray defined + self.env.user.printer_tray_id = False + report.printer_tray_id = False + action.printer_tray_id = False + options = self.Model.print_options(report, 'pdf') + self.assertFalse('InputSlot' in options) + + # Only user tray is defined + self.env.user.printer_tray_id = user_tray + report.printer_tray_id = False + action.printer_tray_id = False + options = self.Model.print_options(report, 'pdf') + self.assertEquals(options, { + 'InputSlot': 'User tray', + }) + + # Only report tray is defined + self.env.user.printer_tray_id = False + report.printer_tray_id = report_tray + action.printer_tray_id = False + options = self.Model.print_options(report, 'pdf') + self.assertEquals(options, { + 'InputSlot': 'Report tray', + }) + + # Only action tray is defined + self.env.user.printer_tray_id = False + report.printer_tray_id = False + action.printer_tray_id = action_tray + options = self.Model.print_options(report, 'pdf') + self.assertEquals(options, { + 'InputSlot': 'Action tray', + }) + + # All trays are defined + self.env.user.printer_tray_id = user_tray + report.printer_tray_id = report_tray + action.printer_tray_id = action_tray + options = self.Model.print_options(report, 'pdf') + self.assertEquals(options, { + 'InputSlot': 'Action tray', + }) + + @mock.patch('%s.cups' % model) + def test_update_printers(self, cups): + """ + Check that the update_printers method calls _prepare_update_from_cups + """ + self.mock_cups_ppd(cups, file_name=False) + + with mock.patch.object( + self.Model, '_prepare_update_from_cups' + ) as prepare_update_from_cups: + self.Model.update_printers_status() + prepare_update_from_cups.assert_called_once() + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups_no_ppd(self, cups): + """ + Check that the tray_ids field has no value when no PPD is available + """ + self.mock_cups_ppd(cups, file_name=False) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertFalse('tray_ids' in vals) + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups_empty_ppd(self, cups): + """ + Check that the tray_ids field has no value when the PPD file has + no input slot declared + """ + fd, file_name = tempfile.mkstemp() + self.mock_cups_ppd(cups, file_name=file_name) + # Replace the ppd file's contents by an empty file + with open(file_name, 'w') as fp: + fp.write(ppd_header) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertFalse('tray_ids' in vals) + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups(self, cups): + """ + Check the return value when adding a single tray + """ + self.mock_cups_ppd(cups) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertEqual(vals['tray_ids'], [(0, 0, { + 'name': 'Auto (Default)', + 'system_name': 'Auto', + })]) + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups_with_multiple_trays(self, cups): + """ + Check the return value when adding multiple trays at once + """ + self.mock_cups_ppd(cups, input_slots=[ + {'name': 'Tray1', 'text': 'Tray 1'}, + ]) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertEqual(vals['tray_ids'], [(0, 0, { + 'name': 'Auto (Default)', + 'system_name': 'Auto', + }), (0, 0, { + 'name': 'Tray 1', + 'system_name': 'Tray1', + })]) + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups_already_known_trays(self, cups): + """ + Check that calling the method twice doesn't create the trays multiple + times + """ + self.mock_cups_ppd(cups, input_slots=[ + {'name': 'Tray1', 'text': 'Tray 1'}, + ]) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + # Create a tray which is in the PPD file + self.new_tray({'system_name': 'Tray1'}) + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertEqual(vals['tray_ids'], [(0, 0, { + 'name': 'Auto (Default)', + 'system_name': 'Auto', + })]) + + @mock.patch('%s.cups' % model) + def test_prepare_update_from_cups_unknown_trays(self, cups): + """ + Check that trays which are not in the PPD file are removed from Odoo + """ + self.mock_cups_ppd(cups) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + # Create a tray which is absent from the PPD file + tray = self.new_tray() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertEqual(vals['tray_ids'], [(0, 0, { + 'name': 'Auto (Default)', + 'system_name': 'Auto', + }), (2, tray.id)]) diff --git a/printer_tray/tests/test_printing_tray.py b/printer_tray/tests/test_printing_tray.py new file mode 100644 index 0000000..685a9d1 --- /dev/null +++ b/printer_tray/tests/test_printing_tray.py @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# Copyright 2016 LasLabs Inc. +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). + +from openerp.tests.common import TransactionCase + + +model = 'openerp.addons.base_report_to_printer.printing' + + +class TestPrintingTray(TransactionCase): + + def setUp(self): + super(TestPrintingTray, self).setUp() + self.Model = self.env['printing.tray'] + self.printer = self.env['printing.printer'].create({ + 'name': 'Printer', + 'system_name': 'Sys Name', + 'default': True, + 'status': 'unknown', + 'status_message': 'Msg', + 'model': 'res.users', + 'location': 'Location', + 'uri': 'URI', + }) + self.tray_vals = { + 'name': 'Tray', + 'system_name': 'TrayName', + 'printer_id': self.printer.id, + } + + def new_tray(self): + return self.env['printing.tray'].create(self.tray_vals) + + def test_report_behaviour(self): + """ It should add the selected tray in the report data """ + ir_report = self.env['ir.actions.report.xml'].search([], limit=1) + report = self.env['printing.report.xml.action'].create({ + 'user_id': self.env.user.id, + 'report_id': ir_report.id, + 'action': 'server', + }) + report.printer_tray_id = False + behaviour = report.behaviour() + self.assertEqual(behaviour['tray'], False) + + # Check that we have te right value + report.printer_tray_id = self.new_tray() + behaviour = report.behaviour() + self.assertEqual(behaviour['tray'], report.printer_tray_id.system_name) From a7a0761d390c21ea2c24136b4c6c1a3bb164e12c Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Tue, 8 Nov 2016 19:24:10 +0100 Subject: [PATCH 6/9] Fixed lint errors --- printer_tray/__manifest__.py | 4 +++- printer_tray/printer.py | 10 +++++++++- printer_tray/users_view.xml | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) diff --git a/printer_tray/__manifest__.py b/printer_tray/__manifest__.py index 93e47ee..c3953b3 100644 --- a/printer_tray/__manifest__.py +++ b/printer_tray/__manifest__.py @@ -34,7 +34,9 @@ 'report_xml_action_view.xml', 'security/ir.model.access.csv', ], - 'test': [], + 'external_dependencies': { + 'python': ['cups'], + }, 'installable': False, 'auto_install': False, 'application': True, diff --git a/printer_tray/printer.py b/printer_tray/printer.py index f2790cb..2d46059 100644 --- a/printer_tray/printer.py +++ b/printer_tray/printer.py @@ -18,12 +18,20 @@ # along with this program. If not, see . # ############################################################################## -import cups + import errno +import logging import os from openerp import models, fields, api +_logger = logging.getLogger(__name__) + +try: + import cups +except ImportError: + _logger.debug('Cannot `import cups`.') + class Printer(models.Model): _inherit = 'printing.printer' diff --git a/printer_tray/users_view.xml b/printer_tray/users_view.xml index 8c4b6c8..6eeb6dc 100644 --- a/printer_tray/users_view.xml +++ b/printer_tray/users_view.xml @@ -15,7 +15,7 @@ - + res.users.form.printing.tray res.users From 104b531d1f9a23b3f81bce2d5c03655e5c70f93c Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Tue, 8 Nov 2016 13:13:30 +0100 Subject: [PATCH 7/9] Migrate printer_tray to v9.0 --- printer_tray/README.rst | 28 +++++--- printer_tray/__init__.py | 28 ++------ printer_tray/__manifest__.py | 69 ++++++++----------- printer_tray/ir_report.py | 37 ---------- printer_tray/models/__init__.py | 9 +++ printer_tray/models/ir_actions_report_xml.py | 20 ++++++ .../printing_printer.py} | 33 +++------ .../models/printing_report_xml_action.py | 27 ++++++++ printer_tray/models/printing_tray.py | 20 ++++++ printer_tray/models/res_users.py | 20 ++++++ printer_tray/printer_tray.py | 37 ---------- printer_tray/report_xml_action.py | 44 ------------ printer_tray/security/ir.model.access.csv | 4 +- printer_tray/tests/test_printing_printer.py | 22 +++--- printer_tray/tests/test_printing_tray.py | 4 +- printer_tray/users.py | 37 ---------- .../ir_actions_report_xml.xml} | 0 .../printing_printer.xml} | 0 .../printing_report_xml_action.xml} | 0 .../{users_view.xml => views/res_users.xml} | 0 20 files changed, 173 insertions(+), 266 deletions(-) delete mode 100644 printer_tray/ir_report.py create mode 100644 printer_tray/models/__init__.py create mode 100644 printer_tray/models/ir_actions_report_xml.py rename printer_tray/{printer.py => models/printing_printer.py} (66%) create mode 100644 printer_tray/models/printing_report_xml_action.py create mode 100644 printer_tray/models/printing_tray.py create mode 100644 printer_tray/models/res_users.py delete mode 100644 printer_tray/printer_tray.py delete mode 100644 printer_tray/report_xml_action.py delete mode 100644 printer_tray/users.py rename printer_tray/{ir_report_view.xml => views/ir_actions_report_xml.xml} (100%) rename printer_tray/{printer_view.xml => views/printing_printer.xml} (100%) rename printer_tray/{report_xml_action_view.xml => views/printing_report_xml_action.xml} (100%) rename printer_tray/{users_view.xml => views/res_users.xml} (100%) diff --git a/printer_tray/README.rst b/printer_tray/README.rst index 1c78ad9..81464d2 100644 --- a/printer_tray/README.rst +++ b/printer_tray/README.rst @@ -1,3 +1,8 @@ +.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg + :target: http://www.gnu.org/licenses/agpl-3.0-standalone.html + :alt: License: AGPL-3 + +======================================== Report to printer - Paper tray selection ======================================== @@ -40,6 +45,10 @@ There is no special usage, once configured, reports are printed in the select tray. When no tray is configured for a report and a user, the default tray setup on the CUPS server is used. +.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas + :alt: Try me on Runbot + :target: https://runbot.odoo-community.org/runbot/144/9.0 + Known issues / Roadmap ====================== @@ -48,11 +57,10 @@ Known issues / Roadmap Bug Tracker =========== -Bugs are tracked on `GitHub Issues `_. -In case of trouble, please check there if your issue has already been reported. -If you spotted it first, help us smashing it by providing a detailed and welcomed feedback -`here `_. - +Bugs are tracked on `GitHub Issues +`_. In case of trouble, please +check there if your issue has already been reported. If you spotted it first, +help us smashing it by providing a detailed and welcomed feedback. Credits ======= @@ -66,12 +74,14 @@ Contributors Maintainer ---------- -.. image:: http://odoo-community.org/logo.png +.. image:: https://odoo-community.org/logo.png :alt: Odoo Community Association - :target: http://odoo-community.org + :target: https://odoo-community.org This module is maintained by the OCA. -OCA, or the Odoo Community Association, is a nonprofit organization whose mission is to support the collaborative development of Odoo features and promote its widespread use. +OCA, or the Odoo Community Association, is a nonprofit organization whose +mission is to support the collaborative development of Odoo features and +promote its widespread use. -To contribute to this module, please visit http://odoo-community.org. +To contribute to this module, please visit https://odoo-community.org. diff --git a/printer_tray/__init__.py b/printer_tray/__init__.py index 1d70414..4e462b6 100644 --- a/printer_tray/__init__.py +++ b/printer_tray/__init__.py @@ -1,25 +1,5 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from . import ir_report -from . import printer_tray -from . import printer -from . import users -from . import report_xml_action +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import models diff --git a/printer_tray/__manifest__.py b/printer_tray/__manifest__.py index c3953b3..de65b0a 100644 --- a/printer_tray/__manifest__.py +++ b/printer_tray/__manifest__.py @@ -1,43 +1,28 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -{'name': 'Report to printer - Paper tray selection', - 'version': '8.0.1.0.0', - 'category': 'Printer', - 'author': "Camptocamp,Odoo Community Association (OCA)", - 'maintainer': 'Camptocamp', - 'website': 'http://www.camptocamp.com/', - 'license': 'AGPL-3', - 'depends': ['base_report_to_printer', - ], - 'data': [ - 'users_view.xml', - 'ir_report_view.xml', - 'printer_view.xml', - 'report_xml_action_view.xml', - 'security/ir.model.access.csv', - ], - 'external_dependencies': { - 'python': ['cups'], - }, - 'installable': False, - 'auto_install': False, - 'application': True, - } +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +{ + 'name': 'Report to printer - Paper tray selection', + 'version': '9.0.1.0.0', + 'category': 'Printer', + 'author': "Camptocamp, Odoo Community Association (OCA)", + 'maintainer': 'Camptocamp', + 'website': 'http://www.camptocamp.com/', + 'license': 'AGPL-3', + 'depends': [ + 'base_report_to_printer', + ], + 'data': [ + 'views/res_users.xml', + 'views/ir_actions_report_xml.xml', + 'views/printing_printer.xml', + 'views/printing_report_xml_action.xml', + 'security/ir.model.access.csv', + ], + 'external_dependencies': { + 'python': ['cups'], + }, + 'installable': True, + 'application': True, +} diff --git a/printer_tray/ir_report.py b/printer_tray/ir_report.py deleted file mode 100644 index fb77593..0000000 --- a/printer_tray/ir_report.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, fields, api - - -class IrActionsReportXml(models.Model): - - _inherit = 'ir.actions.report.xml' - - printer_tray_id = fields.Many2one( - comodel_name='printing.tray', - string='Paper Source', - domain="[('printer_id', '=', printing_printer_id)]", - ) - - @api.onchange('printing_printer_id') - def onchange_printing_printer_id(self): - """ Reset the tray when the printer is changed """ - self.printer_tray_id = False diff --git a/printer_tray/models/__init__.py b/printer_tray/models/__init__.py new file mode 100644 index 0000000..dd6af32 --- /dev/null +++ b/printer_tray/models/__init__.py @@ -0,0 +1,9 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from . import ir_actions_report_xml +from . import printing_tray +from . import printing_printer +from . import res_users +from . import printing_report_xml_action diff --git a/printer_tray/models/ir_actions_report_xml.py b/printer_tray/models/ir_actions_report_xml.py new file mode 100644 index 0000000..d4d85cb --- /dev/null +++ b/printer_tray/models/ir_actions_report_xml.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields, api + + +class IrActionsReportXml(models.Model): + _inherit = 'ir.actions.report.xml' + + printer_tray_id = fields.Many2one( + comodel_name='printing.tray', + string='Paper Source', + domain="[('printer_id', '=', printing_printer_id)]", + ) + + @api.onchange('printing_printer_id') + def onchange_printing_printer_id(self): + """ Reset the tray when the printer is changed """ + self.printer_tray_id = False diff --git a/printer_tray/printer.py b/printer_tray/models/printing_printer.py similarity index 66% rename from printer_tray/printer.py rename to printer_tray/models/printing_printer.py index 2d46059..0b40dc2 100644 --- a/printer_tray/printer.py +++ b/printer_tray/models/printing_printer.py @@ -1,23 +1,6 @@ # -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). import errno import logging @@ -33,7 +16,7 @@ except ImportError: _logger.debug('Cannot `import cups`.') -class Printer(models.Model): +class PrintingPrinter(models.Model): _inherit = 'printing.printer' tray_ids = fields.One2many(comodel_name='printing.tray', @@ -42,10 +25,12 @@ class Printer(models.Model): @api.multi def _prepare_update_from_cups(self, cups_connection, cups_printer): - vals = super(Printer, self)._prepare_update_from_cups(cups_connection, - cups_printer) + vals = super(PrintingPrinter, self)._prepare_update_from_cups( + cups_connection, cups_printer) - ppd_info = cups_connection.getPPD3(self.system_name) + printer_uri = cups_printer['printer-uri-supported'] + printer_system_name = printer_uri[printer_uri.rfind('/') + 1:] + ppd_info = cups_connection.getPPD3(printer_system_name) ppd_path = ppd_info[2] if not ppd_path: return vals @@ -85,7 +70,7 @@ class Printer(models.Model): def print_options(self, report, format, copies=1): """ Hook to define Tray """ printing_act_obj = self.env['printing.report.xml.action'] - options = super(Printer, self).print_options(report, format) + options = super(PrintingPrinter, self).print_options(report, format) # Retrieve user default values user = self.env.user diff --git a/printer_tray/models/printing_report_xml_action.py b/printer_tray/models/printing_report_xml_action.py new file mode 100644 index 0000000..5cf268e --- /dev/null +++ b/printer_tray/models/printing_report_xml_action.py @@ -0,0 +1,27 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields, api + + +class PrintingReportXMLAction(models.Model): + _inherit = 'printing.report.xml.action' + + printer_tray_id = fields.Many2one( + comodel_name='printing.tray', + string='Paper Source', + domain="[('printer_id', '=', printer_id)]", + ) + + @api.multi + def behaviour(self): + self.ensure_one() + res = super(PrintingReportXMLAction, self).behaviour() + res['tray'] = self.printer_tray_id.system_name + return res + + @api.onchange('printer_id') + def onchange_printer_id(self): + """ Reset the tray when the printer is changed """ + self.printer_tray_id = False diff --git a/printer_tray/models/printing_tray.py b/printer_tray/models/printing_tray.py new file mode 100644 index 0000000..ef6f245 --- /dev/null +++ b/printer_tray/models/printing_tray.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields + + +class PrinterTray(models.Model): + _name = 'printing.tray' + _description = 'Printer Tray' + + name = fields.Char(required=True) + system_name = fields.Char(required=True, readonly=True) + printer_id = fields.Many2one( + comodel_name='printing.printer', + string='Printer', + required=True, + readonly=True, + ondelete='cascade', + ) diff --git a/printer_tray/models/res_users.py b/printer_tray/models/res_users.py new file mode 100644 index 0000000..6069819 --- /dev/null +++ b/printer_tray/models/res_users.py @@ -0,0 +1,20 @@ +# -*- coding: utf-8 -*- +# Copyright (C) 2013-2014 Camptocamp () +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from openerp import models, fields, api + + +class ResUsers(models.Model): + _inherit = "res.users" + + printer_tray_id = fields.Many2one( + comodel_name='printing.tray', + string='Default Printer Paper Source', + domain="[('printer_id', '=', printing_printer_id)]", + ) + + @api.onchange('printing_printer_id') + def onchange_printing_printer_id(self): + """ Reset the tray when the printer is changed """ + self.printer_tray_id = False diff --git a/printer_tray/printer_tray.py b/printer_tray/printer_tray.py deleted file mode 100644 index ee25ca8..0000000 --- a/printer_tray/printer_tray.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, fields - - -class PrinterTray(models.Model): - - _name = 'printing.tray' - _description = 'Printer Tray' - - name = fields.Char(required=True) - system_name = fields.Char(required=True, readonly=True) - printer_id = fields.Many2one( - comodel_name='printing.printer', - string='Printer', - required=True, - readonly=True, - ondelete='cascade', - ) diff --git a/printer_tray/report_xml_action.py b/printer_tray/report_xml_action.py deleted file mode 100644 index 5056150..0000000 --- a/printer_tray/report_xml_action.py +++ /dev/null @@ -1,44 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## - -from openerp import models, fields, api - - -class ReportXMLAction(models.Model): - _inherit = 'printing.report.xml.action' - - printer_tray_id = fields.Many2one( - comodel_name='printing.tray', - string='Paper Source', - domain="[('printer_id', '=', printer_id)]", - ) - - @api.multi - def behaviour(self): - self.ensure_one() - res = super(ReportXMLAction, self).behaviour() - res['tray'] = self.printer_tray_id.system_name - return res - - @api.onchange('printer_id') - def onchange_printer_id(self): - """ Reset the tray when the printer is changed """ - self.printer_tray_id = False diff --git a/printer_tray/security/ir.model.access.csv b/printer_tray/security/ir.model.access.csv index 90e6ac2..e222837 100644 --- a/printer_tray/security/ir.model.access.csv +++ b/printer_tray/security/ir.model.access.csv @@ -1,3 +1,3 @@ "id","name","model_id:id","group_id:id","perm_read","perm_write","perm_create","perm_unlink" -access_printing_tray_all,printing_tray all,model_printing_tray,,1,0,0,0 -access_printing_tray_operator,printing_tray operator,model_printing_tray,base_report_to_printer.res_groups_printingprintoperator0,1,1,1,1 +access_printing_tray_all,printing_tray all,model_printing_tray,base_report_to_printer.printing_group_user,1,0,0,0 +access_printing_tray_operator,printing_tray operator,model_printing_tray,base_report_to_printer.printing_group_manager,1,1,1,1 diff --git a/printer_tray/tests/test_printing_printer.py b/printer_tray/tests/test_printing_printer.py index 14559ac..225214e 100644 --- a/printer_tray/tests/test_printing_printer.py +++ b/printer_tray/tests/test_printing_printer.py @@ -7,7 +7,8 @@ import tempfile from openerp.tests.common import TransactionCase -model = 'openerp.addons.base_report_to_printer.printing' +model = 'openerp.addons.base_report_to_printer.models.printing_printer' +server_model = 'openerp.addons.base_report_to_printer.models.printing_server' ppd_header = '*PPD-Adobe: "4.3"' ppd_input_slot_header = """ @@ -36,8 +37,11 @@ class TestPrintingPrinter(TransactionCase): def setUp(self): super(TestPrintingPrinter, self).setUp() self.Model = self.env['printing.printer'] + self.ServerModel = self.env['printing.server'] + self.server = self.env['printing.server'].create({}) self.printer = self.env['printing.printer'].create({ 'name': 'Printer', + 'server_id': self.server.id, 'system_name': 'Sys Name', 'default': True, 'status': 'unknown', @@ -152,7 +156,7 @@ class TestPrintingPrinter(TransactionCase): 'InputSlot': 'Action tray', }) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_update_printers(self, cups): """ Check that the update_printers method calls _prepare_update_from_cups @@ -162,10 +166,10 @@ class TestPrintingPrinter(TransactionCase): with mock.patch.object( self.Model, '_prepare_update_from_cups' ) as prepare_update_from_cups: - self.Model.update_printers_status() + self.ServerModel.update_printers() prepare_update_from_cups.assert_called_once() - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups_no_ppd(self, cups): """ Check that the tray_ids field has no value when no PPD is available @@ -178,7 +182,7 @@ class TestPrintingPrinter(TransactionCase): vals = self.printer._prepare_update_from_cups(connection, cups_printer) self.assertFalse('tray_ids' in vals) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups_empty_ppd(self, cups): """ Check that the tray_ids field has no value when the PPD file has @@ -196,7 +200,7 @@ class TestPrintingPrinter(TransactionCase): vals = self.printer._prepare_update_from_cups(connection, cups_printer) self.assertFalse('tray_ids' in vals) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups(self, cups): """ Check the return value when adding a single tray @@ -212,7 +216,7 @@ class TestPrintingPrinter(TransactionCase): 'system_name': 'Auto', })]) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups_with_multiple_trays(self, cups): """ Check the return value when adding multiple trays at once @@ -233,7 +237,7 @@ class TestPrintingPrinter(TransactionCase): 'system_name': 'Tray1', })]) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups_already_known_trays(self, cups): """ Check that calling the method twice doesn't create the trays multiple @@ -255,7 +259,7 @@ class TestPrintingPrinter(TransactionCase): 'system_name': 'Auto', })]) - @mock.patch('%s.cups' % model) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups_unknown_trays(self, cups): """ Check that trays which are not in the PPD file are removed from Odoo diff --git a/printer_tray/tests/test_printing_tray.py b/printer_tray/tests/test_printing_tray.py index 685a9d1..893a888 100644 --- a/printer_tray/tests/test_printing_tray.py +++ b/printer_tray/tests/test_printing_tray.py @@ -5,7 +5,7 @@ from openerp.tests.common import TransactionCase -model = 'openerp.addons.base_report_to_printer.printing' +model = 'openerp.addons.base_report_to_printer.models.printing_server' class TestPrintingTray(TransactionCase): @@ -13,8 +13,10 @@ class TestPrintingTray(TransactionCase): def setUp(self): super(TestPrintingTray, self).setUp() self.Model = self.env['printing.tray'] + self.server = self.env['printing.server'].create({}) self.printer = self.env['printing.printer'].create({ 'name': 'Printer', + 'server_id': self.server.id, 'system_name': 'Sys Name', 'default': True, 'status': 'unknown', diff --git a/printer_tray/users.py b/printer_tray/users.py deleted file mode 100644 index 47d7faa..0000000 --- a/printer_tray/users.py +++ /dev/null @@ -1,37 +0,0 @@ -# -*- coding: utf-8 -*- -############################################################################## -# -# Author: Yannick Vaucher -# Copyright 2013 Camptocamp SA -# -# This program is free software: you can redistribute it and/or modify -# it under the terms of the GNU Affero General Public License as -# published by the Free Software Foundation, either version 3 of the -# License, or (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Affero General Public License for more details. -# -# You should have received a copy of the GNU Affero General Public License -# along with this program. If not, see . -# -############################################################################## -from openerp import models, fields, api - - -class ResUsers(models.Model): - - _inherit = "res.users" - - printer_tray_id = fields.Many2one( - comodel_name='printing.tray', - string='Default Printer Paper Source', - domain="[('printer_id', '=', printing_printer_id)]", - ) - - @api.onchange('printing_printer_id') - def onchange_printing_printer_id(self): - """ Reset the tray when the printer is changed """ - self.printer_tray_id = False diff --git a/printer_tray/ir_report_view.xml b/printer_tray/views/ir_actions_report_xml.xml similarity index 100% rename from printer_tray/ir_report_view.xml rename to printer_tray/views/ir_actions_report_xml.xml diff --git a/printer_tray/printer_view.xml b/printer_tray/views/printing_printer.xml similarity index 100% rename from printer_tray/printer_view.xml rename to printer_tray/views/printing_printer.xml diff --git a/printer_tray/report_xml_action_view.xml b/printer_tray/views/printing_report_xml_action.xml similarity index 100% rename from printer_tray/report_xml_action_view.xml rename to printer_tray/views/printing_report_xml_action.xml diff --git a/printer_tray/users_view.xml b/printer_tray/views/res_users.xml similarity index 100% rename from printer_tray/users_view.xml rename to printer_tray/views/res_users.xml From 90c6447a2098314e5d7558e4d11238606a57ff21 Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Thu, 17 Nov 2016 09:57:38 +0100 Subject: [PATCH 8/9] [FIX] printer_tray: Allow to call print_option with no report --- printer_tray/models/printing_printer.py | 32 +++++++++++---------- printer_tray/tests/test_printing_printer.py | 5 ++++ 2 files changed, 22 insertions(+), 15 deletions(-) diff --git a/printer_tray/models/printing_printer.py b/printer_tray/models/printing_printer.py index 0b40dc2..437de14 100644 --- a/printer_tray/models/printing_printer.py +++ b/printer_tray/models/printing_printer.py @@ -67,27 +67,29 @@ class PrintingPrinter(models.Model): return vals @api.multi - def print_options(self, report, format, copies=1): + def print_options(self, report=None, format=None, copies=1): """ Hook to define Tray """ printing_act_obj = self.env['printing.report.xml.action'] options = super(PrintingPrinter, self).print_options(report, format) # Retrieve user default values - user = self.env.user - tray = user.printer_tray_id + tray = self.env.user.printer_tray_id - # Retrieve report default values - if report.printer_tray_id: - tray = report.printer_tray_id + if report is not None: + # Retrieve report default values + if report.printer_tray_id: + tray = report.printer_tray_id - # Retrieve report-user specific values - action = printing_act_obj.search([('report_id', '=', report.id), - ('user_id', '=', self.env.uid), - ('action', '!=', 'user_default')], - limit=1) - if action.printer_tray_id: - tray = action.printer_tray_id + # Retrieve report-user specific values + action = printing_act_obj.search([ + ('report_id', '=', report.id), + ('user_id', '=', self.env.uid), + ('action', '!=', 'user_default'), + ], limit=1) + if action.printer_tray_id: + tray = action.printer_tray_id + + if tray: + options['InputSlot'] = str(tray.system_name) - if tray: - options['InputSlot'] = str(tray.system_name) return options diff --git a/printer_tray/tests/test_printing_printer.py b/printer_tray/tests/test_printing_printer.py index 225214e..445649f 100644 --- a/printer_tray/tests/test_printing_printer.py +++ b/printer_tray/tests/test_printing_printer.py @@ -113,6 +113,11 @@ class TestPrintingPrinter(TransactionCase): 'system_name': 'Action tray', }) + # No report passed + self.env.user.printer_tray_id = False + options = self.Model.print_options() + self.assertFalse('InputSlot' in options) + # No tray defined self.env.user.printer_tray_id = False report.printer_tray_id = False From 2522577067f86ded8d88522b017a896985fa4e72 Mon Sep 17 00:00:00 2001 From: Sylvain GARANCHER Date: Wed, 16 Nov 2016 17:19:31 +0100 Subject: [PATCH 9/9] [MIG] Migrate printer_tray to v10.0 --- printer_tray/README.rst | 2 +- printer_tray/__manifest__.py | 2 +- printer_tray/models/ir_actions_report_xml.py | 2 +- printer_tray/models/printing_printer.py | 47 +++++++++--------- .../models/printing_report_xml_action.py | 2 +- printer_tray/models/printing_tray.py | 2 +- printer_tray/models/res_users.py | 2 +- printer_tray/tests/__init__.py | 3 ++ .../tests/test_ir_actions_report_xml.py | 38 +++++++++++++++ printer_tray/tests/test_printing_printer.py | 48 +++++++++++++++++-- .../tests/test_printing_report_xml_action.py | 38 +++++++++++++++ printer_tray/tests/test_printing_tray.py | 4 +- printer_tray/tests/test_res_users.py | 38 +++++++++++++++ 13 files changed, 195 insertions(+), 33 deletions(-) create mode 100644 printer_tray/tests/test_ir_actions_report_xml.py create mode 100644 printer_tray/tests/test_printing_report_xml_action.py create mode 100644 printer_tray/tests/test_res_users.py diff --git a/printer_tray/README.rst b/printer_tray/README.rst index 81464d2..58e2d6a 100644 --- a/printer_tray/README.rst +++ b/printer_tray/README.rst @@ -47,7 +47,7 @@ default tray setup on the CUPS server is used. .. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas :alt: Try me on Runbot - :target: https://runbot.odoo-community.org/runbot/144/9.0 + :target: https://runbot.odoo-community.org/runbot/144/10.0 Known issues / Roadmap ====================== diff --git a/printer_tray/__manifest__.py b/printer_tray/__manifest__.py index de65b0a..9e5e5be 100644 --- a/printer_tray/__manifest__.py +++ b/printer_tray/__manifest__.py @@ -4,7 +4,7 @@ { 'name': 'Report to printer - Paper tray selection', - 'version': '9.0.1.0.0', + 'version': '10.0.1.0.0', 'category': 'Printer', 'author': "Camptocamp, Odoo Community Association (OCA)", 'maintainer': 'Camptocamp', diff --git a/printer_tray/models/ir_actions_report_xml.py b/printer_tray/models/ir_actions_report_xml.py index d4d85cb..042b197 100644 --- a/printer_tray/models/ir_actions_report_xml.py +++ b/printer_tray/models/ir_actions_report_xml.py @@ -2,7 +2,7 @@ # Copyright (C) 2013-2014 Camptocamp () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import api, fields, models class IrActionsReportXml(models.Model): diff --git a/printer_tray/models/printing_printer.py b/printer_tray/models/printing_printer.py index 437de14..77cf5cd 100644 --- a/printer_tray/models/printing_printer.py +++ b/printer_tray/models/printing_printer.py @@ -6,7 +6,7 @@ import errno import logging import os -from openerp import models, fields, api +from odoo import api, fields, models _logger = logging.getLogger(__name__) @@ -40,30 +40,33 @@ class PrintingPrinter(models.Model): try: os.unlink(ppd_path) except OSError as err: - if err.errno == errno.ENOENT: - pass - raise + # ENOENT means No such file or directory + # The file has already been deleted, we can continue the update + if err.errno != errno.ENOENT: + raise if not option: return vals - vals_trays = [] + vals['tray_ids'] = [] + cups_trays = { + tray_option['choice']: tray_option['text'] + for tray_option in option.choices + } - tray_names = set(tray.system_name for tray in self.tray_ids) - for tray_option in option.choices: - if tray_option['choice'] not in tray_names: - tray_vals = { - 'name': tray_option['text'], - 'system_name': tray_option['choice'], - } - vals_trays.append((0, 0, tray_vals)) + # Add new trays + vals['tray_ids'].extend([ + (0, 0, {'name': text, 'system_name': choice}) + for choice, text in cups_trays.items() + if choice not in self.tray_ids.mapped('system_name') + ]) - cups_trays = set(tray_option['choice'] for tray_option - in option.choices) - for tray in self.tray_ids: - if tray.system_name not in cups_trays: - vals_trays.append((2, tray.id)) + # Remove deleted trays + vals['tray_ids'].extend([ + (2, tray.id) + for tray in self.tray_ids.filtered( + lambda record: record.system_name not in cups_trays.keys()) + ]) - vals['tray_ids'] = vals_trays return vals @api.multi @@ -72,13 +75,13 @@ class PrintingPrinter(models.Model): printing_act_obj = self.env['printing.report.xml.action'] options = super(PrintingPrinter, self).print_options(report, format) - # Retrieve user default values - tray = self.env.user.printer_tray_id - if report is not None: # Retrieve report default values if report.printer_tray_id: tray = report.printer_tray_id + else: + # Retrieve user default values + tray = self.env.user.printer_tray_id # Retrieve report-user specific values action = printing_act_obj.search([ diff --git a/printer_tray/models/printing_report_xml_action.py b/printer_tray/models/printing_report_xml_action.py index 5cf268e..0716093 100644 --- a/printer_tray/models/printing_report_xml_action.py +++ b/printer_tray/models/printing_report_xml_action.py @@ -2,7 +2,7 @@ # Copyright (C) 2013-2014 Camptocamp () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import api, fields, models class PrintingReportXMLAction(models.Model): diff --git a/printer_tray/models/printing_tray.py b/printer_tray/models/printing_tray.py index ef6f245..6f045ba 100644 --- a/printer_tray/models/printing_tray.py +++ b/printer_tray/models/printing_tray.py @@ -2,7 +2,7 @@ # Copyright (C) 2013-2014 Camptocamp () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields +from odoo import fields, models class PrinterTray(models.Model): diff --git a/printer_tray/models/res_users.py b/printer_tray/models/res_users.py index 6069819..bd8732d 100644 --- a/printer_tray/models/res_users.py +++ b/printer_tray/models/res_users.py @@ -2,7 +2,7 @@ # Copyright (C) 2013-2014 Camptocamp () # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). -from openerp import models, fields, api +from odoo import api, fields, models class ResUsers(models.Model): diff --git a/printer_tray/tests/__init__.py b/printer_tray/tests/__init__.py index 7e74318..481d9b7 100644 --- a/printer_tray/tests/__init__.py +++ b/printer_tray/tests/__init__.py @@ -2,5 +2,8 @@ # 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_printing_printer +from . import test_printing_report_xml_action from . import test_printing_tray +from . import test_res_users diff --git a/printer_tray/tests/test_ir_actions_report_xml.py b/printer_tray/tests/test_ir_actions_report_xml.py new file mode 100644 index 0000000..37daf12 --- /dev/null +++ b/printer_tray/tests/test_ir_actions_report_xml.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 SYLEAM Info Services +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestIrActionsReportXml(TransactionCase): + def test_onchange_printer_tray_id_empty(self): + action = self.env['ir.actions.report.xml'].new( + {'printer_tray_id': False}) + action.onchange_printing_printer_id() + self.assertFalse(action.printer_tray_id) + + def test_onchange_printer_tray_id_not_empty(self): + server = self.env['printing.server'].create({}) + printer = self.env['printing.printer'].create({ + 'name': 'Printer', + 'server_id': server.id, + 'system_name': 'Sys Name', + 'default': True, + 'status': 'unknown', + 'status_message': 'Msg', + 'model': 'res.users', + 'location': 'Location', + 'uri': 'URI', + }) + tray = self.env['printing.tray'].create({ + 'name': 'Tray', + 'system_name': 'TrayName', + 'printer_id': printer.id, + }) + + action = self.env['ir.actions.report.xml'].new( + {'printer_tray_id': tray.id}) + self.assertEqual(action.printer_tray_id, tray) + action.onchange_printing_printer_id() + self.assertFalse(action.printer_tray_id) diff --git a/printer_tray/tests/test_printing_printer.py b/printer_tray/tests/test_printing_printer.py index 445649f..25826db 100644 --- a/printer_tray/tests/test_printing_printer.py +++ b/printer_tray/tests/test_printing_printer.py @@ -2,13 +2,14 @@ # Copyright 2016 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). +import errno import mock import tempfile -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase -model = 'openerp.addons.base_report_to_printer.models.printing_printer' -server_model = 'openerp.addons.base_report_to_printer.models.printing_server' +model = 'odoo.addons.base_report_to_printer.models.printing_printer' +server_model = 'odoo.addons.base_report_to_printer.models.printing_server' ppd_header = '*PPD-Adobe: "4.3"' ppd_input_slot_header = """ @@ -205,6 +206,47 @@ class TestPrintingPrinter(TransactionCase): vals = self.printer._prepare_update_from_cups(connection, cups_printer) self.assertFalse('tray_ids' in vals) + @mock.patch('%s.cups' % server_model) + @mock.patch('os.unlink') + def test_prepare_update_from_cups_unlink_error(self, os_unlink, cups): + """ + When OSError other than ENOENT is encountered, the exception is raised + """ + # Break os.unlink + os_unlink.side_effect = OSError(errno.EIO, 'Error') + + self.mock_cups_ppd(cups) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + with self.assertRaises(OSError): + self.printer._prepare_update_from_cups(connection, cups_printer) + + @mock.patch('%s.cups' % server_model) + @mock.patch('os.unlink') + def test_prepare_update_from_cups_unlink_error_enoent( + self, os_unlink, cups): + """ + When a ENOENT error is encountered, the file has already been unlinked + + This is not an issue, as we were trying to delete the file. + The update can continue. + """ + # Break os.unlink + os_unlink.side_effect = OSError(errno.ENOENT, 'Error') + + self.mock_cups_ppd(cups) + + connection = cups.Connection() + cups_printer = connection.getPrinters() + + vals = self.printer._prepare_update_from_cups(connection, cups_printer) + self.assertEqual(vals['tray_ids'], [(0, 0, { + 'name': 'Auto (Default)', + 'system_name': 'Auto', + })]) + @mock.patch('%s.cups' % server_model) def test_prepare_update_from_cups(self, cups): """ diff --git a/printer_tray/tests/test_printing_report_xml_action.py b/printer_tray/tests/test_printing_report_xml_action.py new file mode 100644 index 0000000..055e0c9 --- /dev/null +++ b/printer_tray/tests/test_printing_report_xml_action.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 SYLEAM Info Services +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestPrintingReportXmlAction(TransactionCase): + def test_onchange_printer_tray_id_empty(self): + action = self.env['printing.report.xml.action'].new( + {'printer_tray_id': False}) + action.onchange_printer_id() + self.assertFalse(action.printer_tray_id) + + def test_onchange_printer_tray_id_not_empty(self): + server = self.env['printing.server'].create({}) + printer = self.env['printing.printer'].create({ + 'name': 'Printer', + 'server_id': server.id, + 'system_name': 'Sys Name', + 'default': True, + 'status': 'unknown', + 'status_message': 'Msg', + 'model': 'res.users', + 'location': 'Location', + 'uri': 'URI', + }) + tray = self.env['printing.tray'].create({ + 'name': 'Tray', + 'system_name': 'TrayName', + 'printer_id': printer.id, + }) + + action = self.env['printing.report.xml.action'].new( + {'printer_tray_id': tray.id}) + self.assertEqual(action.printer_tray_id, tray) + action.onchange_printer_id() + self.assertFalse(action.printer_tray_id) diff --git a/printer_tray/tests/test_printing_tray.py b/printer_tray/tests/test_printing_tray.py index 893a888..753aa48 100644 --- a/printer_tray/tests/test_printing_tray.py +++ b/printer_tray/tests/test_printing_tray.py @@ -2,10 +2,10 @@ # Copyright 2016 LasLabs Inc. # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). -from openerp.tests.common import TransactionCase +from odoo.tests.common import TransactionCase -model = 'openerp.addons.base_report_to_printer.models.printing_server' +model = 'odoo.addons.base_report_to_printer.models.printing_server' class TestPrintingTray(TransactionCase): diff --git a/printer_tray/tests/test_res_users.py b/printer_tray/tests/test_res_users.py new file mode 100644 index 0000000..93978fc --- /dev/null +++ b/printer_tray/tests/test_res_users.py @@ -0,0 +1,38 @@ +# -*- coding: utf-8 -*- +# Copyright 2017 SYLEAM Info Services +# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). + +from odoo.tests.common import TransactionCase + + +class TestResUsers(TransactionCase): + def test_onchange_printer_tray_id_empty(self): + user = self.env['res.users'].new( + {'printer_tray_id': False}) + user.onchange_printing_printer_id() + self.assertFalse(user.printer_tray_id) + + def test_onchange_printer_tray_id_not_empty(self): + server = self.env['printing.server'].create({}) + printer = self.env['printing.printer'].create({ + 'name': 'Printer', + 'server_id': server.id, + 'system_name': 'Sys Name', + 'default': True, + 'status': 'unknown', + 'status_message': 'Msg', + 'model': 'res.users', + 'location': 'Location', + 'uri': 'URI', + }) + tray = self.env['printing.tray'].create({ + 'name': 'Tray', + 'system_name': 'TrayName', + 'printer_id': printer.id, + }) + + user = self.env['res.users'].new( + {'printer_tray_id': tray.id}) + self.assertEqual(user.printer_tray_id, tray) + user.onchange_printing_printer_id() + self.assertFalse(user.printer_tray_id)