odoo-addon-base-report-to-printer 18.0.1.1.6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (77) hide show
  1. odoo/addons/base_report_to_printer/README.rst +205 -0
  2. odoo/addons/base_report_to_printer/__init__.py +9 -0
  3. odoo/addons/base_report_to_printer/__manifest__.py +39 -0
  4. odoo/addons/base_report_to_printer/data/neutralize.sql +2 -0
  5. odoo/addons/base_report_to_printer/data/printing_data.xml +27 -0
  6. odoo/addons/base_report_to_printer/i18n/am.po +936 -0
  7. odoo/addons/base_report_to_printer/i18n/base_report_to_printer.pot +932 -0
  8. odoo/addons/base_report_to_printer/i18n/bg.po +939 -0
  9. odoo/addons/base_report_to_printer/i18n/ca.po +936 -0
  10. odoo/addons/base_report_to_printer/i18n/de.po +994 -0
  11. odoo/addons/base_report_to_printer/i18n/el_GR.po +937 -0
  12. odoo/addons/base_report_to_printer/i18n/es.po +1004 -0
  13. odoo/addons/base_report_to_printer/i18n/es_AR.po +987 -0
  14. odoo/addons/base_report_to_printer/i18n/es_ES.po +937 -0
  15. odoo/addons/base_report_to_printer/i18n/fi.po +939 -0
  16. odoo/addons/base_report_to_printer/i18n/fr.po +999 -0
  17. odoo/addons/base_report_to_printer/i18n/gl.po +936 -0
  18. odoo/addons/base_report_to_printer/i18n/hr.po +966 -0
  19. odoo/addons/base_report_to_printer/i18n/hr_HR.po +941 -0
  20. odoo/addons/base_report_to_printer/i18n/it.po +985 -0
  21. odoo/addons/base_report_to_printer/i18n/nl.po +939 -0
  22. odoo/addons/base_report_to_printer/i18n/nl_NL.po +950 -0
  23. odoo/addons/base_report_to_printer/i18n/pt.po +936 -0
  24. odoo/addons/base_report_to_printer/i18n/pt_BR.po +940 -0
  25. odoo/addons/base_report_to_printer/i18n/pt_PT.po +937 -0
  26. odoo/addons/base_report_to_printer/i18n/sl.po +943 -0
  27. odoo/addons/base_report_to_printer/i18n/sv.po +983 -0
  28. odoo/addons/base_report_to_printer/i18n/tr.po +936 -0
  29. odoo/addons/base_report_to_printer/i18n/zh_CN.po +958 -0
  30. odoo/addons/base_report_to_printer/models/__init__.py +8 -0
  31. odoo/addons/base_report_to_printer/models/ir_actions_report.py +253 -0
  32. odoo/addons/base_report_to_printer/models/printing_action.py +26 -0
  33. odoo/addons/base_report_to_printer/models/printing_job.py +131 -0
  34. odoo/addons/base_report_to_printer/models/printing_printer.py +268 -0
  35. odoo/addons/base_report_to_printer/models/printing_report_xml_action.py +48 -0
  36. odoo/addons/base_report_to_printer/models/printing_server.py +275 -0
  37. odoo/addons/base_report_to_printer/models/printing_tray.py +21 -0
  38. odoo/addons/base_report_to_printer/models/res_users.py +55 -0
  39. odoo/addons/base_report_to_printer/readme/CONFIGURE.md +13 -0
  40. odoo/addons/base_report_to_printer/readme/CONTRIBUTORS.md +18 -0
  41. odoo/addons/base_report_to_printer/readme/CREDITS.md +1 -0
  42. odoo/addons/base_report_to_printer/readme/DESCRIPTION.md +27 -0
  43. odoo/addons/base_report_to_printer/readme/HISTORY.md +7 -0
  44. odoo/addons/base_report_to_printer/readme/INSTALL.md +10 -0
  45. odoo/addons/base_report_to_printer/readme/ROADMAP.md +3 -0
  46. odoo/addons/base_report_to_printer/readme/USAGE.md +15 -0
  47. odoo/addons/base_report_to_printer/security/ir.model.access.csv +2 -0
  48. odoo/addons/base_report_to_printer/security/security.xml +151 -0
  49. odoo/addons/base_report_to_printer/static/description/icon.png +0 -0
  50. odoo/addons/base_report_to_printer/static/description/index.html +561 -0
  51. odoo/addons/base_report_to_printer/static/src/js/qweb_action_manager.esm.js +92 -0
  52. odoo/addons/base_report_to_printer/tests/__init__.py +13 -0
  53. odoo/addons/base_report_to_printer/tests/test_ir_actions_report.py +350 -0
  54. odoo/addons/base_report_to_printer/tests/test_printing_job.py +70 -0
  55. odoo/addons/base_report_to_printer/tests/test_printing_printer.py +198 -0
  56. odoo/addons/base_report_to_printer/tests/test_printing_printer_tray.py +256 -0
  57. odoo/addons/base_report_to_printer/tests/test_printing_printer_wizard.py +94 -0
  58. odoo/addons/base_report_to_printer/tests/test_printing_report_xml_action.py +98 -0
  59. odoo/addons/base_report_to_printer/tests/test_printing_server.py +219 -0
  60. odoo/addons/base_report_to_printer/tests/test_printing_tray.py +49 -0
  61. odoo/addons/base_report_to_printer/tests/test_report.py +226 -0
  62. odoo/addons/base_report_to_printer/tests/test_res_users.py +53 -0
  63. odoo/addons/base_report_to_printer/views/ir_actions_report.xml +21 -0
  64. odoo/addons/base_report_to_printer/views/printing_job.xml +46 -0
  65. odoo/addons/base_report_to_printer/views/printing_printer.xml +147 -0
  66. odoo/addons/base_report_to_printer/views/printing_report.xml +39 -0
  67. odoo/addons/base_report_to_printer/views/printing_server.xml +79 -0
  68. odoo/addons/base_report_to_printer/views/res_users.xml +33 -0
  69. odoo/addons/base_report_to_printer/wizards/__init__.py +2 -0
  70. odoo/addons/base_report_to_printer/wizards/print_attachment_report.py +80 -0
  71. odoo/addons/base_report_to_printer/wizards/print_attachment_report.xml +56 -0
  72. odoo/addons/base_report_to_printer/wizards/printing_printer_update_wizard.py +27 -0
  73. odoo/addons/base_report_to_printer/wizards/printing_printer_update_wizard_view.xml +37 -0
  74. odoo_addon_base_report_to_printer-18.0.1.1.6.dist-info/METADATA +222 -0
  75. odoo_addon_base_report_to_printer-18.0.1.1.6.dist-info/RECORD +77 -0
  76. odoo_addon_base_report_to_printer-18.0.1.1.6.dist-info/WHEEL +5 -0
  77. odoo_addon_base_report_to_printer-18.0.1.1.6.dist-info/top_level.txt +1 -0
