Skip to content

Commit

Permalink
Merge c407602 into d1ac5f0
Browse files Browse the repository at this point in the history
  • Loading branch information
gdgellatly committed Mar 21, 2019
2 parents d1ac5f0 + c407602 commit 600ae1c
Show file tree
Hide file tree
Showing 65 changed files with 21,470 additions and 0 deletions.
158 changes: 158 additions & 0 deletions base_report_to_printer/README.rst
@@ -0,0 +1,158 @@
=================
Report to printer
=================

.. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
.. |badge1| image:: https://img.shields.io/badge/maturity-Beta-yellow.png
:target: https://odoo-community.org/page/development-status
:alt: Beta
.. |badge2| image:: https://img.shields.io/badge/licence-AGPL--3-blue.png
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html
:alt: License: AGPL-3
.. |badge3| image:: https://img.shields.io/badge/github-OCA%2Freport--print--send-lightgray.png?logo=github
:target: https://github.com/OCA/report-print-send/tree/12.0/base_report_to_printer
:alt: OCA/report-print-send
.. |badge4| image:: https://img.shields.io/badge/weblate-Translate%20me-F47D42.png
:target: https://translation.odoo-community.org/projects/report-print-send-12-0/report-print-send-12-0-base_report_to_printer
:alt: Translate me on Weblate
.. |badge5| image:: https://img.shields.io/badge/runbot-Try%20me-875A7B.png
:target: https://runbot.odoo-community.org/runbot/144/12.0
:alt: Try me on Runbot

|badge1| |badge2| |badge3| |badge4| |badge5|

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

**Table of contents**

.. contents::
:local:

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

To install this module, you need to:

#. 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
=============

To configure this module, you need to:

#. Enable the "Printing / Print User" option under access
rights to give users the ability to view the print menu.

Usage
=====

Guidelines for use:

* To update the CUPS printers in *Settings > Printing > Update Printers
from CUPS*
* To print a report on a specific printer or tray, you can change
these in *Settings > Printing > Reports* to define default behaviour.
* 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.

Changelog
=========

12.0.1.0.0 (2018-02-04)
~~~~~~~~~~~~~~~~~~~~~~~

* [RELEASE] Port from V11.

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 <https://github.com/OCA/report-print-send/issues/new?body=module:%20base_report_to_printer%0Aversion:%2012.0%0A%0A**Steps%20to%20reproduce**%0A-%20...%0A%0A**Current%20behavior**%0A%0A**Expected%20behavior**>`_.

Do not contact contributors directly about support or help with technical issues.

Credits
=======

Authors
~~~~~~~

* Agile Business Group & Domsense
* Pegueroles SCP
* NaN
* LasLabs
* Camptocamp
* Open for Small Business Ltd

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>
* Jairo Llopis <jairo.llopis@tecnativa.com>
* Graeme Gellatly <graeme@o4sb.com>

Maintainers
~~~~~~~~~~~

This module is maintained by the OCA.

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

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.

This module is part of the `OCA/report-print-send <https://github.com/OCA/report-print-send/tree/12.0/base_report_to_printer>`_ project on GitHub.

You are welcome to contribute. To learn how please visit https://odoo-community.org/page/Contribute.
9 changes: 9 additions & 0 deletions base_report_to_printer/__init__.py
@@ -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
35 changes: 35 additions & 0 deletions base_report_to_printer/__manifest__.py
@@ -0,0 +1,35 @@
# 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': '12.0.1.0.0',
'category': 'Generic Modules/Base',
'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
" LasLabs, Camptocamp, Odoo Community Association (OCA),"
" Open for Small Business Ltd",
'website': 'http://www.agilebg.com',
'license': 'AGPL-3',
"depends": ['web'],
'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': False,
'external_dependencies': {
'python': ['cups'],
},
}
33 changes: 33 additions & 0 deletions base_report_to_printer/data/printing_data.xml
@@ -0,0 +1,33 @@
<?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>
<!-- 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>

0 comments on commit 600ae1c

Please sign in to comment.