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 on 2013-11-11
Status: Merged
Merged at revision: 9
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
Diff against target: 1556 lines (+613/-413)
13 files modified
base_report_to_printer/AUTHORS.txt (+0/-4)
base_report_to_printer/__init__.py (+2/-2)
base_report_to_printer/__openerp__.py (+62/-35)
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/-73)
base_report_to_printer/printing_data.xml (+17/-17)
base_report_to_printer/printing_view.xml (+106/-105)
base_report_to_printer/security/security.xml (+1/-7)
base_report_to_printer/wizard/__init__.py (+1/-1)
base_report_to_printer/wizard/update_printers.py (+9/-15)
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
Maxime Chambreuil (http://www.savoirfairelinux.com) code review Approve on 2013-12-27
Joël Grand-Guillaume @ camptocamp code review, no tests 2013-11-11 Approve on 2013-12-20
Lorenzo Battistini - Agile BG (community) code review 2013-11-11 Approve on 2013-12-05
Andrew 2013-11-11 Pending
Yannick Vaucher @ Camptocamp Pending
Review via email: mp+194710@code.launchpad.net

This proposal supersedes a proposal from 2013-10-02.

Description of the change

Portage of base_report_to_printer

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

**This MP includes changes made by AES**

To post a comment you must log in.
Andrew (aes) : Posted in a previous version of this proposal
review: Approve
Andrew (aes) wrote : Posted in a previous version of this proposal

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
Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : Posted in a previous version of this proposal

Up

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

Guewen Baconnier @ Camptocamp (gbaconnier-c2c) wrote : Posted in a previous version of this proposal

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

Yannick Vaucher @ Camptocamp (yvaucher-c2c) wrote : Posted in a previous version of this proposal

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: Resubmit

l 63: "You must have lpr installed for this module to work as-is" is it still true?

review: Needs Information

@Lozenzo indeed this comment isn't true anymore. lpr uses CUPS but this isn't needed anymore by this module.

Module description should be updated describing how to use the new version of the module

review: Needs Fixing
34. By Yannick Vaucher @ Camptocamp on 2013-12-03

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

35. By Yannick Vaucher @ Camptocamp on 2013-12-03

[IMP] description add comment on update printers wizard

36. By Yannick Vaucher @ Camptocamp on 2013-12-03

[IMP] adding some explanation in description

Thanks for the review

I improved __openerp__.py and moved authors under Contributors

review: Approve (code review)

Hi,

Thanks for this proposal. Just a little remarks:

 * Line 923, 1079, 1484 : Use explicit Kwargs context=context or ctx

Otherwise, LGTM.

Regards,

review: Needs Fixing (code review, no tests)
37. By Joël Grand-Guillaume @ camptocamp on 2013-12-20

[FIX] Use explicit kwargs: context=context

Just fixed that, I had the right to on that branch. So LGTM

review: Approve (code review, no tests)
review: Approve (code review)

Preview Diff

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