@@ -0,0 +1,561 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
3
+ <head>
4
+ <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5
+ <meta name="generator" content="Docutils: https://docutils.sourceforge.io/" />
6
+ <title>README.rst</title>
7
+ <style type="text/css">
8
+
9
+ /*
10
+ :Author: David Goodger (goodger@python.org)
11
+ :Id: $Id: html4css1.css 9511 2024-01-13 09:50:07Z milde $
12
+ :Copyright: This stylesheet has been placed in the public domain.
13
+
14
+ Default cascading style sheet for the HTML output of Docutils.
15
+ Despite the name, some widely supported CSS2 features are used.
16
+
17
+ See https://docutils.sourceforge.io/docs/howto/html-stylesheets.html for how to
18
+ customize this style sheet.
19
+ */
20
+
21
+ /* used to remove borders from tables and images */
22
+ .borderless, table.borderless td, table.borderless th {
23
+ border: 0 }
24
+
25
+ table.borderless td, table.borderless th {
26
+ /* Override padding for "table.docutils td" with "! important".
27
+ The right padding separates the table cells. */
28
+ padding: 0 0.5em 0 0 ! important }
29
+
30
+ .first {
31
+ /* Override more specific margin styles with "! important". */
32
+ margin-top: 0 ! important }
33
+
34
+ .last, .with-subtitle {
35
+ margin-bottom: 0 ! important }
36
+
37
+ .hidden {
38
+ display: none }
39
+
40
+ .subscript {
41
+ vertical-align: sub;
42
+ font-size: smaller }
43
+
44
+ .superscript {
45
+ vertical-align: super;
46
+ font-size: smaller }
47
+
48
+ a.toc-backref {
49
+ text-decoration: none ;
50
+ color: black }
51
+
52
+ blockquote.epigraph {
53
+ margin: 2em 5em ; }
54
+
55
+ dl.docutils dd {
56
+ margin-bottom: 0.5em }
57
+
58
+ object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
59
+ overflow: hidden;
60
+ }
61
+
62
+ /* Uncomment (and remove this text!) to get bold-faced definition list terms
63
+ dl.docutils dt {
64
+ font-weight: bold }
65
+ */
66
+
67
+ div.abstract {
68
+ margin: 2em 5em }
69
+
70
+ div.abstract p.topic-title {
71
+ font-weight: bold ;
72
+ text-align: center }
73
+
74
+ div.admonition, div.attention, div.caution, div.danger, div.error,
75
+ div.hint, div.important, div.note, div.tip, div.warning {
76
+ margin: 2em ;
77
+ border: medium outset ;
78
+ padding: 1em }
79
+
80
+ div.admonition p.admonition-title, div.hint p.admonition-title,
81
+ div.important p.admonition-title, div.note p.admonition-title,
82
+ div.tip p.admonition-title {
83
+ font-weight: bold ;
84
+ font-family: sans-serif }
85
+
86
+ div.attention p.admonition-title, div.caution p.admonition-title,
87
+ div.danger p.admonition-title, div.error p.admonition-title,
88
+ div.warning p.admonition-title, .code .error {
89
+ color: red ;
90
+ font-weight: bold ;
91
+ font-family: sans-serif }
92
+
93
+ /* Uncomment (and remove this text!) to get reduced vertical space in
94
+ compound paragraphs.
95
+ div.compound .compound-first, div.compound .compound-middle {
96
+ margin-bottom: 0.5em }
97
+
98
+ div.compound .compound-last, div.compound .compound-middle {
99
+ margin-top: 0.5em }
100
+ */
101
+
102
+ div.dedication {
103
+ margin: 2em 5em ;
104
+ text-align: center ;
105
+ font-style: italic }
106
+
107
+ div.dedication p.topic-title {
108
+ font-weight: bold ;
109
+ font-style: normal }
110
+
111
+ div.figure {
112
+ margin-left: 2em ;
113
+ margin-right: 2em }
114
+
115
+ div.footer, div.header {
116
+ clear: both;
117
+ font-size: smaller }
118
+
119
+ div.line-block {
120
+ display: block ;
121
+ margin-top: 1em ;
122
+ margin-bottom: 1em }
123
+
124
+ div.line-block div.line-block {
125
+ margin-top: 0 ;
126
+ margin-bottom: 0 ;
127
+ margin-left: 1.5em }
128
+
129
+ div.sidebar {
130
+ margin: 0 0 0.5em 1em ;
131
+ border: medium outset ;
132
+ padding: 1em ;
133
+ background-color: #ffffee ;
134
+ width: 40% ;
135
+ float: right ;
136
+ clear: right }
137
+
138
+ div.sidebar p.rubric {
139
+ font-family: sans-serif ;
140
+ font-size: medium }
141
+
142
+ div.system-messages {
143
+ margin: 5em }
144
+
145
+ div.system-messages h1 {
146
+ color: red }
147
+
148
+ div.system-message {
149
+ border: medium outset ;
150
+ padding: 1em }
151
+
152
+ div.system-message p.system-message-title {
153
+ color: red ;
154
+ font-weight: bold }
155
+
156
+ div.topic {
157
+ margin: 2em }
158
+
159
+ h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
160
+ h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
161
+ margin-top: 0.4em }
162
+
163
+ h1.title {
164
+ text-align: center }
165
+
166
+ h2.subtitle {
167
+ text-align: center }
168
+
169
+ hr.docutils {
170
+ width: 75% }
171
+
172
+ img.align-left, .figure.align-left, object.align-left, table.align-left {
173
+ clear: left ;
174
+ float: left ;
175
+ margin-right: 1em }
176
+
177
+ img.align-right, .figure.align-right, object.align-right, table.align-right {
178
+ clear: right ;
179
+ float: right ;
180
+ margin-left: 1em }
181
+
182
+ img.align-center, .figure.align-center, object.align-center {
183
+ display: block;
184
+ margin-left: auto;
185
+ margin-right: auto;
186
+ }
187
+
188
+ table.align-center {
189
+ margin-left: auto;
190
+ margin-right: auto;
191
+ }
192
+
193
+ .align-left {
194
+ text-align: left }
195
+
196
+ .align-center {
197
+ clear: both ;
198
+ text-align: center }
199
+
200
+ .align-right {
201
+ text-align: right }
202
+
203
+ /* reset inner alignment in figures */
204
+ div.align-right {
205
+ text-align: inherit }
206
+
207
+ /* div.align-center * { */
208
+ /* text-align: left } */
209
+
210
+ .align-top {
211
+ vertical-align: top }
212
+
213
+ .align-middle {
214
+ vertical-align: middle }
215
+
216
+ .align-bottom {
217
+ vertical-align: bottom }
218
+
219
+ ol.simple, ul.simple {
220
+ margin-bottom: 1em }
221
+
222
+ ol.arabic {
223
+ list-style: decimal }
224
+
225
+ ol.loweralpha {
226
+ list-style: lower-alpha }
227
+
228
+ ol.upperalpha {
229
+ list-style: upper-alpha }
230
+
231
+ ol.lowerroman {
232
+ list-style: lower-roman }
233
+
234
+ ol.upperroman {
235
+ list-style: upper-roman }
236
+
237
+ p.attribution {
238
+ text-align: right ;
239
+ margin-left: 50% }
240
+
241
+ p.caption {
242
+ font-style: italic }
243
+
244
+ p.credits {
245
+ font-style: italic ;
246
+ font-size: smaller }
247
+
248
+ p.label {
249
+ white-space: nowrap }
250
+
251
+ p.rubric {
252
+ font-weight: bold ;
253
+ font-size: larger ;
254
+ color: maroon ;
255
+ text-align: center }
256
+
257
+ p.sidebar-title {
258
+ font-family: sans-serif ;
259
+ font-weight: bold ;
260
+ font-size: larger }
261
+
262
+ p.sidebar-subtitle {
263
+ font-family: sans-serif ;
264
+ font-weight: bold }
265
+
266
+ p.topic-title {
267
+ font-weight: bold }
268
+
269
+ pre.address {
270
+ margin-bottom: 0 ;
271
+ margin-top: 0 ;
272
+ font: inherit }
273
+
274
+ pre.literal-block, pre.doctest-block, pre.math, pre.code {
275
+ margin-left: 2em ;
276
+ margin-right: 2em }
277
+
278
+ pre.code .ln { color: gray; } /* line numbers */
279
+ pre.code, code { background-color: #eeeeee }
280
+ pre.code .comment, code .comment { color: #5C6576 }
281
+ pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
282
+ pre.code .literal.string, code .literal.string { color: #0C5404 }
283
+ pre.code .name.builtin, code .name.builtin { color: #352B84 }
284
+ pre.code .deleted, code .deleted { background-color: #DEB0A1}
285
+ pre.code .inserted, code .inserted { background-color: #A3D289}
286
+
287
+ span.classifier {
288
+ font-family: sans-serif ;
289
+ font-style: oblique }
290
+
291
+ span.classifier-delimiter {
292
+ font-family: sans-serif ;
293
+ font-weight: bold }
294
+
295
+ span.interpreted {
296
+ font-family: sans-serif }
297
+
298
+ span.option {
299
+ white-space: nowrap }
300
+
301
+ span.pre {
302
+ white-space: pre }
303
+
304
+ span.problematic, pre.problematic {
305
+ color: red }
306
+
307
+ span.section-subtitle {
308
+ /* font-size relative to parent (h1..h6 element) */
309
+ font-size: 80% }
310
+
311
+ table.citation {
312
+ border-left: solid 1px gray;
313
+ margin-left: 1px }
314
+
315
+ table.docinfo {
316
+ margin: 2em 4em }
317
+
318
+ table.docutils {
319
+ margin-top: 0.5em ;
320
+ margin-bottom: 0.5em }
321
+
322
+ table.footnote {
323
+ border-left: solid 1px black;
324
+ margin-left: 1px }
325
+
326
+ table.docutils td, table.docutils th,
327
+ table.docinfo td, table.docinfo th {
328
+ padding-left: 0.5em ;
329
+ padding-right: 0.5em ;
330
+ vertical-align: top }
331
+
332
+ table.docutils th.field-name, table.docinfo th.docinfo-name {
333
+ font-weight: bold ;
334
+ text-align: left ;
335
+ white-space: nowrap ;
336
+ padding-left: 0 }
337
+
338
+ /* "booktabs" style (no vertical lines) */
339
+ table.docutils.booktabs {
340
+ border: 0px;
341
+ border-top: 2px solid;
342
+ border-bottom: 2px solid;
343
+ border-collapse: collapse;
344
+ }
345
+ table.docutils.booktabs * {
346
+ border: 0px;
347
+ }
348
+ table.docutils.booktabs th {
349
+ border-bottom: thin solid;
350
+ text-align: left;
351
+ }
352
+
353
+ h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
354
+ h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
355
+ font-size: 100% }
356
+
357
+ ul.auto-toc {
358
+ list-style-type: none }
359
+
360
+ </style>
361
+ </head>
362
+ <body>
363
+ <div class="document">
364
+
365
+
366
+ <a class="reference external image-reference" href="https://odoo-community.org/get-involved?utm_source=readme">
367
+ <img alt="Odoo Community Association" src="https://odoo-community.org/readme-banner-image" />
368
+ </a>
369
+ <div class="section" id="report-to-printer">
370
+ <h1>Report to printer</h1>
371
+ <!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
372
+ !! This file is generated by oca-gen-addon-readme !!
373
+ !! changes will be overwritten. !!
374
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
375
+ !! source digest: sha256:ef1f57f3e22ab9d930c27fab82b161d0a1b27cf559525979ccc8300cca95fcc5
376
+ !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
377
+ <p><a class="reference external image-reference" href="https://odoo-community.org/page/development-status"><img alt="Beta" src="https://img.shields.io/badge/maturity-Beta-yellow.png" /></a> <a class="reference external image-reference" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/license-AGPL--3-blue.png" /></a> <a class="reference external image-reference" href="https://github.com/OCA/report-print-send/tree/18.0/base_report_to_printer"><img alt="OCA/report-print-send" src="https://img.shields.io/badge/github-OCA%2Freport--print--send-lightgray.png?logo=github" /></a> <a class="reference external image-reference" href="https://translation.odoo-community.org/projects/report-print-send-18-0/report-print-send-18-0-base_report_to_printer"><img alt="Translate me on Weblate" src="https://img.shields.io/badge/weblate-Translate%20me-F47D42.png" /></a> <a class="reference external image-reference" href="https://runboat.odoo-community.org/builds?repo=OCA/report-print-send&amp;target_branch=18.0"><img alt="Try me on Runboat" src="https://img.shields.io/badge/runboat-Try%20me-875A7B.png" /></a></p>
378
+ <p>This module allows users to send reports to a printer attached to the
379
+ server.</p>
380
+ <p>It adds an optional behaviour on reports to send it directly to a
381
+ printer.</p>
382
+ <ul class="simple">
383
+ <li>Send to Client is the default behaviour providing you a downloadable
384
+ PDF</li>
385
+ <li>Send to Printer prints the report on selected printer</li>
386
+ </ul>
387
+ <p>It detects trays on printers installation plus permits to select the
388
+ paper source on which you want to print directly.</p>
389
+ <p>Report behaviour is defined by settings.</p>
390
+ <p>You will find this option on default user config, on default report
391
+ config and on specific config per user per report.</p>
392
+ <p>This allows you to dedicate a specific paper source for example for
393
+ preprinted paper such as payment slip.</p>
394
+ <p>Settings can be configured:</p>
395
+ <ul class="simple">
396
+ <li>globally</li>
397
+ <li>per user</li>
398
+ <li>per report</li>
399
+ <li>per user and report</li>
400
+ </ul>
401
+ <p><strong>Table of contents</strong></p>
402
+ <div class="contents local topic" id="contents">
403
+ <ul class="simple">
404
+ <li><a class="reference internal" href="#installation" id="toc-entry-1">Installation</a></li>
405
+ <li><a class="reference internal" href="#configuration" id="toc-entry-2">Configuration</a></li>
406
+ <li><a class="reference internal" href="#usage" id="toc-entry-3">Usage</a></li>
407
+ <li><a class="reference internal" href="#known-issues-roadmap" id="toc-entry-4">Known issues / Roadmap</a></li>
408
+ <li><a class="reference internal" href="#changelog" id="toc-entry-5">Changelog</a><ul>
409
+ <li><a class="reference internal" href="#section-1" id="toc-entry-6">13.0.1.0.0 (2019-09-30)</a></li>
410
+ <li><a class="reference internal" href="#section-2" id="toc-entry-7">12.0.1.0.0 (2018-02-04)</a></li>
411
+ </ul>
412
+ </li>
413
+ <li><a class="reference internal" href="#bug-tracker" id="toc-entry-8">Bug Tracker</a></li>
414
+ <li><a class="reference internal" href="#credits" id="toc-entry-9">Credits</a><ul>
415
+ <li><a class="reference internal" href="#authors" id="toc-entry-10">Authors</a></li>
416
+ <li><a class="reference internal" href="#contributors" id="toc-entry-11">Contributors</a></li>
417
+ <li><a class="reference internal" href="#other-credits" id="toc-entry-12">Other credits</a></li>
418
+ <li><a class="reference internal" href="#maintainers" id="toc-entry-13">Maintainers</a></li>
419
+ </ul>
420
+ </li>
421
+ </ul>
422
+ </div>
423
+ <div class="section" id="installation">
424
+ <h2><a class="toc-backref" href="#toc-entry-1">Installation</a></h2>
425
+ <p>To install this module, you need to:</p>
426
+ <ol class="arabic simple">
427
+ <li>Install PyCups - <a class="reference external" href="https://pypi.python.org/pypi/pycups">https://pypi.python.org/pypi/pycups</a></li>
428
+ </ol>
429
+ <pre class="code bash literal-block">
430
+ sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>cups<span class="w">
431
+ </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>libcups2-dev<span class="w">
432
+ </span>sudo<span class="w"> </span>apt-get<span class="w"> </span>install<span class="w"> </span>python3-dev<span class="w">
433
+ </span>sudo<span class="w"> </span>pip<span class="w"> </span>install<span class="w"> </span>pycups
434
+ </pre>
435
+ </div>
436
+ <div class="section" id="configuration">
437
+ <h2><a class="toc-backref" href="#toc-entry-2">Configuration</a></h2>
438
+ <p>To configure this module, you need to:</p>
439
+ <ol class="arabic simple">
440
+ <li>Enable the “Printing / Print User” option under access rights to give
441
+ users the ability to view the print menu.</li>
442
+ </ol>
443
+ <p>The jobs will be sent to the printer with a name matching the
444
+ print_report_name of the report (truncated at 80 characters). By default
445
+ this will not be displayed by CUPS web interface or in Odoo. To see this
446
+ information, you need to change the configuration of your CUPS server
447
+ and set the JobPrivateValue directive to “none” (or some other list of
448
+ values which does not include “job-name”) , and reload the server. See
449
+ cupsd.conf(5)
450
+ &lt;<a class="reference external" href="https://www.cups.org/doc/man-cupsd.conf.html&gt;">https://www.cups.org/doc/man-cupsd.conf.html\&gt;</a>
451
+ for details.</p>
452
+ </div>
453
+ <div class="section" id="usage">
454
+ <h2><a class="toc-backref" href="#toc-entry-3">Usage</a></h2>
455
+ <p>Guidelines for use:</p>
456
+ <blockquote>
457
+ <ul class="simple">
458
+ <li>To update the CUPS printers in <em>Settings &gt; Printing &gt; Update
459
+ Printers from CUPS</em></li>
460
+ <li>To print a report on a specific printer or tray, you can change
461
+ these in <em>Settings &gt; Printing &gt; Reports</em> to define default
462
+ behaviour.</li>
463
+ <li>To print a report on a specific printer and/or tray for a user, you
464
+ can change these in <em>Settings &gt; Printing &gt; Reports</em> in <em>Specific
465
+ actions per user</em></li>
466
+ <li>Users may also select a default action, printer or tray in their
467
+ preferences.</li>
468
+ </ul>
469
+ </blockquote>
470
+ <p>When no tray is configured for a report and a user, the default tray
471
+ setup on the CUPS server is used.</p>
472
+ </div>
473
+ <div class="section" id="known-issues-roadmap">
474
+ <h2><a class="toc-backref" href="#toc-entry-4">Known issues / Roadmap</a></h2>
475
+ <ul class="simple">
476
+ <li>With threaded printing there’s no download fallback when the issue
477
+ isn’t detected by the CUPS Odoo backend. To able to do it, we would
478
+ need to notify the bus or use web_notify for it.</li>
479
+ </ul>
480
+ </div>
481
+ <div class="section" id="changelog">
482
+ <h2><a class="toc-backref" href="#toc-entry-5">Changelog</a></h2>
483
+ <div class="section" id="section-1">
484
+ <h3><a class="toc-backref" href="#toc-entry-6">13.0.1.0.0 (2019-09-30)</a></h3>
485
+ <ul class="simple">
486
+ <li>[RELEASE] Port from V12.</li>
487
+ </ul>
488
+ </div>
489
+ <div class="section" id="section-2">
490
+ <h3><a class="toc-backref" href="#toc-entry-7">12.0.1.0.0 (2018-02-04)</a></h3>
491
+ <ul class="simple">
492
+ <li>[RELEASE] Port from V11.</li>
493
+ </ul>
494
+ </div>
495
+ </div>
496
+ <div class="section" id="bug-tracker">
497
+ <h2><a class="toc-backref" href="#toc-entry-8">Bug Tracker</a></h2>
498
+ <p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/report-print-send/issues">GitHub Issues</a>.
499
+ In case of trouble, please check there if your issue has already been reported.
500
+ If you spotted it first, help us to smash it by providing a detailed and welcomed
501
+ <a class="reference external" href="https://github.com/OCA/report-print-send/issues/new?body=module:%20base_report_to_printer%0Aversion:%2018.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**">feedback</a>.</p>
502
+ <p>Do not contact contributors directly about support or help with technical issues.</p>
503
+ </div>
504
+ <div class="section" id="credits">
505
+ <h2><a class="toc-backref" href="#toc-entry-9">Credits</a></h2>
506
+ <div class="section" id="authors">
507
+ <h3><a class="toc-backref" href="#toc-entry-10">Authors</a></h3>
508
+ <ul class="simple">
509
+ <li>Agile Business Group &amp; Domsense</li>
510
+ <li>Pegueroles SCP</li>
511
+ <li>NaN</li>
512
+ <li>LasLabs</li>
513
+ <li>Camptocamp</li>
514
+ <li>Open for Small Business Ltd</li>
515
+ </ul>
516
+ </div>
517
+ <div class="section" id="contributors">
518
+ <h3><a class="toc-backref" href="#toc-entry-11">Contributors</a></h3>
519
+ <ul class="simple">
520
+ <li>Ferran Pegueroles &lt;<a class="reference external" href="mailto:ferran&#64;pegueroles.com">ferran&#64;pegueroles.com</a>&gt;</li>
521
+ <li>Albert Cervera i Areny &lt;<a class="reference external" href="mailto:albert&#64;nan-tic.com">albert&#64;nan-tic.com</a>&gt;</li>
522
+ <li>Davide Corio &lt;<a class="reference external" href="mailto:davide.corio&#64;agilebg.com">davide.corio&#64;agilebg.com</a>&gt;</li>
523
+ <li>Lorenzo Battistini &lt;<a class="reference external" href="mailto:lorenzo.battistini&#64;agilebg.com">lorenzo.battistini&#64;agilebg.com</a>&gt;</li>
524
+ <li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li>
525
+ <li>Lionel Sausin &lt;<a class="reference external" href="mailto:ls&#64;numerigraphe.com">ls&#64;numerigraphe.com</a>&gt;</li>
526
+ <li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
527
+ <li>Dave Lasley &lt;<a class="reference external" href="mailto:dave&#64;laslabs.com">dave&#64;laslabs.com</a>&gt;</li>
528
+ <li>Sylvain Garancher &lt;<a class="reference external" href="mailto:sylvain.garancher&#64;syleam.fr">sylvain.garancher&#64;syleam.fr</a>&gt;</li>
529
+ <li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li>
530
+ <li>Graeme Gellatly &lt;<a class="reference external" href="mailto:graeme&#64;o4sb.com">graeme&#64;o4sb.com</a>&gt;</li>
531
+ <li>Rod Schouteden &lt;<a class="reference external" href="mailto:rod&#64;schout-it.be">rod&#64;schout-it.be</a>&gt;</li>
532
+ <li>Alexandre Fayolle &lt;<a class="reference external" href="mailto:alexandre.fayolle&#64;camptocamp.com">alexandre.fayolle&#64;camptocamp.com</a>&gt;</li>
533
+ <li>Matias Peralta &lt;<a class="reference external" href="mailto:mnp&#64;adhoc.com.ar">mnp&#64;adhoc.com.ar</a>&gt;</li>
534
+ <li>Hughes Damry &lt;<a class="reference external" href="mailto:hughes.damry&#64;acsone.eu">hughes.damry&#64;acsone.eu</a>&gt;</li>
535
+ <li>Akim Juillerat &lt;<a class="reference external" href="mailto:akim.juillerat&#64;camptocamp.com">akim.juillerat&#64;camptocamp.com</a>&gt;</li>
536
+ <li>Jacques-Etienne Baudoux (BCIM) &lt;<a class="reference external" href="mailto:je&#64;bcim.be">je&#64;bcim.be</a>&gt;</li>
537
+ <li>Tris Doan &lt;<a class="reference external" href="mailto:tridm&#64;trobz.com">tridm&#64;trobz.com</a>&gt;</li>
538
+ </ul>
539
+ </div>
540
+ <div class="section" id="other-credits">
541
+ <h3><a class="toc-backref" href="#toc-entry-12">Other credits</a></h3>
542
+ <p>The migration of this module from 17.0 to 18.0 was financially supported
543
+ by Camptocamp.</p>
544
+ </div>
545
+ <div class="section" id="maintainers">
546
+ <h3><a class="toc-backref" href="#toc-entry-13">Maintainers</a></h3>
547
+ <p>This module is maintained by the OCA.</p>
548
+ <a class="reference external image-reference" href="https://odoo-community.org">
549
+ <img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" />
550
+ </a>
551
+ <p>OCA, or the Odoo Community Association, is a nonprofit organization whose
552
+ mission is to support the collaborative development of Odoo features and
553
+ promote its widespread use.</p>
554
+ <p>This module is part of the <a class="reference external" href="https://github.com/OCA/report-print-send/tree/18.0/base_report_to_printer">OCA/report-print-send</a> project on GitHub.</p>
555
+ <p>You are welcome to contribute. To learn how please visit <a class="reference external" href="https://odoo-community.org/page/Contribute">https://odoo-community.org/page/Contribute</a>.</p>
556
+ </div>
557
+ </div>
558
+ </div>
559
+ </div>
560
+ </body>
561
+ </html>
@@ -0,0 +1,92 @@
1
+ import {_t} from "@web/core/l10n/translation";
2
+ import {markup} from "@odoo/owl";
3
+ import {registry} from "@web/core/registry";
4
+
5
+ async function cupsReportActionHandler(action, options, env) {
6
+ if (action.report_type === "qweb-pdf" || action.report_type === "qweb-text") {
7
+ const orm = env.services.orm;
8
+
9
+ const print_action = await orm.call(
10
+ "ir.actions.report",
11
+ "print_action_for_report_name",
12
+ [action.report_name],
13
+ {context: {force_print_to_client: action.context.force_print_to_client}}
14
+ );
15
+ var printer_exception = print_action.printer_exception;
16
+ if (print_action && print_action.action === "server" && !printer_exception) {
17
+ // The Odoo CUPS backend is ok. We try to print into the printer
18
+ const result = await orm.call(
19
+ "ir.actions.report",
20
+ "print_document_client_action",
21
+ [action.id, action.context.active_ids, action.data]
22
+ );
23
+ if (result) {
24
+ env.services.notification.add(_t("Successfully sent to printer!"), {
25
+ type: "success",
26
+ });
27
+ const {onClose} = options;
28
+ if (action.close_on_report_download) {
29
+ return env.services.action.doAction(
30
+ {type: "ir.actions.act_window_close"},
31
+ {onClose}
32
+ );
33
+ } else if (onClose) {
34
+ onClose();
35
+ }
36
+ return true;
37
+ // In case of exception during the job, we won't get any response. So we
38
+ // should flag the exception and notify the user
39
+ }
40
+ env.services.notification.add(_t("Could not sent to printer!"), {
41
+ type: "danger",
42
+ });
43
+ printer_exception = true;
44
+ }
45
+ if (print_action && print_action.action === "server" && printer_exception) {
46
+ // Just so the translation engine detects them as it doesn't do it inside
47
+ // template strings
48
+ const terms = {
49
+ the_report: _t("The report"),
50
+ couldnt_be_printed: _t(
51
+ "couldn't be printed. Click on the button below to download it"
52
+ ),
53
+ issue_on: _t("Issue on"),
54
+ };
55
+ const notificationRemove = env.services.notification.add(
56
+ markup(
57
+ `<p>${terms.the_report} <strong>${action.name}</strong> ${terms.couldnt_be_printed}</p>`
58
+ ),
59
+ {
60
+ title: `${terms.issue_on} ${print_action.printer_name}`,
61
+ type: "warning",
62
+ sticky: true,
63
+ buttons: [
64
+ {
65
+ name: _t("Print"),
66
+ primary: true,
67
+ icon: "fa-print",
68
+ onClick: async () => {
69
+ const context = {
70
+ force_print_to_client: true,
71
+ must_skip_send_to_printer: true,
72
+ };
73
+ await env.services.action.doAction(
74
+ {type: "ir.actions.report", ...action},
75
+ {
76
+ additionalContext: context,
77
+ }
78
+ );
79
+ notificationRemove();
80
+ },
81
+ },
82
+ ],
83
+ }
84
+ );
85
+ return true;
86
+ }
87
+ }
88
+ }
89
+
90
+ registry
91
+ .category("ir.actions.report handlers")
92
+ .add("cups_report_action_handler", cupsReportActionHandler);
@@ -0,0 +1,13 @@
1
+ # Copyright 2016 LasLabs Inc.
2
+ # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
3
+
4
+ from . import test_printing_job
5
+ from . import test_printing_printer
6
+ from . import test_printing_printer_tray
7
+ from . import test_printing_server
8
+ from . import test_printing_tray
9
+ from . import test_report
10
+ from . import test_res_users
11
+ from . import test_ir_actions_report
12
+ from . import test_printing_printer_wizard
13
+ from . import test_printing_report_xml_action