Skip to content

Commit

Permalink
base_calendar passed away
Browse files Browse the repository at this point in the history
Migrate ir_report.py to new API

Migrate printing.py to new API

Migrate res_users.py to new API

Migrate report_xml_action.py to new API

Migrate wizard/update_printers.py to new API

Better view for wizard

Recursion when calling a method with old-style api signature from browse

Remove the Lock because it is useless on multiprocess

Replace it by a database lock so the different processes are
all aware of the lock and the last update timestamp.

browse is called often enough to call the update routine (even too much)

Implements the print on the new 'report' model

Restore the print capability on deprecated reports

Update copyrights

Improve form view, add search view for printers

Update translations, add a string to URI so it is uppercased

missing api decorator

We need the report in print_document and print options (needed in
printer_tray)

Move the 'skip_update' right in the browse, it prevents a loop

See odoo/odoo#3644

Also, it helps to have the value set/read in context close to each
other.

Avoid to hits the database too many times to check if the list of
printers needs to be refreshed.

Keep the last update datetime in cache and invalidate this datetime if is
is older than POLL_INTERVAL.  Thus, one process won't hit the DB more
than 1 time every POLL_INTERVAL (10 seconds currently) to check if it
needs to update the list.

Refresh the list of printers every 15 seconds instead of 10

Extract a method so it will be easier to override in printer_tray

Error on installation of the module

Invalidate the cache when the table is created so the table_exists()
method returns a fresh value after creation of the table

Use a cron instead of threads to update printers status

The implementation with threads was blocking the loading of the
server in multiprocess.  Using a cron will lower the frequency of
the updates but at least it is simple and reliable.

Fixes OCA#14

Do not write the printer status if it has not changed

Avoid unnecessary UPDATE every minute

Clean the XML file (remove eval, reindent)

Give access to models to all users for reading

So they are able to print
  • Loading branch information
guewen authored and AaronHForgeFlow committed Apr 15, 2020
1 parent 3fa93a9 commit 5b6e864
Show file tree
Hide file tree
Showing 18 changed files with 1,764 additions and 0 deletions.
50 changes: 50 additions & 0 deletions base_report_to_printer/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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 behavious providing you a downloadable PDF
* `Send to Printer` prints the report on selected printer

Report behaviour is defined by settings.


Settings can be configured:

* globaly
* per user
* per report
* per user and report


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


To show all available printers for your server, uses
`Settings/Configuration/Printing/Update Printers from CUPS` wizard.


Then goto the user profile and set the users printing action and default
printer.


Dependencies
------------

This module requires pycups
https://pypi.python.org/pypi/pycups


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>
30 changes: 30 additions & 0 deletions base_report_to_printer/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
from . import printing
from . import report
from . import report_xml_action
from . import report_service
from . import users
from . import ir_report
from . import wizard
46 changes: 46 additions & 0 deletions base_report_to_printer/__openerp__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# -*- coding: utf-8 -*-
##############################################################################
#
# 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>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
##############################################################################
{
'name': "Report to printer",
'version': '0.1.1',
'category': 'Generic Modules/Base',
'author': 'Agile Business Group & Domsense, Pegueroles SCP, NaN',
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
"depends": ['base',
'report',
],
'data': [
'security/security.xml',
'printing_data.xml',
'printing_view.xml',
'wizard/update_printers.xml',
],
'installable': True,
'auto_install': False,
'application': True,
'external_dependencies': {
'python': ['cups']
}
}
Loading

0 comments on commit 5b6e864

Please sign in to comment.