Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[11.0][MIG] base_report_to_printer + printer tray: Merged together #110

Merged
merged 190 commits into from
Dec 18, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
190 commits
Select commit Hold shift + click to select a range
feae5db
[ADD] base_report_to_printer
eLBati Nov 22, 2012
e9598f5
[IMP] base_report_to_printer - module description
eLBati Nov 30, 2012
c9adf1b
[imp] description with images
eLBati Nov 30, 2012
4498bce
[FIX] The close should be done in the finally: clause of a try: excep…
eLBati Dec 4, 2012
ced1d0c
[FIX] We better have to use the "with" syntax
eLBati Dec 6, 2012
6930c5c
[FIX] update method is accessible from XML/RPC and should return some…
eLBati Dec 6, 2012
b452b33
[FIX] print_direct return value
eLBati Dec 6, 2012
64f8a7f
[fix] get_default return value
eLBati Dec 6, 2012
5db700c
[FIX] context=None
eLBati Dec 6, 2012
576fbe4
[FIX] using logging
eLBati Dec 6, 2012
76f9704
[FIX] isinstance(printer, (str,unicode)):
eLBati Dec 6, 2012
d57fc8f
[FIX] base_report_to_printer description
eLBati Dec 7, 2012
04eb2b7
[FIX] base_report_to_printer - 'authors'
eLBati Jan 15, 2013
08db5a9
[MIGR] Set the 'installable' flags to False on addons. They should be…
guewen Mar 14, 2013
49d4e2e
base_report_to_printer V7 upgrade
aschrafel Mar 15, 2013
e9e16db
[FIX] base_report_to_printer - load security first
yvaucher Sep 30, 2013
bbe2142
[IMP] base_report_to_printer - retab and clean extra spaces
yvaucher Sep 30, 2013
10b5678
[IMP] base_report_to_printer - remove class calls and use orm.Model a…
yvaucher Sep 30, 2013
c336491
[IMP] base_report_to_printer - clean imports
yvaucher Sep 30, 2013
121865f
[IMP] base_report_to_printer - remove class call
yvaucher Sep 30, 2013
0dc248d
[IMP] base_report_to_printer - simplify calls on class
yvaucher Sep 30, 2013
ab4afa3
[TYPO]
yvaucher Sep 30, 2013
7d39b4d
[IMP] base_report_to_printer - replace lpr by use of pycups
yvaucher Sep 30, 2013
c7f1e0b
[IMP] base_report_to_printer - add report_id on print_direct
yvaucher Oct 1, 2013
60d01e0
[IMP] base_report_to_printer - use an action id in an action method i…
yvaucher Oct 1, 2013
ec028b3
[FIX] base_report_to_printer - using system_name of printer instead o…
yvaucher Oct 1, 2013
3878a86
[IMP] base_report_to_printer - remove uselsee context set
yvaucher Oct 1, 2013
63874cb
[IMP] base_report_to_printer - return browse record instead of string…
yvaucher Oct 1, 2013
42efe15
[IMP] base_report_to_printer - retab xml files
yvaucher Oct 1, 2013
083bc82
[IMP] base_report_to_printer - show field name in report and user views
yvaucher Oct 1, 2013
6af98d2
[IMP] base_report_to_printer - remove deprecated view type
yvaucher Oct 1, 2013
d1f3bd5
[FIX] base_report_to_printer - missing class call
yvaucher Oct 1, 2013
b00c963
[TYPO]
yvaucher Oct 1, 2013
a11af72
[IMP] base_report_to_printer - pass report id instead of report key
yvaucher Oct 1, 2013
448ceb3
[FIX] base_report_to_printer - mistake in params of print_direct
yvaucher Oct 1, 2013
78ef3fd
[FIX] base_report_to_printer - restore error message as osv + propaga…
yvaucher Oct 1, 2013
c51ba5d
[IMP] base_report_to_printer - remove osv.except_osv as it breaks the…
yvaucher Oct 2, 2013
2e4ebc8
[IMP] base_report_to_printer - split code in multiple files
yvaucher Oct 2, 2013
f876224
[IMP] add external_dependencies
yvaucher Nov 5, 2013
e080114
[IMP] update po files
yvaucher Nov 5, 2013
5d4581d
[IMP] module desciption and remove AUTHORS.txt file to write contribu…
yvaucher Dec 3, 2013
a69abe5
[IMP] description add comment on update printers wizard
yvaucher Dec 3, 2013
d0eb93e
[IMP] adding some explanation in description
yvaucher Dec 3, 2013
9f2c1df
[FIX] Use explicit kwargs: context=context
jgrandguillaume Dec 20, 2013
3e89077
Launchpad automatic translations update.
Feb 26, 2014
8f5b500
[FIX] user browse was incorrect and never returned records. Fix based…
Apr 16, 2014
7b22611
[FIX] the button 'set default' on printers did not work because the f…
Apr 16, 2014
b085116
[IMP] fix/improve printing preference UI
Apr 17, 2014
489d419
[IMP] Use short notation for browse and use pool[] instead of pool.ge…
Apr 17, 2014
cf0e670
Launchpad automatic translations update.
May 6, 2014
c5b44f3
set installable to false
yvaucher Jul 4, 2014
e49f662
move modules in __unported__ for 8.0
yvaucher Jul 4, 2014
0f7bb5f
Move base_report_to_printer to root from __unported__
guewen Nov 12, 2014
8bfbd12
Set module installable
guewen Nov 12, 2014
3f8838c
Extract description of the module in README.RST
guewen Nov 12, 2014
d02f5e6
base_calendar passed away
guewen Nov 12, 2014
f46ad66
Migrate ir_report.py to new API
guewen Nov 14, 2014
ce0876e
Migrate printing.py to new API
guewen Nov 14, 2014
2005273
Migrate res_users.py to new API
guewen Nov 14, 2014
fe3ab51
Migrate report_xml_action.py to new API
guewen Nov 14, 2014
05982df
Migrate wizard/update_printers.py to new API
guewen Nov 14, 2014
242146b
Better view for wizard
guewen Nov 17, 2014
fbe8630
Recursion when calling a method with old-style api signature from browse
guewen Nov 14, 2014
8a80de3
Remove the Lock because it is useless on multiprocess
guewen Nov 17, 2014
87ae352
browse is called often enough to call the update routine (even too much)
guewen Nov 17, 2014
9c4ea8c
Implements the print on the new 'report' model
guewen Nov 17, 2014
3d89e22
Restore the print capability on deprecated reports
guewen Nov 17, 2014
e15d267
Update copyrights
guewen Nov 17, 2014
aecc0a5
Improve form view, add search view for printers
guewen Nov 17, 2014
975afd7
Update translations, add a string to URI so it is uppercased
guewen Nov 17, 2014
ad5e8b6
missing api decorator
guewen Nov 17, 2014
39bd5e9
We need the report in print_document and print options (needed in
guewen Nov 17, 2014
7ac2564
Move the 'skip_update' right in the browse, it prevents a loop
guewen Nov 17, 2014
ebe52ef
Avoid to hits the database too many times to check if the list of
guewen Nov 17, 2014
9df6070
Refresh the list of printers every 15 seconds instead of 10
guewen Nov 17, 2014
916d974
Extract a method so it will be easier to override in printer_tray
guewen Nov 17, 2014
262a5db
Error on installation of the module
guewen Nov 18, 2014
b015085
Invalidate the cache when the table is created so the table_exists()
guewen Nov 18, 2014
254495f
Use a cron instead of threads to update printers status
guewen Nov 20, 2014
b4e9161
Do not write the printer status if it has not changed
guewen Nov 20, 2014
9dc3dd7
Clean the XML file (remove eval, reindent)
guewen Dec 19, 2014
354bade
Give access to models to all users for reading
guewen Dec 19, 2014
421bcda
[FIX] Bug #19 avoid crash when using 'raw' option
Dec 28, 2014
656939d
[Usability] Auto-add Administrator user to the Print group
Dec 28, 2014
35dff1b
base_report_to_printer: add support for remote CUPS server (not just …
Jan 8, 2015
77d817a
Add CUPS_HOST in more debug logs
Jan 14, 2015
8317010
Do no longer returns a PDF when a report is printed
guewen Jan 21, 2015
fe9c7a5
Raise an error if no printer is configured
guewen Jan 21, 2015
d814ab0
Updated translations
guewen Jan 21, 2015
c27499c
Add a limitation in the readme
guewen Jan 21, 2015
e8058b2
When get_pdf has no printer, just create the pdf file
guewen Jan 26, 2015
0863057
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
2a1e3da
Compatibility fix for report with custom parser
nbessi Jan 30, 2015
5095569
Fix set the skip directive in context
nbessi Jan 30, 2015
e6a8463
The alteration of the context has no effect
guewen Jan 30, 2015
55ed4e3
Past tense is confusing
guewen Jan 30, 2015
e991d88
Vague method name, put the predicate method closer to its caller
guewen Jan 30, 2015
679f21b
dict.copy() is more efficient than calling dict
guewen Jan 30, 2015
67ec48b
Improve bloated condition test
nbessi Feb 6, 2015
3fe4f72
[FIX] base_report_to_printer: make get_pdf callable from 8.0 api
anthony-muschang May 19, 2015
fb0bc40
[FIX] base_report_to_printer: make print_document callable from 8.0 api
anthony-muschang May 21, 2015
3bda066
[FIX] test if the module is installed before monkey patching
vrenaville Jun 15, 2015
bb3e856
[PEP8]
yvaucher Aug 18, 2015
c03f3c0
[UPD] prefix versions with 8.0
sbidoul Oct 9, 2015
1580da4
[MIG] Make modules uninstallable
pedrobaeza Oct 14, 2015
3ae8fb2
pass context to printer to use it for example in print_options()
intero-chz Oct 25, 2015
9b5db10
Add support for multiple copies
alexis-via Nov 2, 2015
70d61f7
Merge branch '8.0' of https://github.com/intero-chz/report-print-send…
yvaucher Nov 24, 2015
2eac4d4
[IMP] Soft fail on missing cups import
Dec 10, 2015
9b3eddd
[MIG] base_report_to_printer: Upgrade to v9
lasley Jul 4, 2016
3dae851
[IMP] base_report_to_printer: Add test coverage
lasley Jul 6, 2016
bd6f63e
[FIX] base_report_to_printer: Minor fixes
lasley Jul 8, 2016
b655dd1
[FIX] base_report_to_printer: Unify logger import
lasley Jul 12, 2016
7281bad
[FIX] base_report_to_printer: Remove execute bit
lasley Jul 13, 2016
d533a2e
[FIX] base_report_to_printer: Switch error type
lasley Jul 13, 2016
18d0b76
Fix placeholder for repo in readme.rst
yvaucher Oct 5, 2016
f30d68a
[MIG] Make modules uninstallable
pedrobaeza Oct 6, 2016
cab8d0c
[MIG] Rename manifest files
pedrobaeza Oct 6, 2016
020d89b
[10.0][MIG] base_report_to_printer (#68)
Apr 5, 2017
382ed61
[10] FIX format parameter (#84)
angelmoya Apr 11, 2017
36476e1
Update README.rst
blutecsolutions May 1, 2017
a38e611
Update README.rst
May 1, 2017
d594b24
[FIX] base_report_to_printer: A button method should be @api.multi
Jun 23, 2017
b5365d1
OCA Transbot updated translations from Transifex
oca-transbot May 1, 2017
a327a8e
[REM] Removed dead code
Jul 11, 2017
d4eb0ae
[FIX] Use an HttpCase test class to avoid locking the registry for HT…
Aug 26, 2017
e10d4cc
[FIX] Minor bugfixes
gdgellatly Aug 9, 2017
49062b5
[MIG] base_report_to_printer: Migrate to v11.0
Oct 3, 2017
9b48d16
[FIX] Review fixes
Oct 4, 2017
ab8a687
[FIX] Forgot fixes
Oct 4, 2017
470c25a
[FIX] Views review fixes
Oct 4, 2017
a12c9ba
module printer_tray
yvaucher Oct 2, 2013
ad80991
yvaucher Oct 24, 2013
8a3026f
use server_error variable to update printer status
yvaucher Oct 24, 2013
eee2b55
translation files
yvaucher Jan 31, 2014
43e7f32
security file ir.model.access.csv
yvaucher Jan 31, 2014
22ef4ec
set installable to false
yvaucher Jul 4, 2014
a0c169d
move modules in __unported__ for 8.0
yvaucher Jul 4, 2014
faba475
Moved printer_tray from __unported__ to root folder
guewen Nov 17, 2014
92d1ab6
Set printer_tray to installable
guewen Nov 17, 2014
9c32e0c
Extract the module's description in a REAME.rst file
guewen Nov 17, 2014
a38e724
base_report_assembler seems not to be a dependency for printer_tray
guewen Nov 17, 2014
a7aa6cb
print_options is now in printing, new api for ir.actions.report.xml
guewen Nov 17, 2014
fc3900b
new api for res.users
guewen Nov 17, 2014
3b51e67
new api for printing.tray
guewen Nov 17, 2014
4a4a015
new api for 'printing.report.xml.action'
guewen Nov 17, 2014
4453dab
Started to migrate printing.printer to the new API
guewen Nov 17, 2014
92d5192
Update the trays from cups, use the new extracted methods in base_rep…
guewen Nov 17, 2014
badb1e5
unused import
guewen Nov 17, 2014
dd58bf3
add trays in printers view
guewen Nov 18, 2014
60a8e38
Add the printer tray choice in the 'My preferences' popup
guewen Nov 18, 2014
e91bbb3
Updated translations
guewen Nov 18, 2014
0ce0909
Wrong column name
guewen Nov 18, 2014
83c4507
Missing import
guewen Nov 18, 2014
7d870c1
Remove the PPD file once read, otherwise they accumulate
guewen Dec 5, 2014
053e8ed
Security file was not loaded
guewen Dec 9, 2014
e13513e
Add the trays in printing.report.xml.action view
guewen Jan 20, 2015
529d3af
Update the description with the OCA template
guewen Jan 20, 2015
a05e7b7
Reset the printer's tray when the printer is changed
guewen Jan 20, 2015
352074f
Add license key in __openerp__.py
yvaucher Feb 6, 2015
092c0fe
Add OCA as author of OCA addons
gurneyalex Mar 2, 2015
c544204
Add bug tracker link on README.rst
yvaucher May 22, 2015
d76ac42
prefix versions with 8.0
sbidoul Oct 9, 2015
9b5f380
Make modules uninstallable
pedrobaeza Oct 14, 2015
9283e42
base_report_to_printer: Upgrade to v9
lasley Jul 4, 2016
2b30bca
Rename manifest files
pedrobaeza Oct 6, 2016
8ca4035
typo, tray_id doesn't exist only printer_tray_id exist on the object
vrenaville Oct 12, 2015
15cac2c
FIX typo in previous merge
yvaucher Nov 24, 2015
77a9e13
FIX: print with copies and installed printer_tray module
msteinfeld-intero Jan 4, 2016
7a349f5
printer_tray: Add unit tests
Nov 8, 2016
9bbe10b
Fixed lint errors
Nov 8, 2016
c59f9d6
Migrate printer_tray to v9.0
Nov 8, 2016
e11cf22
printer_tray: Allow to call print_option with no report
Nov 17, 2016
6f08d95
Migrate printer_tray to v10.0
Nov 16, 2016
d592c4e
printer_tray: Fix mocking in unit tests (#97)
Jul 12, 2017
a251376
Minor bugfixes
gdgellatly Aug 9, 2017
8bfea53
[PORT] Printer Tray to V11
gdgellatly Oct 4, 2017
4dcf262
[IMP] Minor usability fix, order trays alphabetically, name xml groups
gdgellatly Oct 4, 2017
61cf341
[IMP] Allow users to define their default behaviour and printer
Oct 5, 2017
d6500e4
[WIP] Commit before rebase on latest #109 for user and view updates
gdgellatly Oct 5, 2017
f70720a
[PORT] Finalize move of printer_tray to base_report_to_printer,
gdgellatly Oct 5, 2017
4375c7b
[REF] Refactor the way print options are defined and sent.
gdgellatly Oct 8, 2017
142cdfb
[FIX] Update tests to new return signature of behaviour
gdgellatly Oct 8, 2017
57bd6a1
[To FIX] Hackish fix to test, needs to be done properly as behaviour …
gdgellatly Oct 8, 2017
0d0acbc
[FIX] Set back old tray behaviour to take user or report default if t…
gdgellatly Oct 8, 2017
b63eef0
[PORT] Finalize move of printer_tray to base_report_to_printer,
gdgellatly Oct 8, 2017
21371f1
[PORT] Finalize move of printer_tray to base_report_to_printer,
gdgellatly Oct 5, 2017
cc8e61d
Merge branch '11.0-refactor-options' into 11.0-printer-tray
gdgellatly Dec 6, 2017
506debb
[FIX] Runbot error, try new cron code, plus @yajo review cleanup
gdgellatly Dec 6, 2017
9e02139
[FIX] Fix the javascript calls
gdgellatly Dec 14, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
122 changes: 122 additions & 0 deletions base_report_to_printer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3

=================
Report To Printer
=================

This module allows users to send reports to a printer attached to the server.

It adds an optional behaviour on reports to send it directly to a printer.

* `Send to Client` is the default behaviour providing you a downloadable PDF
* `Send to Printer` prints the report on selected printer

It detects trays on printers installation plus permits to select the
paper source on which you want to print directly.

Report behaviour is defined by settings.

You will find this option on default user config, on default report
config and on specific config per user per report.

This allows you to dedicate a specific paper source for example for
preprinted paper such as payment slip.

Settings can be configured:

* globally
* per user
* per report
* per user and report

Installation
============

* Install PyCups - https://pypi.python.org/pypi/pycups

.. code-block:: bash

sudo apt-get install cups
sudo apt-get install libcups2-dev
sudo apt-get install python3-dev
sudo pip install pycups


Configuration
=============

After installing enable the "Printing / Print User" option under access
rights to give users the ability to view the print menu.


Usage
=====

* To update the CUPS printers in *Settings > Printing > Update Printers
from CUPS*
* If you want to print a report on a specific printer or tray, you can change
these in *Settings > Printing > Reports* to define default behaviour.
* If you want to print a report on a specific printer and/or tray for a user, you can
change these in *Settings > Printing > Reports* in
*Specific actions per user*
* Users may also select a default action, printer or tray in their preferences

When no tray is configured for a report and a user, the
default tray setup on the CUPS server is used.

Caveat
------

The notification when a report is sent to a printer will not be
displayed for the deprecated report types (RML, Webkit, ...).

.. image:: https://odoo-community.org/website/image/ir.attachment/5784_f2813bd/datas
:alt: Try me on Runbot
:target: https://runbot.odoo-community.org/runbot/144/11.0


Bug Tracker
===========

Bugs are tracked on `GitHub Issues
<https://github.com/OCA/report-print-send/issues>`_. In case of trouble, please
check there if your issue has already been reported. If you spotted it first,
help us smashing it by providing a detailed and welcomed feedback.

Credits
=======

Images
------

* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_.

Contributors
------------

* Ferran Pegueroles <ferran@pegueroles.com>
* Albert Cervera i Areny <albert@nan-tic.com>
* Davide Corio <davide.corio@agilebg.com>
* Lorenzo Battistini <lorenzo.battistini@agilebg.com>
* Yannick Vaucher <yannick.vaucher@camptocamp.com>
* Lionel Sausin <ls@numerigraphe.com>
* Guewen Baconnier <guewen.baconnier@camptocamp.com>
* Dave Lasley <dave@laslabs.com>
* Sylvain Garancher <sylvain.garancher@syleam.fr>

Maintainer
----------

.. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association
:target: https://odoo-community.org

This module is maintained by the OCA.

OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and
promote its widespread use.

To contribute to this module, please visit https://odoo-community.org.
9 changes: 9 additions & 0 deletions base_report_to_printer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com>
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

from . import models
from . import wizards
34 changes: 34 additions & 0 deletions base_report_to_printer/__manifest__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.com>
# Copyright (C) 2011 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

{
'name': "Report to printer",
'version': '11.0.2.0.0',
'category': 'Generic Modules/Base',
'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
" LasLabs, Camptocamp, Odoo Community Association (OCA)",
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
"depends": ['web', 'base'],
'data': [
'data/printing_data.xml',
'security/security.xml',
'views/assets.xml',
'views/printing_printer.xml',
'views/printing_server.xml',
'views/printing_job.xml',
'views/printing_report.xml',
'views/res_users.xml',
'views/ir_actions_report.xml',
'wizards/printing_printer_update_wizard_view.xml',
],
'installable': True,
'application': True,
'external_dependencies': {
'python': ['cups'],
},
}
37 changes: 37 additions & 0 deletions base_report_to_printer/data/printing_data.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0"?>
<odoo noupdate="1">

<!-- printing.action -->
<record model="printing.action" id="printing_action_1">
<field name="name">Send to Printer</field>
<field name="action_type">server</field>
</record>
<record model="printing.action" id="printing_action_2">
<field name="name">Send to Client</field>
<field name="action_type">client</field>
</record>
<record model="printing.action" id="printing_action_3">
<field name="name">Use User Defaults</field>
<field name="action_type">user_default</field>
</record>
<!-- properties -->
<record forcecreate="True" id="property_printing_action_id" model="ir.property">
<field name="name">property_printing_action_id</field>
<field name="fields_id" search="[('model', '=', 'ir.actions.report'), ('name', '=', 'property_printing_action_id')]"/>
<field name="value" eval="'printing.action,' + str(printing_action_2)"/>
</record>

<record forcecreate="True" id="ir_cron_update_printers" model="ir.cron">
<field name="name">Update Printers Jobs</field>
<field eval="True" name="active"/>
<field name="user_id" ref="base.user_root"/>
<field name="interval_number">1</field>
<field name="interval_type">minutes</field>
<field name="numbercall">-1</field>
<field eval="False" name="doall"/>
<field name="model_id" ref="base_report_to_printer.model_printing_server"/>
<field name="state">code</field>
<field name="code">model.action_update_jobs()</field>
</record>

</odoo>
Loading