Merge lp:~camptocamp/report-print-send/7.0-base_report_to_printer_port-imp-yvr into lp:~report-print-send-core-editors/report-print-send/7.0

Proposed by Yannick Vaucher @ Camptocamp
Status: Superseded
Proposed branch: lp:~camptocamp/report-print-send/7.0-base_report_to_printer_port-imp-yvr
Merge into: lp:~report-print-send-core-editors/report-print-send/7.0
Prerequisite: lp:~aes/report-print-send/base_report_to_printer
Diff against target: 1463 lines (+566/-381)
11 files modified
base_report_to_printer/__init__.py (+2/-2)
base_report_to_printer/__openerp__.py (+13/-9)
base_report_to_printer/i18n/base_report_to_printer.pot (+38/-59)
base_report_to_printer/i18n/fr.po (+225/-0)
base_report_to_printer/i18n/it.po (+50/-71)
base_report_to_printer/printing.py (+77/-77)
base_report_to_printer/printing_data.xml (+17/-17)
base_report_to_printer/printing_view.xml (+110/-107)
base_report_to_printer/wizard/__init__.py (+1/-1)
base_report_to_printer/wizard/update_printers.py (+8/-14)
base_report_to_printer/wizard/update_printers.xml (+25/-24)
To merge this branch: bzr merge lp:~camptocamp/report-print-send/7.0-base_report_to_printer_port-imp-yvr
Reviewer Review Type Date Requested Status
Yannick Vaucher @ Camptocamp Needs Resubmitting
Andrew (community) Approve
Lorenzo Battistini Pending
Report Printing and Sending Core Editors Pending
Review via email: mp+188789@code.launchpad.net

This proposal has been superseded by a proposal from 2013-11-11.

Description of the change

Improved portage of base_report_to_printer lp:~aes/report-print-send/base_report_to_printer

To post a comment you must log in.
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :
Revision history for this message
Andrew (aes) :
review: Approve
Revision history for this message
Andrew (aes) wrote :

When a document is printed using this module, the document is ALSO downloaded by the browser.

A future version should disable the downloading of the document when the document is printed.

Yannick suggested to simply try to return an empty result or an exception in the result dict.

review: Approve
Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Up

Could this one be merged with lp:~aes/report-print-send/base_report_to_printer

32. By Yannick Vaucher @ Camptocamp

[IMP] add external_dependencies

33. By Yannick Vaucher @ Camptocamp

[IMP] update po files

Revision history for this message
Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote :

> Up
>
> Could this one be merged with lp:~aes/report-print-send/base_report_to_printer

Which one should be merged where?

That's a bit confuse for me. The prerequisite is 'Needs fixing'. Can we cancel this MP https://code.launchpad.net/~aes/report-print-send/base_report_to_printer/+merge/153491 and keep only your one?

Revision history for this message
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote :

Fixes of the current MP were made to fix lp:~aes/report-print-send/base_report_to_printer

Thus if this one is not merged in aes MP, I think we can bypass aes MP as it includes its changes.

I'll resubmit it.

review: Needs Resubmitting
34. By Yannick Vaucher @ Camptocamp

[IMP] module desciption and remove AUTHORS.txt file to write contributors in __openerp__

35. By Yannick Vaucher @ Camptocamp

[IMP] description add comment on update printers wizard

36. By Yannick Vaucher @ Camptocamp

[IMP] adding some explanation in description

37. By Joël Grand-Guillaume @ camptocamp

[FIX] Use explicit kwargs: context=context

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'base_report_to_printer/__init__.py'
2--- base_report_to_printer/__init__.py 2012-11-22 21:22:52 +0000
3+++ base_report_to_printer/__init__.py 2013-11-05 15:33:50 +0000
4@@ -21,5 +21,5 @@
5 # along with this program. If not, see <http://www.gnu.org/licenses/>.
6 #
7 ##############################################################################
8-import printing
9-import wizard
10+from . import printing
11+from . import wizard
12
13=== modified file 'base_report_to_printer/__openerp__.py'
14--- base_report_to_printer/__openerp__.py 2013-11-05 15:33:50 +0000
15+++ base_report_to_printer/__openerp__.py 2013-11-05 15:33:50 +0000
16@@ -1,10 +1,11 @@
17 # -*- coding: utf-8 -*-
18 ##############################################################################
19-#
20+#
21 # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
22 # Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com>
23 # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
24 # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
25+# Copyright (C) 2013 Camptocamp (<http://www.camptocamp.com>)
26 # All Rights Reserved
27 #
28 # This program is free software: you can redistribute it and/or modify
29@@ -27,24 +28,27 @@
30 'category': 'Generic Modules/Base',
31 'description': """This module allows users to send reports to a printer attached to the server. Settings can be configured globaly, per user, per report and per user and report.
32 Before you can use this module:
33- You must have lpr installed for this module to work as-is.
34- To install lpr on ubuntu enter this command at the CLI - sudo apt-get install cups-bsd
35- type ls | lpr at the command prompt to confirm your server can print
36-
37- After installing enable the "Printing / Print Operator" option under access rights to give users the ability to view the print menu.
38- Then goto the user profile and set the users printing action and default printer.
39- """,
40+ You must have lpr installed for this module to work as-is.
41+ To install lpr on ubuntu enter this command at the CLI - sudo apt-get install cups-bsd
42+ type ls | lpr at the command prompt to confirm your server can print
43+
44+ After installing enable the "Printing / Print Operator" option under access rights to give users the ability to view the print menu.
45+ Then goto the user profile and set the users printing action and default printer.
46+ """,
47 'author': 'Agile Business Group & Domsense, Pegueroles SCP, NaN',
48 'website': 'http://www.agilebg.com',
49 'license': 'AGPL-3',
50 "depends" : ['base', 'base_calendar'],
51 'data': [
52+ 'security/security.xml',
53 'printing_data.xml',
54 'printing_view.xml',
55 'wizard/update_printers.xml',
56- 'security/security.xml',
57 ],
58 'installable': True,
59 'auto_install': False,
60 'application': True,
61+ 'external_dependencies': {
62+ 'python': ['cups']
63+ }
64 }
65
66=== modified file 'base_report_to_printer/i18n/base_report_to_printer.pot'
67--- base_report_to_printer/i18n/base_report_to_printer.pot 2012-11-22 21:22:52 +0000
68+++ base_report_to_printer/i18n/base_report_to_printer.pot 2013-11-05 15:33:50 +0000
69@@ -4,10 +4,10 @@
70 #
71 msgid ""
72 msgstr ""
73-"Project-Id-Version: OpenERP Server 6.0.3\n"
74-"Report-Msgid-Bugs-To: support@openerp.com\n"
75-"POT-Creation-Date: 2011-09-26 09:06+0000\n"
76-"PO-Revision-Date: 2011-09-26 09:06+0000\n"
77+"Project-Id-Version: OpenERP Server 7.0\n"
78+"Report-Msgid-Bugs-To: \n"
79+"POT-Creation-Date: 2013-11-05 14:48+0000\n"
80+"PO-Revision-Date: 2013-11-05 14:48+0000\n"
81 "Last-Translator: <>\n"
82 "Language-Team: \n"
83 "MIME-Version: 1.0\n"
84@@ -16,11 +16,6 @@
85 "Plural-Forms: \n"
86
87 #. module: base_report_to_printer
88-#: sql_constraint:res.users:0
89-msgid "You can not have two users with the same login !"
90-msgstr ""
91-
92-#. module: base_report_to_printer
93 #: selection:printing.printer,status:0
94 msgid "Unavailable"
95 msgstr ""
96@@ -36,48 +31,42 @@
97 msgstr ""
98
99 #. module: base_report_to_printer
100-#: field:printing.printer,status:0
101-msgid "Status"
102-msgstr ""
103-
104-#. module: base_report_to_printer
105 #: field:printing.printer,system_name:0
106 msgid "System Name"
107 msgstr ""
108
109 #. module: base_report_to_printer
110-#: constraint:res.users:0
111-msgid "The chosen company is not in the allowed companies for this user"
112-msgstr ""
113-
114-#. module: base_report_to_printer
115 #: field:printing.printer,location:0
116 msgid "Location"
117 msgstr ""
118
119 #. module: base_report_to_printer
120-#: model:ir.actions.act_window,name:base_report_to_printer.action_printing_printer_form
121 #: model:ir.ui.menu,name:base_report_to_printer.menu_printing_printer_form
122 #: view:printing.printer:0
123 msgid "Printers"
124 msgstr ""
125
126 #. module: base_report_to_printer
127+#: view:ir.actions.report.xml:0
128+msgid "Print"
129+msgstr ""
130+
131+#. module: base_report_to_printer
132 #: field:res.users,printing_action:0
133 msgid "Printing Action"
134 msgstr ""
135
136 #. module: base_report_to_printer
137-#: model:ir.module.module,description:base_report_to_printer.module_meta_information
138-msgid "Extracted from printjob ( http://apps.openerp.com/addon/1727 ), this module allows to send reports to a printer attached to the server. Settings can be configured globaly, per user, per report and per user and report."
139-msgstr ""
140-
141-#. module: base_report_to_printer
142 #: field:printing.action,type:0
143 msgid "Type"
144 msgstr ""
145
146 #. module: base_report_to_printer
147+#: field:printing.printer,model:0
148+msgid "Model"
149+msgstr ""
150+
151+#. module: base_report_to_printer
152 #: selection:printing.printer,status:0
153 msgid "Available"
154 msgstr ""
155@@ -90,12 +79,22 @@
156 msgstr ""
157
158 #. module: base_report_to_printer
159+#: model:ir.model,name:base_report_to_printer.model_res_users
160+msgid "Users"
161+msgstr ""
162+
163+#. module: base_report_to_printer
164 #: model:ir.model,name:base_report_to_printer.model_printing_report_xml_action
165 #: view:printing.report.xml.action:0
166 msgid "Report Printing Actions"
167 msgstr ""
168
169 #. module: base_report_to_printer
170+#: view:ir.actions.report.xml:0
171+msgid "Specific actions per user"
172+msgstr ""
173+
174+#. module: base_report_to_printer
175 #: model:ir.model,name:base_report_to_printer.model_printing_action
176 msgid "Print Job Action"
177 msgstr ""
178@@ -111,18 +110,13 @@
179 msgstr ""
180
181 #. module: base_report_to_printer
182-#: model:ir.ui.menu,name:base_report_to_printer.menu_printing_config
183-msgid "Configuration"
184-msgstr ""
185-
186-#. module: base_report_to_printer
187-#: model:ir.module.module,shortdesc:base_report_to_printer.module_meta_information
188-msgid "Report to printer"
189-msgstr ""
190-
191-#. module: base_report_to_printer
192-#: model:ir.model,name:base_report_to_printer.model_printjob_printer_update_wizard
193-msgid "printjob.printer.update.wizard"
194+#: field:printing.printer,status:0
195+msgid "Status"
196+msgstr ""
197+
198+#. module: base_report_to_printer
199+#: model:ir.actions.act_window,name:base_report_to_printer.action_printing_printer_form
200+msgid "Show Printers"
201 msgstr ""
202
203 #. module: base_report_to_printer
204@@ -148,7 +142,7 @@
205 msgstr ""
206
207 #. module: base_report_to_printer
208-#: code:addons/base_report_to_printer/printing.py:189
209+#: code:addons/base_report_to_printer/printing.py:186
210 #, python-format
211 msgid "Send to Client"
212 msgstr ""
213@@ -159,11 +153,6 @@
214 msgstr ""
215
216 #. module: base_report_to_printer
217-#: model:ir.model,name:base_report_to_printer.model_printing_printer_update_wizard
218-msgid "printing.printer.update.wizard"
219-msgstr ""
220-
221-#. module: base_report_to_printer
222 #: model:ir.actions.act_window,name:base_report_to_printer.action_printer_update_wizard
223 #: model:ir.ui.menu,name:base_report_to_printer.menu_printer_update_wizard
224 #: view:printing.printer.update.wizard:0
225@@ -171,7 +160,7 @@
226 msgstr ""
227
228 #. module: base_report_to_printer
229-#: code:addons/base_report_to_printer/printing.py:188
230+#: code:addons/base_report_to_printer/printing.py:185
231 #, python-format
232 msgid "Send to Printer"
233 msgstr ""
234@@ -194,8 +183,8 @@
235 msgstr ""
236
237 #. module: base_report_to_printer
238-#: field:printing.printer,model:0
239-msgid "Model"
240+#: view:ir.actions.report.xml:0
241+msgid "Security"
242 msgstr ""
243
244 #. module: base_report_to_printer
245@@ -219,28 +208,18 @@
246 msgstr ""
247
248 #. module: base_report_to_printer
249-#: view:printing.job:0
250-msgid "Print Jobs"
251-msgstr ""
252-
253-#. module: base_report_to_printer
254 #: view:printing.printer.update.wizard:0
255 msgid "Cancel"
256 msgstr ""
257
258 #. module: base_report_to_printer
259-#: model:ir.model,name:base_report_to_printer.model_res_users
260-msgid "res.users"
261+#: model:res.groups,name:base_report_to_printer.res_groups_printingprintoperator0
262+msgid "Printing / Print Operator"
263 msgstr ""
264
265 #. module: base_report_to_printer
266-#: code:addons/base_report_to_printer/printing.py:190
267+#: code:addons/base_report_to_printer/printing.py:187
268 #, python-format
269 msgid "Use user's defaults"
270 msgstr ""
271
272-#. module: base_report_to_printer
273-#: model:ir.model,name:base_report_to_printer.model_ir_actions_report_xml
274-msgid "ir.actions.report.xml"
275-msgstr ""
276-
277
278=== added file 'base_report_to_printer/i18n/fr.po'
279--- base_report_to_printer/i18n/fr.po 1970-01-01 00:00:00 +0000
280+++ base_report_to_printer/i18n/fr.po 2013-11-05 15:33:50 +0000
281@@ -0,0 +1,225 @@
282+# Translation of OpenERP Server.
283+# This file contains the translation of the following modules:
284+# * base_report_to_printer
285+#
286+msgid ""
287+msgstr ""
288+"Project-Id-Version: OpenERP Server 7.0\n"
289+"Report-Msgid-Bugs-To: \n"
290+"POT-Creation-Date: 2013-11-05 14:48+0000\n"
291+"PO-Revision-Date: 2013-11-05 14:48+0000\n"
292+"Last-Translator: <>\n"
293+"Language-Team: \n"
294+"MIME-Version: 1.0\n"
295+"Content-Type: text/plain; charset=UTF-8\n"
296+"Content-Transfer-Encoding: \n"
297+"Plural-Forms: \n"
298+
299+#. module: base_report_to_printer
300+#: selection:printing.printer,status:0
301+msgid "Unavailable"
302+msgstr "Non disponible"
303+
304+#. module: base_report_to_printer
305+#: view:printing.printer.update.wizard:0
306+msgid "This process will create all missing printers from the current CUPS server."
307+msgstr "Cette opération va créer les imprimantes manquantes à partir du server CUPS courant."
308+
309+#. module: base_report_to_printer
310+#: selection:printing.printer,status:0
311+msgid "Unknown"
312+msgstr "Inconnu"
313+
314+#. module: base_report_to_printer
315+#: field:printing.printer,system_name:0
316+msgid "System Name"
317+msgstr "Nom sytème"
318+
319+#. module: base_report_to_printer
320+#: field:printing.printer,location:0
321+msgid "Location"
322+msgstr "Emplacement"
323+
324+#. module: base_report_to_printer
325+#: model:ir.ui.menu,name:base_report_to_printer.menu_printing_printer_form
326+#: view:printing.printer:0
327+msgid "Printers"
328+msgstr "Imprimantes"
329+
330+#. module: base_report_to_printer
331+#: view:ir.actions.report.xml:0
332+msgid "Print"
333+msgstr "Imprimer"
334+
335+#. module: base_report_to_printer
336+#: field:res.users,printing_action:0
337+msgid "Printing Action"
338+msgstr "Activité d'impression"
339+
340+#. module: base_report_to_printer
341+#: field:printing.action,type:0
342+msgid "Type"
343+msgstr "Type"
344+
345+#. module: base_report_to_printer
346+#: field:printing.printer,model:0
347+msgid "Model"
348+msgstr "Modèle"
349+
350+#. module: base_report_to_printer
351+#: selection:printing.printer,status:0
352+msgid "Available"
353+msgstr "Disponible"
354+
355+#. module: base_report_to_printer
356+#: field:ir.actions.report.xml,printing_printer_id:0
357+#: model:ir.model,name:base_report_to_printer.model_printing_printer
358+#: field:printing.report.xml.action,printer_id:0
359+msgid "Printer"
360+msgstr "Imprimante"
361+
362+#. module: base_report_to_printer
363+#: model:ir.model,name:base_report_to_printer.model_res_users
364+msgid "Users"
365+msgstr "Utilisateurs"
366+
367+#. module: base_report_to_printer
368+#: model:ir.model,name:base_report_to_printer.model_printing_report_xml_action
369+#: view:printing.report.xml.action:0
370+msgid "Report Printing Actions"
371+msgstr "Rapport d'activité d'impression"
372+
373+#. module: base_report_to_printer
374+#: view:ir.actions.report.xml:0
375+msgid "Specific actions per user"
376+msgstr "Action spécifique par utilisateur"
377+
378+#. module: base_report_to_printer
379+#: model:ir.model,name:base_report_to_printer.model_printing_action
380+msgid "Print Job Action"
381+msgstr "Action de Job d'impression"
382+
383+#. module: base_report_to_printer
384+#: field:printing.report.xml.action,user_id:0
385+msgid "User"
386+msgstr "Utilisateur"
387+
388+#. module: base_report_to_printer
389+#: field:printing.report.xml.action,report_id:0
390+msgid "Report"
391+msgstr "Rapport"
392+
393+#. module: base_report_to_printer
394+#: field:printing.printer,status:0
395+msgid "Status"
396+msgstr "Statut"
397+
398+#. module: base_report_to_printer
399+#: model:ir.actions.act_window,name:base_report_to_printer.action_printing_printer_form
400+msgid "Show Printers"
401+msgstr "Afficher les imprimantes"
402+
403+#. module: base_report_to_printer
404+#: view:printing.printer.update.wizard:0
405+msgid "Ok"
406+msgstr "Ok"
407+
408+#. module: base_report_to_printer
409+#: field:printing.action,name:0
410+#: field:printing.printer,name:0
411+msgid "Name"
412+msgstr "Nom"
413+
414+#. module: base_report_to_printer
415+#: view:printing.printer:0
416+msgid "Set Default"
417+msgstr "Définitir par défaut"
418+
419+#. module: base_report_to_printer
420+#: field:printing.printer,default:0
421+#: field:res.users,printing_printer_id:0
422+msgid "Default Printer"
423+msgstr "Imprimante par défaut"
424+
425+#. module: base_report_to_printer
426+#: code:addons/base_report_to_printer/printing.py:186
427+#, python-format
428+msgid "Send to Client"
429+msgstr "Envoyer au client"
430+
431+#. module: base_report_to_printer
432+#: field:printing.printer,uri:0
433+msgid "URI"
434+msgstr "URI"
435+
436+#. module: base_report_to_printer
437+#: model:ir.actions.act_window,name:base_report_to_printer.action_printer_update_wizard
438+#: model:ir.ui.menu,name:base_report_to_printer.menu_printer_update_wizard
439+#: view:printing.printer.update.wizard:0
440+msgid "Update Printers from CUPS"
441+msgstr "Mettre à jour les imprimantes depuis CUPS"
442+
443+#. module: base_report_to_printer
444+#: code:addons/base_report_to_printer/printing.py:185
445+#, python-format
446+msgid "Send to Printer"
447+msgstr "Envoyer à l'imprimante"
448+
449+#. module: base_report_to_printer
450+#: model:ir.ui.menu,name:base_report_to_printer.menu_printing_main
451+#: selection:printing.printer,status:0
452+msgid "Printing"
453+msgstr "Impression en cours"
454+
455+#. module: base_report_to_printer
456+#: selection:printing.printer,status:0
457+msgid "Error"
458+msgstr "Erreur"
459+
460+#. module: base_report_to_printer
461+#: field:ir.actions.report.xml,property_printing_action:0
462+#: field:printing.report.xml.action,action:0
463+msgid "Action"
464+msgstr "Action"
465+
466+#. module: base_report_to_printer
467+#: view:ir.actions.report.xml:0
468+msgid "Security"
469+msgstr "Sécurité"
470+
471+#. module: base_report_to_printer
472+#: field:printing.printer,status_message:0
473+msgid "Status Message"
474+msgstr "Message de Statut"
475+
476+#. module: base_report_to_printer
477+#: help:ir.actions.report.xml,printing_action_ids:0
478+msgid "This field allows configuring action and printer on a per user basis"
479+msgstr "Ce champs permet de configurer les action et les imprimante par utilisateur"
480+
481+#. module: base_report_to_printer
482+#: selection:printing.printer,status:0
483+msgid "Server Error"
484+msgstr "Erreur serveur"
485+
486+#. module: base_report_to_printer
487+#: field:ir.actions.report.xml,printing_action_ids:0
488+msgid "Actions"
489+msgstr "Actions"
490+
491+#. module: base_report_to_printer
492+#: view:printing.printer.update.wizard:0
493+msgid "Cancel"
494+msgstr "Annuler"
495+
496+#. module: base_report_to_printer
497+#: model:res.groups,name:base_report_to_printer.res_groups_printingprintoperator0
498+msgid "Printing / Print Operator"
499+msgstr ""
500+
501+#. module: base_report_to_printer
502+#: code:addons/base_report_to_printer/printing.py:187
503+#, python-format
504+msgid "Use user's defaults"
505+msgstr "Utiliser la configuration par défaut de l'utilisateur"
506+
507
508=== modified file 'base_report_to_printer/i18n/it.po'
509--- base_report_to_printer/i18n/it.po 2012-11-22 21:22:52 +0000
510+++ base_report_to_printer/i18n/it.po 2013-11-05 15:33:50 +0000
511@@ -4,23 +4,18 @@
512 #
513 msgid ""
514 msgstr ""
515-"Project-Id-Version: OpenERP Server 6.0.3\n"
516-"Report-Msgid-Bugs-To: support@openerp.com\n"
517-"POT-Creation-Date: 2011-09-26 09:06+0000\n"
518-"PO-Revision-Date: 2011-09-26 11:14+0100\n"
519-"Last-Translator: Lorenzo Battistini <lorenzo.battistini@agilebg.com>\n"
520+"Project-Id-Version: OpenERP Server 7.0\n"
521+"Report-Msgid-Bugs-To: \n"
522+"POT-Creation-Date: 2013-11-05 14:48+0000\n"
523+"PO-Revision-Date: 2013-11-05 14:48+0000\n"
524+"Last-Translator: <>\n"
525 "Language-Team: \n"
526 "MIME-Version: 1.0\n"
527 "Content-Type: text/plain; charset=UTF-8\n"
528-"Content-Transfer-Encoding: 8bit\n"
529+"Content-Transfer-Encoding: \n"
530 "Plural-Forms: \n"
531
532 #. module: base_report_to_printer
533-#: sql_constraint:res.users:0
534-msgid "You can not have two users with the same login !"
535-msgstr "Non è possibile inserire due utenti con lo stesso nome di login!"
536-
537-#. module: base_report_to_printer
538 #: selection:printing.printer,status:0
539 msgid "Unavailable"
540 msgstr "Non disponibile"
541@@ -36,48 +31,42 @@
542 msgstr "Sconosciuto"
543
544 #. module: base_report_to_printer
545-#: field:printing.printer,status:0
546-msgid "Status"
547-msgstr "Stato"
548-
549-#. module: base_report_to_printer
550 #: field:printing.printer,system_name:0
551 msgid "System Name"
552 msgstr "Nome di sistema"
553
554 #. module: base_report_to_printer
555-#: constraint:res.users:0
556-msgid "The chosen company is not in the allowed companies for this user"
557-msgstr "L'azienda selezionata non è tra quelle a cui è permesso l'accesso a questo utente"
558-
559-#. module: base_report_to_printer
560 #: field:printing.printer,location:0
561 msgid "Location"
562 msgstr "Locazione"
563
564 #. module: base_report_to_printer
565-#: model:ir.actions.act_window,name:base_report_to_printer.action_printing_printer_form
566 #: model:ir.ui.menu,name:base_report_to_printer.menu_printing_printer_form
567 #: view:printing.printer:0
568 msgid "Printers"
569 msgstr "Stampanti"
570
571 #. module: base_report_to_printer
572+#: view:ir.actions.report.xml:0
573+msgid "Print"
574+msgstr ""
575+
576+#. module: base_report_to_printer
577 #: field:res.users,printing_action:0
578 msgid "Printing Action"
579 msgstr "Azione di stampa"
580
581 #. module: base_report_to_printer
582-#: model:ir.module.module,description:base_report_to_printer.module_meta_information
583-msgid "Extracted from printjob ( http://apps.openerp.com/addon/1727 ), this module allows to send reports to a printer attached to the server. Settings can be configured globaly, per user, per report and per user and report."
584-msgstr "Estratto da printjob ( http://apps.openerp.com/addon/1727 ), questo modulo permetto di inviare i report alle stampanti collegate al server. Le impostazioni possono essere configurate globalmente, per utente, per report e per utente e report."
585-
586-#. module: base_report_to_printer
587 #: field:printing.action,type:0
588 msgid "Type"
589 msgstr "Tipo"
590
591 #. module: base_report_to_printer
592+#: field:printing.printer,model:0
593+msgid "Model"
594+msgstr "Model"
595+
596+#. module: base_report_to_printer
597 #: selection:printing.printer,status:0
598 msgid "Available"
599 msgstr "Disponibile"
600@@ -90,40 +79,45 @@
601 msgstr "Stampante"
602
603 #. module: base_report_to_printer
604+#: model:ir.model,name:base_report_to_printer.model_res_users
605+msgid "Users"
606+msgstr ""
607+
608+#. module: base_report_to_printer
609 #: model:ir.model,name:base_report_to_printer.model_printing_report_xml_action
610 #: view:printing.report.xml.action:0
611 msgid "Report Printing Actions"
612-msgstr "Azioni di stampa report"
613+msgstr ""
614+
615+#. module: base_report_to_printer
616+#: view:ir.actions.report.xml:0
617+msgid "Specific actions per user"
618+msgstr ""
619
620 #. module: base_report_to_printer
621 #: model:ir.model,name:base_report_to_printer.model_printing_action
622 msgid "Print Job Action"
623-msgstr "Azione di stampa"
624+msgstr ""
625
626 #. module: base_report_to_printer
627 #: field:printing.report.xml.action,user_id:0
628 msgid "User"
629-msgstr "Utente"
630+msgstr ""
631
632 #. module: base_report_to_printer
633 #: field:printing.report.xml.action,report_id:0
634 msgid "Report"
635-msgstr "Report"
636-
637-#. module: base_report_to_printer
638-#: model:ir.ui.menu,name:base_report_to_printer.menu_printing_config
639-msgid "Configuration"
640-msgstr "Configurazione"
641-
642-#. module: base_report_to_printer
643-#: model:ir.module.module,shortdesc:base_report_to_printer.module_meta_information
644-msgid "Report to printer"
645-msgstr "Report alla stampante"
646-
647-#. module: base_report_to_printer
648-#: model:ir.model,name:base_report_to_printer.model_printjob_printer_update_wizard
649-msgid "printjob.printer.update.wizard"
650-msgstr "printjob.printer.update.wizard"
651+msgstr ""
652+
653+#. module: base_report_to_printer
654+#: field:printing.printer,status:0
655+msgid "Status"
656+msgstr ""
657+
658+#. module: base_report_to_printer
659+#: model:ir.actions.act_window,name:base_report_to_printer.action_printing_printer_form
660+msgid "Show Printers"
661+msgstr ""
662
663 #. module: base_report_to_printer
664 #: view:printing.printer.update.wizard:0
665@@ -148,7 +142,7 @@
666 msgstr "Stampante di default"
667
668 #. module: base_report_to_printer
669-#: code:addons/base_report_to_printer/printing.py:189
670+#: code:addons/base_report_to_printer/printing.py:186
671 #, python-format
672 msgid "Send to Client"
673 msgstr "Invia al client"
674@@ -156,12 +150,7 @@
675 #. module: base_report_to_printer
676 #: field:printing.printer,uri:0
677 msgid "URI"
678-msgstr "URI"
679-
680-#. module: base_report_to_printer
681-#: model:ir.model,name:base_report_to_printer.model_printing_printer_update_wizard
682-msgid "printing.printer.update.wizard"
683-msgstr "printing.printer.update.wizard"
684+msgstr ""
685
686 #. module: base_report_to_printer
687 #: model:ir.actions.act_window,name:base_report_to_printer.action_printer_update_wizard
688@@ -171,7 +160,7 @@
689 msgstr "Aggiorna stampanti da CUPS"
690
691 #. module: base_report_to_printer
692-#: code:addons/base_report_to_printer/printing.py:188
693+#: code:addons/base_report_to_printer/printing.py:185
694 #, python-format
695 msgid "Send to Printer"
696 msgstr "Invia alla stampante"
697@@ -194,9 +183,9 @@
698 msgstr "Azione"
699
700 #. module: base_report_to_printer
701-#: field:printing.printer,model:0
702-msgid "Model"
703-msgstr "Model"
704+#: view:ir.actions.report.xml:0
705+msgid "Security"
706+msgstr ""
707
708 #. module: base_report_to_printer
709 #: field:printing.printer,status_message:0
710@@ -219,28 +208,18 @@
711 msgstr "Azioni"
712
713 #. module: base_report_to_printer
714-#: view:printing.job:0
715-msgid "Print Jobs"
716-msgstr "Stampe"
717-
718-#. module: base_report_to_printer
719 #: view:printing.printer.update.wizard:0
720 msgid "Cancel"
721 msgstr "Annulla"
722
723 #. module: base_report_to_printer
724-#: model:ir.model,name:base_report_to_printer.model_res_users
725-msgid "res.users"
726-msgstr "res.users"
727+#: model:res.groups,name:base_report_to_printer.res_groups_printingprintoperator0
728+msgid "Printing / Print Operator"
729+msgstr ""
730
731 #. module: base_report_to_printer
732-#: code:addons/base_report_to_printer/printing.py:190
733+#: code:addons/base_report_to_printer/printing.py:187
734 #, python-format
735 msgid "Use user's defaults"
736 msgstr "Utilizza i default dell'utente"
737
738-#. module: base_report_to_printer
739-#: model:ir.model,name:base_report_to_printer.model_ir_actions_report_xml
740-msgid "ir.actions.report.xml"
741-msgstr "ir.actions.report.xml"
742-
743
744=== modified file 'base_report_to_printer/printing.py'
745--- base_report_to_printer/printing.py 2013-11-05 15:33:50 +0000
746+++ base_report_to_printer/printing.py 2013-11-05 15:33:50 +0000
747@@ -1,6 +1,6 @@
748 # -*- coding: utf-8 -*-
749 ##############################################################################
750-#
751+#
752 # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
753 # Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com>
754 # Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
755@@ -23,31 +23,25 @@
756 ##############################################################################
757
758 import os
759+import time
760 import base64
761-import threading
762 from tempfile import mkstemp
763+import logging
764
765 import cups
766-import thread
767 from threading import Thread
768 from threading import Lock
769
770-import netsvc
771-import tools
772-import time
773-from osv import fields
774-from osv import osv
775-import pooler
776-import tools
777-from tools.translate import _
778-from base_calendar import base_calendar
779-import logging
780+from openerp import pooler
781+from openerp.osv import orm, fields
782+from openerp.tools.translate import _
783+from openerp.addons.base_calendar import base_calendar
784
785
786 #
787 # Printers
788 #
789-class printing_printer(osv.osv):
790+class printing_printer(orm.Model):
791 _name = "printing.printer"
792 _description = "Printer"
793
794@@ -60,13 +54,14 @@
795 'model': fields.char('Model', size=500, readonly=True),
796 'location': fields.char('Location', size=500, readonly=True),
797 'uri': fields.char('URI', size=500, readonly=True),
798- }
799+ }
800+
801 _order = "name"
802-
803+
804 _defaults = {
805 'default': lambda *a: False,
806 'status': lambda *a: 'unknown',
807- }
808+ }
809
810 def __init__(self, pool, cr):
811 super(printing_printer, self).__init__(pool, cr)
812@@ -74,7 +69,7 @@
813 self.last_update = None
814 self.updating = False
815
816- def update_printers_status(self, db_name, uid, context):
817+ def update_printers_status(self, db_name, uid, context=None):
818 db, pool = pooler.get_db_and_pool(db_name)
819 cr = db.cursor()
820
821@@ -90,13 +85,15 @@
822 4 : 'printing',
823 5 : 'error'
824 }
825-
826+
827+ if context is None:
828+ context = {}
829 try:
830 # Skip update to avoid the thread being created again
831 ctx = context.copy()
832 ctx['skip_update'] = True
833- ids = self.pool.get('printing.printer').search(cr, uid, [], context=ctx)
834- for printer in self.pool.get('printing.printer').browse(cr, uid, ids, context=ctx):
835+ ids = self.search(cr, uid, [], context=ctx)
836+ for printer in self.browse(cr, uid, ids, context=ctx):
837 vals = {}
838 if server_error:
839 status = 'server-error'
840@@ -112,7 +109,7 @@
841 status = 'unavailable'
842
843 vals['status'] = status
844- self.pool.get('printing.printer').write(cr, uid, [printer.id], vals, context)
845+ self.write(cr, uid, [printer.id], vals, context)
846 cr.commit()
847 except:
848 cr.rollback()
849@@ -174,16 +171,13 @@
850 self.write(cr, uid, default_ids, {'default':False}, context)
851 self.write(cr, uid, ids[0], {'default':True}, context)
852 return True
853-
854+
855 def get_default(self,cr,uid,context):
856 printer_ids = self.search(cr, uid,[('default','=',True)])
857 if printer_ids:
858 return printer_ids[0]
859 return False
860
861-printing_printer()
862-
863-
864
865 #
866 # Actions
867@@ -194,23 +188,22 @@
868 ('server',_('Send to Printer')),
869 ('client',_('Send to Client')),
870 ('user_default',_("Use user's defaults")),
871- ]
872+ ]
873
874-class printing_action(osv.osv):
875+class printing_action(orm.Model):
876 _name = 'printing.action'
877 _description = 'Print Job Action'
878
879 _columns = {
880 'name': fields.char('Name', size=256, required=True),
881 'type': fields.selection(_available_action_types, 'Type', required=True),
882- }
883-printing_action()
884+ }
885
886-#
887+#
888 # Users
889 #
890
891-class res_users(osv.osv):
892+class res_users(orm.Model):
893 _name = "res.users"
894 _inherit = "res.users"
895
896@@ -222,17 +215,26 @@
897 _columns = {
898 'printing_action': fields.selection(_user_available_action_types, 'Printing Action'),
899 'printing_printer_id': fields.many2one('printing.printer', 'Default Printer'),
900- }
901-
902-res_users()
903+ }
904
905 #
906 # Reports
907-#
908-
909-class report_xml(osv.osv):
910-
911- def print_direct(self, cr, uid, result, format, printer):
912+#
913+
914+class report_xml(orm.Model):
915+
916+
917+ def set_print_options(self, cr, uid, report_id, format, context=None):
918+ """
919+ Hook to set print options
920+ """
921+ options = {}
922+ if format == 'raw':
923+ options['raw'] = True
924+ return options
925+
926+ def print_direct(self, cr, uid, report_id, result, format, printer, context=None):
927+ user_obj = self.pool.get('res.users')
928 fd, file_name = mkstemp()
929 try:
930 os.write(fd, base64.decodestring(result))
931@@ -244,16 +246,13 @@
932 printer_system_name = printer
933 else:
934 printer_system_name = printer.system_name
935- if format == 'raw':
936- # -l is the same as -o raw
937- cmd = "lpr -l -P %s %s" % (printer_system_name,file_name)
938- #cmd = "lp -d %s %s" % (printer_system_name,file_name)
939- else:
940- cmd = "lpr -P %s %s" % (printer_system_name,file_name)
941- #cmd = "lp -d %s %s" % (printer_system_name,file_name)
942+ connection = cups.Connection()
943+
944+ options = self.set_print_options(cr, uid, report_id, format, context=context)
945+
946+ connection.printFile(printer_system_name, file_name, file_name, options=options)
947 logger = logging.getLogger('base_report_to_printer')
948- logger.info("Printing job : '%s'" % cmd)
949- os.system(cmd)
950+ logger.info("Printing job : '%s'" % file_name)
951 return True
952
953 _inherit = 'ir.actions.report.xml'
954@@ -266,22 +265,21 @@
955 string='Action',
956 view_load=True,
957 method=True,
958- ),
959+ ),
960 'printing_printer_id': fields.many2one('printing.printer', 'Printer'),
961 'printing_action_ids': fields.one2many('printing.report.xml.action', 'report_id', 'Actions', help='This field allows configuring action and printer on a per user basis'),
962- }
963+ }
964
965 def behaviour(self, cr, uid, ids, context=None):
966- if context is None:
967- context={}
968 result = {}
969-
970+ printer_obj = self.pool.get('printing.printer')
971+ printing_act_obj = self.pool.get('printing.report.xml.action')
972 # Set hardcoded default action
973 default_action = 'client'
974 # Retrieve system wide printer
975- default_printer = self.pool.get('printing.printer').get_default(cr,uid,context)
976+ default_printer = printer_obj.get_default(cr, uid, context=context)
977 if default_printer:
978- default_printer = self.pool.get('printing.printer').browse(cr,uid,default_printer,context).system_name
979+ default_printer = printer_obj.browse(cr, uid, default_printer, context=context)
980
981
982 # Retrieve user default values
983@@ -289,7 +287,7 @@
984 if user.printing_action:
985 default_action = user.printing_action
986 if user.printing_printer_id:
987- default_printer = user.printing_printer_id.system_name
988+ default_printer = user.printing_printer_id
989
990 for report in self.browse(cr, uid, ids, context):
991 action = default_action
992@@ -302,8 +300,12 @@
993 printer = report.printing_printer_id
994
995 # Retrieve report-user specific values
996- user_action = self.pool.get('printing.report.xml.action').behaviour(cr, uid, report.id, context)
997- if user_action and user_action['action'] != 'user_default':
998+ act_ids = printing_act_obj.search(cr, uid,
999+ [('report_id', '=', report.id),
1000+ ('user_id', '=', uid),
1001+ ('action', '!=', 'user_default')], context=context)
1002+ if act_ids:
1003+ user_action = printing_act_obj.behaviour(cr, uid, act_ids[0], context)
1004 action = user_action['action']
1005 if user_action['printer']:
1006 printer = user_action['printer']
1007@@ -311,13 +313,11 @@
1008 result[report.id] = {
1009 'action': action,
1010 'printer': printer,
1011- }
1012+ }
1013 return result
1014
1015
1016-report_xml()
1017-
1018-class report_xml_action(osv.osv):
1019+class report_xml_action(orm.Model):
1020 _name = 'printing.report.xml.action'
1021 _description = 'Report Printing Actions'
1022 _columns = {
1023@@ -325,21 +325,18 @@
1024 'user_id': fields.many2one('res.users', 'User', required=True, ondelete='cascade'),
1025 'action': fields.selection(_available_action_types, 'Action', required=True),
1026 'printer_id': fields.many2one('printing.printer', 'Printer'),
1027- }
1028-
1029- def behaviour(self, cr, uid, report_id, context=None):
1030- if context is None:
1031- context={}
1032+ }
1033+
1034+
1035+ def behaviour(self, cr, uid, act_id, context=None):
1036 result = {}
1037- ids = self.search(cr, uid, [('report_id','=',report_id),('user_id','=',uid)], context=context)
1038- if not ids:
1039+ if not act_id:
1040 return False
1041- action = self.browse(cr, uid, ids[0], context)
1042+ action = self.browse(cr, uid, act_id, context=context)
1043 return {
1044 'action': action.action,
1045- 'printer': action.printer_id.system_name,
1046- }
1047-report_xml_action()
1048+ 'printer': action.printer_id,
1049+ }
1050
1051 class virtual_report_spool(base_calendar.virtual_report_spool):
1052
1053@@ -365,10 +362,13 @@
1054 if action != 'client':
1055 if (self._reports and self._reports.get(report_id, False) and self._reports[report_id].get('result', False)
1056 and self._reports[report_id].get('format', False)):
1057- report_obj.print_direct(cr, uid, base64.encodestring(self._reports[report_id]['result']),
1058+ report_obj.print_direct(cr, uid, report.id, base64.encodestring(self._reports[report_id]['result']),
1059 self._reports[report_id]['format'], printer)
1060- raise osv.except_osv(_('Printing...'), _('Document sent to printer %s') % (printer,))
1061-
1062+ # XXX "Warning" removed as it breaks the workflow
1063+ # it would be interesting to have a dialog box to confirm if we really want to print
1064+ # in this case it must be with a by pass parameter to allow massive impression
1065+ #raise osv.except_osv(_('Printing...'), _('Document sent to printer %s') % (printer,))
1066+
1067 except:
1068 cr.rollback()
1069 raise
1070
1071=== modified file 'base_report_to_printer/printing_data.xml'
1072--- base_report_to_printer/printing_data.xml 2012-11-22 21:22:52 +0000
1073+++ base_report_to_printer/printing_data.xml 2013-11-05 15:33:50 +0000
1074@@ -1,20 +1,20 @@
1075 <?xml version="1.0"?>
1076 <openerp>
1077-<data>
1078- <!-- printing.action -->
1079- <record model="printing.action" id="printing_action_1">
1080- <field name="name">Send to Printer</field>
1081- <field name="type">server</field>
1082- </record>
1083- <record model="printing.action" id="printing_action_2">
1084- <field name="name">Send to Client</field>
1085- <field name="type">client</field>
1086- </record>
1087- <!-- properties -->
1088- <record forcecreate="True" id="property_printing_action" model="ir.property">
1089- <field name="name">property_printing_action</field>
1090- <field name="fields_id" search="[('model','=','ir.actions.report.xml'),('name','=','property_printing_action')]"/>
1091- <field name="value" eval="'printing.action,'+str(printing_action_2)"/>
1092- </record>
1093-</data>
1094+ <data>
1095+ <!-- printing.action -->
1096+ <record model="printing.action" id="printing_action_1">
1097+ <field name="name">Send to Printer</field>
1098+ <field name="type">server</field>
1099+ </record>
1100+ <record model="printing.action" id="printing_action_2">
1101+ <field name="name">Send to Client</field>
1102+ <field name="type">client</field>
1103+ </record>
1104+ <!-- properties -->
1105+ <record forcecreate="True" id="property_printing_action" model="ir.property">
1106+ <field name="name">property_printing_action</field>
1107+ <field name="fields_id" search="[('model','=','ir.actions.report.xml'),('name','=','property_printing_action')]"/>
1108+ <field name="value" eval="'printing.action,'+str(printing_action_2)"/>
1109+ </record>
1110+ </data>
1111 </openerp>
1112
1113=== modified file 'base_report_to_printer/printing_view.xml'
1114--- base_report_to_printer/printing_view.xml 2013-11-05 15:33:50 +0000
1115+++ base_report_to_printer/printing_view.xml 2013-11-05 15:33:50 +0000
1116@@ -1,111 +1,114 @@
1117 <?xml version="1.0"?>
1118 <openerp>
1119-<data>
1120+ <data>
1121
1122 <menuitem name="Printing" id="menu_printing_main" parent="base.menu_config" groups="res_groups_printingprintoperator0"/>
1123-
1124- <record model="ir.ui.view" id="view_printing_printer_form">
1125- <field name="name">printing.printer.form</field>
1126- <field name="model">printing.printer</field>
1127- <field name="type">form</field>
1128- <field name="arch" type="xml">
1129- <form string="Printers">
1130- <field name="name" select="1"/>
1131- <field name="system_name" select="1"/>
1132- <group col="3" colspan="2">
1133- <field name="default" select="1"/>
1134- <button name="set_default" string="Set Default" type="object"/>
1135- </group>
1136- <field name="uri" select="2"/>
1137- <field name="model" select="2"/>
1138- <field name="location" select="2"/>
1139- <field name="status" select="1"/>
1140- <field name="status_message" select="2"/>
1141- </form>
1142- </field>
1143- </record>
1144-
1145- <record model="ir.ui.view" id="view_printing_printer_tree">
1146- <field name="name">printing.printer.tree</field>
1147- <field name="model">printing.printer</field>
1148- <field name="type">tree</field>
1149- <field name="arch" type="xml">
1150- <tree string="Printers" colors="green:status=='available'; orange:status=='printing'; red:1;">
1151- <field name="default"/>
1152- <field name="name"/>
1153- <field name="system_name"/>
1154- <field name="status"/>
1155- </tree>
1156- </field>
1157- </record>
1158-
1159- <record model="ir.actions.act_window" id="action_printing_printer_form">
1160- <field name="name">Show Printers</field>
1161- <field name="type">ir.actions.act_window</field>
1162- <field name="res_model">printing.printer</field>
1163- <field name="view_type">form</field>
1164- <field name="view_mode">tree,form</field>
1165- <field name="auto_refresh">20</field>
1166- </record>
1167-
1168- <menuitem name="Printers"
1169- id="menu_printing_printer_form"
1170- parent="menu_printing_main"
1171- action="action_printing_printer_form"/>
1172-
1173- <record model="ir.ui.view" id="action_report_xml_form">
1174- <field name="name">ir.actions.report.xml.printing</field>
1175- <field name="model">ir.actions.report.xml</field>
1176- <field name="type">form</field>
1177- <field name="inherit_id" ref="base.act_report_xml_view" />
1178- <field name="arch" type="xml">
1179- <field name="groups_id" position="before">
1180- <field name="property_printing_action"/>
1181- <field name="printing_printer_id"/>
1182- <field name="printing_action_ids" colspan="4"/>
1183- </field>
1184- </field>
1185- </record>
1186-
1187- <!-- res.users -->
1188- <record model="ir.ui.view" id="view_printing_users_form">
1189- <field name="name">res.users.form.printing</field>
1190- <field name="type">form</field>
1191- <field name="model">res.users</field>
1192- <field name="inherit_id" ref="base.view_users_form" />
1193- <field name="arch" type="xml">
1194- <field name="lang" position="after">
1195- <field name="printing_action" />
1196- <field name="printing_printer_id" />
1197- </field>
1198- </field>
1199- </record>
1200-
1201- <!-- printing.report.xml.action -->
1202- <record model="ir.ui.view" id="printing_report_xml_action_form">
1203- <field name="name">printing.report.xml.action.form</field>
1204- <field name="model">printing.report.xml.action</field>
1205- <field name="type">form</field>
1206- <field name="arch" type="xml">
1207- <form string="Report Printing Actions">
1208- <field name="user_id"/>
1209- <label string=""/>
1210- <field name="action"/>
1211- <field name="printer_id" select="1"/>
1212- </form>
1213- </field>
1214- </record>
1215- <record model="ir.ui.view" id="printing_report_xml_action_tree">
1216- <field name="name">printing.report.xml.action.tree</field>
1217- <field name="model">printing.report.xml.action</field>
1218- <field name="type">tree</field>
1219- <field name="arch" type="xml">
1220- <tree string="Report Printing Actions">
1221- <field name="user_id"/>
1222- <field name="action" />
1223- <field name="printer_id" />
1224- </tree>
1225- </field>
1226- </record>
1227-</data>
1228-</openerp>
1229\ No newline at end of file
1230+
1231+ <record model="ir.ui.view" id="view_printing_printer_form">
1232+ <field name="name">printing.printer.form</field>
1233+ <field name="model">printing.printer</field>
1234+ <field name="arch" type="xml">
1235+ <form string="Printers">
1236+ <field name="name" select="1"/>
1237+ <field name="system_name" select="1"/>
1238+ <group col="3" colspan="2">
1239+ <field name="default" select="1"/>
1240+ <button name="set_default" string="Set Default" type="object"/>
1241+ </group>
1242+ <field name="uri" select="2"/>
1243+ <field name="model" select="2"/>
1244+ <field name="location" select="2"/>
1245+ <field name="status" select="1"/>
1246+ <field name="status_message" select="2"/>
1247+ </form>
1248+ </field>
1249+ </record>
1250+
1251+ <record model="ir.ui.view" id="view_printing_printer_tree">
1252+ <field name="name">printing.printer.tree</field>
1253+ <field name="model">printing.printer</field>
1254+ <field name="arch" type="xml">
1255+ <tree string="Printers" colors="green:status=='available'; orange:status=='printing'; red:1;">
1256+ <field name="default"/>
1257+ <field name="name"/>
1258+ <field name="system_name"/>
1259+ <field name="status"/>
1260+ </tree>
1261+ </field>
1262+ </record>
1263+
1264+ <record model="ir.actions.act_window" id="action_printing_printer_form">
1265+ <field name="name">Show Printers</field>
1266+ <field name="type">ir.actions.act_window</field>
1267+ <field name="res_model">printing.printer</field>
1268+ <field name="view_type">form</field>
1269+ <field name="view_mode">tree,form</field>
1270+ <field name="auto_refresh">20</field>
1271+ </record>
1272+
1273+ <menuitem name="Printers"
1274+ id="menu_printing_printer_form"
1275+ parent="menu_printing_main"
1276+ action="action_printing_printer_form"/>
1277+
1278+ <record model="ir.ui.view" id="action_report_xml_form">
1279+ <field name="name">ir.actions.report.xml.printing</field>
1280+ <field name="model">ir.actions.report.xml</field>
1281+ <field name="inherit_id" ref="base.act_report_xml_view" />
1282+ <field name="arch" type="xml">
1283+ <page string="Security" position="after">
1284+ <page string="Print">
1285+ <group>
1286+ <field name="property_printing_action"/>
1287+ <field name="printing_printer_id"/>
1288+ </group>
1289+
1290+ <separator string="Specific actions per user"/>
1291+ <field name="printing_action_ids"/>
1292+ </page>
1293+ </page>
1294+ </field>
1295+ </record>
1296+
1297+ <!-- res.users -->
1298+ <record model="ir.ui.view" id="view_printing_users_form">
1299+ <field name="name">res.users.form.printing</field>
1300+ <field name="model">res.users</field>
1301+ <field name="inherit_id" ref="base.view_users_form" />
1302+ <field name="arch" type="xml">
1303+ <field name="lang" position="after">
1304+ <group>
1305+ <field name="printing_action"/>
1306+ <field name="printing_printer_id"/>
1307+ </group>
1308+ </field>
1309+ </field>
1310+ </record>
1311+
1312+ <!-- printing.report.xml.action -->
1313+ <record model="ir.ui.view" id="printing_report_xml_action_form">
1314+ <field name="name">printing.report.xml.action.form</field>
1315+ <field name="model">printing.report.xml.action</field>
1316+ <field name="arch" type="xml">
1317+ <form string="Report Printing Actions">
1318+ <field name="user_id"/>
1319+ <label string=""/>
1320+ <field name="action"/>
1321+ <field name="printer_id" select="1"/>
1322+ </form>
1323+ </field>
1324+ </record>
1325+ <record model="ir.ui.view" id="printing_report_xml_action_tree">
1326+ <field name="name">printing.report.xml.action.tree</field>
1327+ <field name="model">printing.report.xml.action</field>
1328+ <field name="arch" type="xml">
1329+ <tree string="Report Printing Actions">
1330+ <field name="user_id"/>
1331+ <field name="action" />
1332+ <field name="printer_id" />
1333+ </tree>
1334+ </field>
1335+ </record>
1336+
1337+ </data>
1338+</openerp>
1339
1340=== modified file 'base_report_to_printer/wizard/__init__.py'
1341--- base_report_to_printer/wizard/__init__.py 2012-11-22 21:22:52 +0000
1342+++ base_report_to_printer/wizard/__init__.py 2013-11-05 15:33:50 +0000
1343@@ -20,4 +20,4 @@
1344 # along with this program. If not, see <http://www.gnu.org/licenses/>.
1345 #
1346 ##############################################################################
1347-import update_printers
1348+from . import update_printers
1349
1350=== modified file 'base_report_to_printer/wizard/update_printers.py'
1351--- base_report_to_printer/wizard/update_printers.py 2012-11-22 21:22:52 +0000
1352+++ base_report_to_printer/wizard/update_printers.py 2013-11-05 15:33:50 +0000
1353@@ -21,21 +21,16 @@
1354 #
1355 ##############################################################################
1356
1357-import time
1358-import subprocess
1359 import cups
1360
1361-import netsvc
1362-from osv import fields
1363-from osv import osv
1364-from tools.translate import _
1365-
1366-
1367-class printing_printer_update_wizard(osv.osv_memory):
1368+from openerp.osv import orm
1369+
1370+
1371+class printing_printer_update_wizard(orm.TransientModel):
1372 _name = "printing.printer.update.wizard"
1373
1374 _columns = {
1375- }
1376+ }
1377
1378 def action_cancel(self, cr, uid, ids, context=None):
1379 return {}
1380@@ -51,7 +46,7 @@
1381 ids = self.pool.get('printing.printer').search(cr, uid, [('system_name','in',printers.keys())], context=context)
1382 for printer in self.pool.get('printing.printer').browse(cr, uid, ids, context):
1383 del printers[printer.system_name]
1384-
1385+
1386 for name in printers:
1387 printer = printers[name]
1388 self.pool.get('printing.printer').create(cr, uid, {
1389@@ -60,7 +55,7 @@
1390 'model': printer.get('printer-make-and-model', False),
1391 'location': printer.get('printer-location', False),
1392 'uri': printer.get('device-uri', False),
1393- }, context)
1394+ }, context)
1395
1396 return {
1397 'name': 'Printers',
1398@@ -69,8 +64,7 @@
1399 'res_model': 'printing.printer',
1400 'type': 'ir.actions.act_window',
1401 'target': 'current',
1402- }
1403+ }
1404
1405-printing_printer_update_wizard()
1406
1407 # vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
1408
1409=== modified file 'base_report_to_printer/wizard/update_printers.xml'
1410--- base_report_to_printer/wizard/update_printers.xml 2013-11-05 15:33:50 +0000
1411+++ base_report_to_printer/wizard/update_printers.xml 2013-11-05 15:33:50 +0000
1412@@ -1,26 +1,27 @@
1413+<?xml version="1.0"?>
1414 <openerp>
1415-<data>
1416- <record id="printer_update_wizard" model="ir.ui.view">
1417- <field name="name">printing.printer.update.wizard</field>
1418- <field name="model">printing.printer.update.wizard</field>
1419- <field name="type">form</field>
1420- <field name="arch" type="xml">
1421- <form string="Update Printers from CUPS" col="2">
1422- <label string="This process will create all missing printers from the current CUPS server." colspan="2"/>
1423- <separator string="" colspan="2"/>
1424- <button name="action_cancel" icon="gtk-cancel" string="Cancel" special="cancel"/>
1425- <button name="action_ok" type="object" icon="gtk-ok" string="Ok"/>
1426- </form>
1427- </field>
1428- </record>
1429- <record id="action_printer_update_wizard" model="ir.actions.act_window">
1430- <field name="name">Update Printers from CUPS</field>
1431- <field name="type">ir.actions.act_window</field>
1432- <field name="res_model">printing.printer.update.wizard</field>
1433- <field name="view_type">form</field>
1434- <field name="view_mode">form</field>
1435- <field name="target">new</field>
1436- </record>
1437- <menuitem action="action_printer_update_wizard" id="menu_printer_update_wizard" parent="menu_printing_main"/>
1438-</data>
1439+ <data>
1440+ <record id="printer_update_wizard" model="ir.ui.view">
1441+ <field name="name">printing.printer.update.wizard</field>
1442+ <field name="model">printing.printer.update.wizard</field>
1443+ <field name="type">form</field>
1444+ <field name="arch" type="xml">
1445+ <form string="Update Printers from CUPS" col="2">
1446+ <label string="This process will create all missing printers from the current CUPS server." colspan="2"/>
1447+ <separator string="" colspan="2"/>
1448+ <button name="action_cancel" icon="gtk-cancel" string="Cancel" special="cancel"/>
1449+ <button name="action_ok" type="object" icon="gtk-ok" string="Ok"/>
1450+ </form>
1451+ </field>
1452+ </record>
1453+ <record id="action_printer_update_wizard" model="ir.actions.act_window">
1454+ <field name="name">Update Printers from CUPS</field>
1455+ <field name="type">ir.actions.act_window</field>
1456+ <field name="res_model">printing.printer.update.wizard</field>
1457+ <field name="view_type">form</field>
1458+ <field name="view_mode">form</field>
1459+ <field name="target">new</field>
1460+ </record>
1461+ <menuitem action="action_printer_update_wizard" id="menu_printer_update_wizard" parent="menu_printing_main"/>
1462+ </data>
1463 </openerp>