[WIP] Migrate base_report_to_printer to V12

This commit is contained in:
Graeme Gellatly
2019-01-31 12:40:08 +13:00
parent 725a0c18d3
commit 133a1e1bd3
40 changed files with 768 additions and 168 deletions

View File

@@ -1,10 +1,29 @@
.. image:: https://img.shields.io/badge/licence-AGPL--3-blue.svg =================
:target: http://www.gnu.org/licenses/agpl-3.0-standalone.html Report to printer
:alt: License: AGPL-3 =================
================= .. !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
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. This module allows users to send reports to a printer attached to the server.
@@ -31,10 +50,17 @@ Settings can be configured:
* per report * per report
* per user and report * per user and report
**Table of contents**
.. contents::
:local:
Installation Installation
============ ============
* Install PyCups - https://pypi.python.org/pypi/pycups To install this module, you need to:
#. Install PyCups - https://pypi.python.org/pypi/pycups
.. code-block:: bash .. code-block:: bash
@@ -43,58 +69,64 @@ Installation
sudo apt-get install python3-dev sudo apt-get install python3-dev
sudo pip install pycups sudo pip install pycups
Configuration Configuration
============= =============
After installing enable the "Printing / Print User" option under access To configure this module, you need to:
rights to give users the ability to view the print menu.
#. Enable the "Printing / Print User" option under access
rights to give users the ability to view the print menu.
Usage Usage
===== =====
Guidelines for use:
* To update the CUPS printers in *Settings > Printing > Update Printers * To update the CUPS printers in *Settings > Printing > Update Printers
from CUPS* from CUPS*
* If you want to print a report on a specific printer or tray, you can change * To print a report on a specific printer or tray, you can change
these in *Settings > Printing > Reports* to define default behaviour. 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 * To print a report on a specific printer and/or tray for a user, you can
change these in *Settings > Printing > Reports* in change these in *Settings > Printing > Reports* in
*Specific actions per user* *Specific actions per user*
* Users may also select a default action, printer or tray in their preferences * 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 When no tray is configured for a report and a user, the
default tray setup on the CUPS server is used. default tray setup on the CUPS server is used.
Caveat Changelog
------ =========
The notification when a report is sent to a printer will not be 12.0.1.0.0 (2018-02-04)
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
* [RELEASE] Port from V11.
Bug Tracker Bug Tracker
=========== ===========
Bugs are tracked on `GitHub Issues Bugs are tracked on `GitHub Issues <https://github.com/OCA/report-print-send/issues>`_.
<https://github.com/OCA/report-print-send/issues>`_. In case of trouble, please In case of trouble, please check there if your issue has already been reported.
check there if your issue has already been reported. If you spotted it first, If you spotted it first, help us smashing it by providing a detailed and welcomed
help us smashing it by providing a detailed and welcomed feedback. `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 Credits
======= =======
Images Authors
------ ~~~~~~~
* Odoo Community Association: `Icon <https://github.com/OCA/maintainer-tools/blob/master/template/module/static/description/icon.svg>`_. * Agile Business Group & Domsense
* Pegueroles SCP
* NaN
* LasLabs
* Camptocamp
* Open for Small Business Ltd
Contributors Contributors
------------ ~~~~~~~~~~~~
* Ferran Pegueroles <ferran@pegueroles.com> * Ferran Pegueroles <ferran@pegueroles.com>
* Albert Cervera i Areny <albert@nan-tic.com> * Albert Cervera i Areny <albert@nan-tic.com>
@@ -106,18 +138,21 @@ Contributors
* Dave Lasley <dave@laslabs.com> * Dave Lasley <dave@laslabs.com>
* Sylvain Garancher <sylvain.garancher@syleam.fr> * Sylvain Garancher <sylvain.garancher@syleam.fr>
* Jairo Llopis <jairo.llopis@tecnativa.com> * Jairo Llopis <jairo.llopis@tecnativa.com>
* Graeme Gellatly <graeme@o4sb.com>
Maintainer Maintainers
---------- ~~~~~~~~~~~
This module is maintained by the OCA.
.. image:: https://odoo-community.org/logo.png .. image:: https://odoo-community.org/logo.png
:alt: Odoo Community Association :alt: Odoo Community Association
:target: https://odoo-community.org :target: https://odoo-community.org
This module is maintained by the OCA.
OCA, or the Odoo Community Association, is a nonprofit organization whose OCA, or the Odoo Community Association, is a nonprofit organization whose
mission is to support the collaborative development of Odoo features and mission is to support the collaborative development of Odoo features and
promote its widespread use. promote its widespread use.
To contribute to this module, please visit https://odoo-community.org. 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.

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)
@@ -8,10 +7,11 @@
{ {
'name': "Report to printer", 'name': "Report to printer",
'version': '11.0.2.3.0', 'version': '12.0.1.0.0',
'category': 'Generic Modules/Base', 'category': 'Generic Modules/Base',
'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN," 'author': "Agile Business Group & Domsense, Pegueroles SCP, NaN,"
" LasLabs, Camptocamp, Odoo Community Association (OCA)", " LasLabs, Camptocamp, Odoo Community Association (OCA),"
" Open for Small Business Ltd",
'website': 'http://www.agilebg.com', 'website': 'http://www.agilebg.com',
'license': 'AGPL-3', 'license': 'AGPL-3',
"depends": ['web'], "depends": ['web'],
@@ -28,7 +28,7 @@
'wizards/printing_printer_update_wizard_view.xml', 'wizards/printing_printer_update_wizard_view.xml',
], ],
'installable': True, 'installable': True,
'application': True, 'application': False,
'external_dependencies': { 'external_dependencies': {
'python': ['cups'], 'python': ['cups'],
}, },

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
from . import ir_actions_report from . import ir_actions_report
from . import printing_action from . import printing_action

View File

@@ -136,14 +136,14 @@ class IrActionsReport(models.Model):
res['id'] = self.id res['id'] = self.id
return res return res
def render_qweb_pdf(self, docids, data=None): def render_qweb_pdf(self, res_ids=None, data=None):
""" Generate a PDF and returns it. """ Generate a PDF and returns it.
If the action configured on the report is server, it prints the If the action configured on the report is server, it prints the
generated document as well. generated document as well.
""" """
document, doc_format = super(IrActionsReport, self).render_qweb_pdf( document, doc_format = super(IrActionsReport, self).render_qweb_pdf(
docids, data=data) res_ids=res_ids, data=data)
behaviour = self.behaviour() behaviour = self.behaviour()
printer = behaviour.pop('printer', None) printer = behaviour.pop('printer', None)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016 SYLEAM (<http://www.syleam.fr>) # Copyright (C) 2016 SYLEAM (<http://www.syleam.fr>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -62,9 +62,20 @@ class PrintingPrinter(models.Model):
@api.multi @api.multi
def _prepare_update_from_cups(self, cups_connection, cups_printer): def _prepare_update_from_cups(self, cups_connection, cups_printer):
vals = super(PrintingPrinter, self)._prepare_update_from_cups( mapping = {
cups_connection, cups_printer) 3: 'available',
4: 'printing',
5: 'error'
}
vals = {
'name': cups_printer['printer-info'],
'model': cups_printer.get('printer-make-and-model', False),
'location': cups_printer.get('printer-location', False),
'uri': cups_printer.get('device-uri', False),
'status': mapping.get(cups_printer.get(
'printer-state'), 'unknown'),
'status_message': cups_printer.get('printer-state-message', ''),
}
printer_uri = cups_printer['printer-uri-supported'] printer_uri = cups_printer['printer-uri-supported']
printer_system_name = printer_uri[printer_uri.rfind('/') + 1:] printer_system_name = printer_uri[printer_uri.rfind('/') + 1:]
ppd_info = cups_connection.getPPD3(printer_system_name) ppd_info = cups_connection.getPPD3(printer_system_name)
@@ -103,33 +114,12 @@ class PrintingPrinter(models.Model):
for tray in self.tray_ids.filtered( for tray in self.tray_ids.filtered(
lambda record: record.system_name not in cups_trays.keys()) lambda record: record.system_name not in cups_trays.keys())
]) ])
return vals
@api.multi
def _prepare_update_from_cups(self, cups_connection, cups_printer):
mapping = {
3: 'available',
4: 'printing',
5: 'error'
}
vals = {
'name': cups_printer['printer-info'],
'model': cups_printer.get('printer-make-and-model', False),
'location': cups_printer.get('printer-location', False),
'uri': cups_printer.get('device-uri', False),
'status': mapping.get(cups_printer.get(
'printer-state'), 'unknown'),
'status_message': cups_printer.get('printer-state-message', ''),
}
return vals return vals
@api.multi @api.multi
def print_document(self, report, content, **print_opts): def print_document(self, report, content, **print_opts):
""" Print a file """ Print a file
Format could be pdf, qweb-pdf, raw, ... Format could be pdf, qweb-pdf, raw, ...
""" """
self.ensure_one() self.ensure_one()
fd, file_name = mkstemp() fd, file_name = mkstemp()

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2016 SYLEAM (<http://www.syleam.fr>) # Copyright (C) 2016 SYLEAM (<http://www.syleam.fr>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).
@@ -206,6 +205,11 @@ class PrintingServer(models.Model):
('server_id', '=', server.id), ('server_id', '=', server.id),
('system_name', '=', printer_system_name), ('system_name', '=', printer_system_name),
], limit=1) ], limit=1)
# CUPS retains jobs for disconnected printers and also may
# leak jobs data for unshared printers, therefore we just
# discard here if not printer found
if not printer:
continue
job_values['printer_id'] = printer.id job_values['printer_id'] = printer.id
if jobs: if jobs:

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>) # Copyright (C) 2013-2014 Camptocamp (<http://www.camptocamp.com>)
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com> # Copyright (c) 2007 Ferran Pegueroles <ferran@pegueroles.com>
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)
@@ -38,7 +37,7 @@ class ResUsers(models.Model):
'printing_action', 'printing_action',
'printing_printer_id', 'printing_printer_id',
]) ])
printer_tray_id = fields.Many2one( printer_tray_id = fields.Many2one(
comodel_name='printing.tray', comodel_name='printing.tray',
string='Default Printer Paper Source', string='Default Printer Paper Source',
@@ -49,4 +48,3 @@ class ResUsers(models.Model):
def onchange_printing_printer_id(self): def onchange_printing_printer_id(self):
""" Reset the tray when the printer is changed """ """ Reset the tray when the printer is changed """
self.printer_tray_id = False self.printer_tray_id = False

View File

@@ -0,0 +1,4 @@
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.

View File

@@ -0,0 +1,11 @@
* 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>

View File

@@ -0,0 +1,24 @@
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

View File

@@ -0,0 +1,4 @@
12.0.1.0.0 (2018-02-04)
~~~~~~~~~~~~~~~~~~~~~~~
* [RELEASE] Port from V11.

View File

@@ -0,0 +1,10 @@
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

View File

@@ -0,0 +1,13 @@
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.

View File

@@ -85,6 +85,15 @@
<field eval="0" name="perm_write"/> <field eval="0" name="perm_write"/>
<field eval="0" name="perm_create"/> <field eval="0" name="perm_create"/>
</record> </record>
<record id="printing_job_group_manager" model="ir.model.access">
<field name="name">Printing Job User</field>
<field name="model_id" ref="model_printing_job"/>
<field name="group_id" ref="printing_group_manager"/>
<field eval="1" name="perm_read"/>
<field eval="1" name="perm_unlink"/>
<field eval="1" name="perm_write"/>
<field eval="1" name="perm_create"/>
</record>
<record id="printing_action_group_user" model="ir.model.access"> <record id="printing_action_group_user" model="ir.model.access">
<field name="name">Printing Action User</field> <field name="name">Printing Action User</field>
<field name="model_id" ref="model_printing_action"/> <field name="model_id" ref="model_printing_action"/>

View File

@@ -0,0 +1,508 @@
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="generator" content="Docutils 0.14: http://docutils.sourceforge.net/" />
<title>Report to printer</title>
<style type="text/css">
/*
:Author: David Goodger (goodger@python.org)
:Id: $Id: html4css1.css 7952 2016-07-26 18:15:59Z milde $
:Copyright: This stylesheet has been placed in the public domain.
Default cascading style sheet for the HTML output of Docutils.
See http://docutils.sf.net/docs/howto/html-stylesheets.html for how to
customize this style sheet.
*/
/* used to remove borders from tables and images */
.borderless, table.borderless td, table.borderless th {
border: 0 }
table.borderless td, table.borderless th {
/* Override padding for "table.docutils td" with "! important".
The right padding separates the table cells. */
padding: 0 0.5em 0 0 ! important }
.first {
/* Override more specific margin styles with "! important". */
margin-top: 0 ! important }
.last, .with-subtitle {
margin-bottom: 0 ! important }
.hidden {
display: none }
.subscript {
vertical-align: sub;
font-size: smaller }
.superscript {
vertical-align: super;
font-size: smaller }
a.toc-backref {
text-decoration: none ;
color: black }
blockquote.epigraph {
margin: 2em 5em ; }
dl.docutils dd {
margin-bottom: 0.5em }
object[type="image/svg+xml"], object[type="application/x-shockwave-flash"] {
overflow: hidden;
}
/* Uncomment (and remove this text!) to get bold-faced definition list terms
dl.docutils dt {
font-weight: bold }
*/
div.abstract {
margin: 2em 5em }
div.abstract p.topic-title {
font-weight: bold ;
text-align: center }
div.admonition, div.attention, div.caution, div.danger, div.error,
div.hint, div.important, div.note, div.tip, div.warning {
margin: 2em ;
border: medium outset ;
padding: 1em }
div.admonition p.admonition-title, div.hint p.admonition-title,
div.important p.admonition-title, div.note p.admonition-title,
div.tip p.admonition-title {
font-weight: bold ;
font-family: sans-serif }
div.attention p.admonition-title, div.caution p.admonition-title,
div.danger p.admonition-title, div.error p.admonition-title,
div.warning p.admonition-title, .code .error {
color: red ;
font-weight: bold ;
font-family: sans-serif }
/* Uncomment (and remove this text!) to get reduced vertical space in
compound paragraphs.
div.compound .compound-first, div.compound .compound-middle {
margin-bottom: 0.5em }
div.compound .compound-last, div.compound .compound-middle {
margin-top: 0.5em }
*/
div.dedication {
margin: 2em 5em ;
text-align: center ;
font-style: italic }
div.dedication p.topic-title {
font-weight: bold ;
font-style: normal }
div.figure {
margin-left: 2em ;
margin-right: 2em }
div.footer, div.header {
clear: both;
font-size: smaller }
div.line-block {
display: block ;
margin-top: 1em ;
margin-bottom: 1em }
div.line-block div.line-block {
margin-top: 0 ;
margin-bottom: 0 ;
margin-left: 1.5em }
div.sidebar {
margin: 0 0 0.5em 1em ;
border: medium outset ;
padding: 1em ;
background-color: #ffffee ;
width: 40% ;
float: right ;
clear: right }
div.sidebar p.rubric {
font-family: sans-serif ;
font-size: medium }
div.system-messages {
margin: 5em }
div.system-messages h1 {
color: red }
div.system-message {
border: medium outset ;
padding: 1em }
div.system-message p.system-message-title {
color: red ;
font-weight: bold }
div.topic {
margin: 2em }
h1.section-subtitle, h2.section-subtitle, h3.section-subtitle,
h4.section-subtitle, h5.section-subtitle, h6.section-subtitle {
margin-top: 0.4em }
h1.title {
text-align: center }
h2.subtitle {
text-align: center }
hr.docutils {
width: 75% }
img.align-left, .figure.align-left, object.align-left, table.align-left {
clear: left ;
float: left ;
margin-right: 1em }
img.align-right, .figure.align-right, object.align-right, table.align-right {
clear: right ;
float: right ;
margin-left: 1em }
img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
table.align-center {
margin-left: auto;
margin-right: auto;
}
.align-left {
text-align: left }
.align-center {
clear: both ;
text-align: center }
.align-right {
text-align: right }
/* reset inner alignment in figures */
div.align-right {
text-align: inherit }
/* div.align-center * { */
/* text-align: left } */
.align-top {
vertical-align: top }
.align-middle {
vertical-align: middle }
.align-bottom {
vertical-align: bottom }
ol.simple, ul.simple {
margin-bottom: 1em }
ol.arabic {
list-style: decimal }
ol.loweralpha {
list-style: lower-alpha }
ol.upperalpha {
list-style: upper-alpha }
ol.lowerroman {
list-style: lower-roman }
ol.upperroman {
list-style: upper-roman }
p.attribution {
text-align: right ;
margin-left: 50% }
p.caption {
font-style: italic }
p.credits {
font-style: italic ;
font-size: smaller }
p.label {
white-space: nowrap }
p.rubric {
font-weight: bold ;
font-size: larger ;
color: maroon ;
text-align: center }
p.sidebar-title {
font-family: sans-serif ;
font-weight: bold ;
font-size: larger }
p.sidebar-subtitle {
font-family: sans-serif ;
font-weight: bold }
p.topic-title {
font-weight: bold }
pre.address {
margin-bottom: 0 ;
margin-top: 0 ;
font: inherit }
pre.literal-block, pre.doctest-block, pre.math, pre.code {
margin-left: 2em ;
margin-right: 2em }
pre.code .ln { color: grey; } /* line numbers */
pre.code, code { background-color: #eeeeee }
pre.code .comment, code .comment { color: #5C6576 }
pre.code .keyword, code .keyword { color: #3B0D06; font-weight: bold }
pre.code .literal.string, code .literal.string { color: #0C5404 }
pre.code .name.builtin, code .name.builtin { color: #352B84 }
pre.code .deleted, code .deleted { background-color: #DEB0A1}
pre.code .inserted, code .inserted { background-color: #A3D289}
span.classifier {
font-family: sans-serif ;
font-style: oblique }
span.classifier-delimiter {
font-family: sans-serif ;
font-weight: bold }
span.interpreted {
font-family: sans-serif }
span.option {
white-space: nowrap }
span.pre {
white-space: pre }
span.problematic {
color: red }
span.section-subtitle {
/* font-size relative to parent (h1..h6 element) */
font-size: 80% }
table.citation {
border-left: solid 1px gray;
margin-left: 1px }
table.docinfo {
margin: 2em 4em }
table.docutils {
margin-top: 0.5em ;
margin-bottom: 0.5em }
table.footnote {
border-left: solid 1px black;
margin-left: 1px }
table.docutils td, table.docutils th,
table.docinfo td, table.docinfo th {
padding-left: 0.5em ;
padding-right: 0.5em ;
vertical-align: top }
table.docutils th.field-name, table.docinfo th.docinfo-name {
font-weight: bold ;
text-align: left ;
white-space: nowrap ;
padding-left: 0 }
/* "booktabs" style (no vertical lines) */
table.docutils.booktabs {
border: 0px;
border-top: 2px solid;
border-bottom: 2px solid;
border-collapse: collapse;
}
table.docutils.booktabs * {
border: 0px;
}
table.docutils.booktabs th {
border-bottom: thin solid;
text-align: left;
}
h1 tt.docutils, h2 tt.docutils, h3 tt.docutils,
h4 tt.docutils, h5 tt.docutils, h6 tt.docutils {
font-size: 100% }
ul.auto-toc {
list-style-type: none }
</style>
</head>
<body>
<div class="document" id="report-to-printer">
<h1 class="title">Report to printer</h1>
<!-- !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!! This file is generated by oca-gen-addon-readme !!
!! changes will be overwritten. !!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! -->
<p><a class="reference external" 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" href="http://www.gnu.org/licenses/agpl-3.0-standalone.html"><img alt="License: AGPL-3" src="https://img.shields.io/badge/licence-AGPL--3-blue.png" /></a> <a class="reference external" href="https://github.com/OCA/report-print-send/tree/12.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" href="https://translation.odoo-community.org/projects/report-print-send-12-0/report-print-send-12-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" href="https://runbot.odoo-community.org/runbot/144/12.0"><img alt="Try me on Runbot" src="https://img.shields.io/badge/runbot-Try%20me-875A7B.png" /></a></p>
<p>This module allows users to send reports to a printer attached to the server.</p>
<p>It adds an optional behaviour on reports to send it directly to a printer.</p>
<ul class="simple">
<li><cite>Send to Client</cite> is the default behaviour providing you a downloadable PDF</li>
<li><cite>Send to Printer</cite> prints the report on selected printer</li>
</ul>
<p>It detects trays on printers installation plus permits to select the
paper source on which you want to print directly.</p>
<p>Report behaviour is defined by settings.</p>
<p>You will find this option on default user config, on default report
config and on specific config per user per report.</p>
<p>This allows you to dedicate a specific paper source for example for
preprinted paper such as payment slip.</p>
<p>Settings can be configured:</p>
<ul class="simple">
<li>globally</li>
<li>per user</li>
<li>per report</li>
<li>per user and report</li>
</ul>
<p><strong>Table of contents</strong></p>
<div class="contents local topic" id="contents">
<ul class="simple">
<li><a class="reference internal" href="#installation" id="id2">Installation</a></li>
<li><a class="reference internal" href="#configuration" id="id3">Configuration</a></li>
<li><a class="reference internal" href="#usage" id="id4">Usage</a></li>
<li><a class="reference internal" href="#changelog" id="id5">Changelog</a><ul>
<li><a class="reference internal" href="#id1" id="id6">12.0.1.0.0 (2018-02-04)</a></li>
</ul>
</li>
<li><a class="reference internal" href="#bug-tracker" id="id7">Bug Tracker</a></li>
<li><a class="reference internal" href="#credits" id="id8">Credits</a><ul>
<li><a class="reference internal" href="#authors" id="id9">Authors</a></li>
<li><a class="reference internal" href="#contributors" id="id10">Contributors</a></li>
<li><a class="reference internal" href="#maintainers" id="id11">Maintainers</a></li>
</ul>
</li>
</ul>
</div>
<div class="section" id="installation">
<h1><a class="toc-backref" href="#id2">Installation</a></h1>
<p>To install this module, you need to:</p>
<ol class="arabic simple">
<li>Install PyCups - <a class="reference external" href="https://pypi.python.org/pypi/pycups">https://pypi.python.org/pypi/pycups</a></li>
</ol>
<pre class="code bash literal-block">
sudo apt-get install cups
sudo apt-get install libcups2-dev
sudo apt-get install python3-dev
sudo pip install pycups
</pre>
</div>
<div class="section" id="configuration">
<h1><a class="toc-backref" href="#id3">Configuration</a></h1>
<p>To configure this module, you need to:</p>
<ol class="arabic simple">
<li>Enable the “Printing / Print User” option under access
rights to give users the ability to view the print menu.</li>
</ol>
</div>
<div class="section" id="usage">
<h1><a class="toc-backref" href="#id4">Usage</a></h1>
<p>Guidelines for use:</p>
<blockquote>
<ul class="simple">
<li>To update the CUPS printers in <em>Settings &gt; Printing &gt; Update Printers
from CUPS</em></li>
<li>To print a report on a specific printer or tray, you can change
these in <em>Settings &gt; Printing &gt; Reports</em> to define default behaviour.</li>
<li>To print a report on a specific printer and/or tray for a user, you can
change these in <em>Settings &gt; Printing &gt; Reports</em> in
<em>Specific actions per user</em></li>
<li>Users may also select a default action, printer or tray in their preferences.</li>
</ul>
</blockquote>
<p>When no tray is configured for a report and a user, the
default tray setup on the CUPS server is used.</p>
</div>
<div class="section" id="changelog">
<h1><a class="toc-backref" href="#id5">Changelog</a></h1>
<div class="section" id="id1">
<h2><a class="toc-backref" href="#id6">12.0.1.0.0 (2018-02-04)</a></h2>
<ul class="simple">
<li>[RELEASE] Port from V11.</li>
</ul>
</div>
</div>
<div class="section" id="bug-tracker">
<h1><a class="toc-backref" href="#id7">Bug Tracker</a></h1>
<p>Bugs are tracked on <a class="reference external" href="https://github.com/OCA/report-print-send/issues">GitHub Issues</a>.
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
<a class="reference external" href="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**">feedback</a>.</p>
<p>Do not contact contributors directly about support or help with technical issues.</p>
</div>
<div class="section" id="credits">
<h1><a class="toc-backref" href="#id8">Credits</a></h1>
<div class="section" id="authors">
<h2><a class="toc-backref" href="#id9">Authors</a></h2>
<ul class="simple">
<li>Agile Business Group &amp; Domsense</li>
<li>Pegueroles SCP</li>
<li>NaN</li>
<li>LasLabs</li>
<li>Camptocamp</li>
<li>Open for Small Business Ltd</li>
</ul>
</div>
<div class="section" id="contributors">
<h2><a class="toc-backref" href="#id10">Contributors</a></h2>
<ul class="simple">
<li>Ferran Pegueroles &lt;<a class="reference external" href="mailto:ferran&#64;pegueroles.com">ferran&#64;pegueroles.com</a>&gt;</li>
<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>
<li>Davide Corio &lt;<a class="reference external" href="mailto:davide.corio&#64;agilebg.com">davide.corio&#64;agilebg.com</a>&gt;</li>
<li>Lorenzo Battistini &lt;<a class="reference external" href="mailto:lorenzo.battistini&#64;agilebg.com">lorenzo.battistini&#64;agilebg.com</a>&gt;</li>
<li>Yannick Vaucher &lt;<a class="reference external" href="mailto:yannick.vaucher&#64;camptocamp.com">yannick.vaucher&#64;camptocamp.com</a>&gt;</li>
<li>Lionel Sausin &lt;<a class="reference external" href="mailto:ls&#64;numerigraphe.com">ls&#64;numerigraphe.com</a>&gt;</li>
<li>Guewen Baconnier &lt;<a class="reference external" href="mailto:guewen.baconnier&#64;camptocamp.com">guewen.baconnier&#64;camptocamp.com</a>&gt;</li>
<li>Dave Lasley &lt;<a class="reference external" href="mailto:dave&#64;laslabs.com">dave&#64;laslabs.com</a>&gt;</li>
<li>Sylvain Garancher &lt;<a class="reference external" href="mailto:sylvain.garancher&#64;syleam.fr">sylvain.garancher&#64;syleam.fr</a>&gt;</li>
<li>Jairo Llopis &lt;<a class="reference external" href="mailto:jairo.llopis&#64;tecnativa.com">jairo.llopis&#64;tecnativa.com</a>&gt;</li>
<li>Graeme Gellatly &lt;<a class="reference external" href="mailto:graeme&#64;o4sb.com">graeme&#64;o4sb.com</a>&gt;</li>
</ul>
</div>
<div class="section" id="maintainers">
<h2><a class="toc-backref" href="#id11">Maintainers</a></h2>
<p>This module is maintained by the OCA.</p>
<a class="reference external image-reference" href="https://odoo-community.org"><img alt="Odoo Community Association" src="https://odoo-community.org/logo.png" /></a>
<p>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.</p>
<p>This module is part of the <a class="reference external" href="https://github.com/OCA/report-print-send/tree/12.0/base_report_to_printer">OCA/report-print-send</a> project on GitHub.</p>
<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>
</div>
</div>
</div>
</body>
</html>

View File

@@ -1,48 +1,50 @@
odoo.define('base_report_to_printer.print', function(require) { odoo.define('base_report_to_printer.print', function (require) {
'use strict'; 'use strict';
var ActionManager = require('web.ActionManager'); var ActionManager = require('web.ActionManager');
var core = require('web.core'); var core = require('web.core');
var framework = require('web.framework'); var _t = core._t;
var rpc = require('web.rpc');
ActionManager.include({ ActionManager.include({
ir_actions_report: function(action, options) { _triggerDownload: function (action, options, type) {
action_val = _.clone(action);
var _t = core._t;
var self = this; var self = this;
var _super = this._super; var _super = this._super;
if (type === 'pdf') {
if (action_val.report_type === 'qweb-pdf') { this._rpc({
framework.blockUI();
rpc.query({
model: 'ir.actions.report', model: 'ir.actions.report',
method: 'print_action_for_report_name', method: 'print_action_for_report_name',
args: [action_val.report_name] args: [action.report_name],
}).then(function (print_action) { }).then(function (print_action) {
if (print_action && print_action.action === 'server') { if (print_action && print_action.action === 'server') {
framework.unblockUI(); self._rpc({
rpc.query({
model: 'ir.actions.report', model: 'ir.actions.report',
method: 'print_document', method: 'print_document',
args: [action_val.id, action_val.context.active_ids], args: [action.id, action.context.active_ids],
kwargs: {data: action_val.data || {}}, kwargs: {data: action.data || {}},
context: action_val.context || {} context: action.context || {},
}).then(function () { }).then(function () {
self.do_notify(_t('Report'), self.do_notify(_t('Report'),
_.str.sprintf(_t('Document sent to the printer %s'), print_action.printer_name)); _.str.sprintf(
_t('Document sent to the printer %s'),
print_action.printer_name
)
);
}).fail(function () { }).fail(function () {
self.do_notify(_t('Report'), self.do_notify(_t('Report'),
_.str.sprintf(_t('Error when sending the document to the printer '), print_action.printer_name)); _.str.sprintf(
_t('Error when sending the document to the printer '),
}); print_action.printer_name
} else { )
return _super.apply(self, [action_val, options]); );
} });
}); } else {
return _super.apply(self, [action, options, type]);
}
});
} else { } else {
return _super.apply(self, [action_val, options]); return _super.apply(self, [action, options, type]);
} }
} },
}); });
}); });

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -30,6 +30,7 @@ class TestPrintingPrinter(TransactionCase):
'location': 'Location', 'location': 'Location',
'uri': 'URI', 'uri': 'URI',
} }
self.report = self.env['ir.actions.report'].search([], limit=1)
def new_record(self): def new_record(self):
return self.Model.create(self.printer_vals) return self.Model.create(self.printer_vals)
@@ -66,7 +67,6 @@ class TestPrintingPrinter(TransactionCase):
def test_print_options(self): def test_print_options(self):
""" It should generate the right options dictionnary """ """ It should generate the right options dictionnary """
'copies': '2',
# TODO: None here used as report - tests here should be merged # TODO: None here used as report - tests here should be merged
# with tests in test_printing_printer_tray from when modules merged # with tests in test_printing_printer_tray from when modules merged
report = self.env['ir.actions.report'].search([], limit=1) report = self.env['ir.actions.report'].search([], limit=1)

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -165,7 +164,6 @@ class TestPrintingPrinter(TransactionCase):
self, os_unlink, cups): self, os_unlink, cups):
""" """
When a ENOENT error is encountered, the file has already been unlinked When a ENOENT error is encountered, the file has already been unlinked
This is not an issue, as we were trying to delete the file. This is not an issue, as we were trying to delete the file.
The update can continue. The update can continue.
""" """

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -26,6 +25,7 @@ class TestPrintingPrinterWizard(TransactionCase):
'printer-make-and-model': 'Make and Model', 'printer-make-and-model': 'Make and Model',
'printer-location': "location", 'printer-location': "location",
'device-uri': 'URI', 'device-uri': 'URI',
'printer-uri-supported': 'uri'
} }
def _record_vals(self, sys_name='sys_name'): def _record_vals(self, sys_name='sys_name'):
@@ -52,6 +52,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = { cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals, 'sys_name': self.printer_vals,
} }
cups.Connection().getPPD3.return_value = (200, 0, '')
self.Model.action_ok() self.Model.action_ok()
cups.Connection().getPrinters.assert_called_once_with() cups.Connection().getPrinters.assert_called_once_with()
@@ -68,6 +69,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = { cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals, 'sys_name': self.printer_vals,
} }
cups.Connection().getPPD3.return_value = (200, 0, '')
self.Model.action_ok() self.Model.action_ok()
rec_id = self.env['printing.printer'].search([ rec_id = self.env['printing.printer'].search([
('system_name', '=', 'sys_name') ('system_name', '=', 'sys_name')
@@ -89,6 +91,7 @@ class TestPrintingPrinterWizard(TransactionCase):
cups.Connection().getPrinters.return_value = { cups.Connection().getPrinters.return_value = {
'sys_name': self.printer_vals, 'sys_name': self.printer_vals,
} }
cups.Connection().getPPD3.return_value = (200, 0, '')
self.env['printing.printer'].create( self.env['printing.printer'].create(
self._record_vals() self._record_vals()
) )

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 SYLEAM # Copyright 2016 SYLEAM
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
@@ -47,12 +46,14 @@ class TestPrintingReportXmlAction(TransactionCase):
self.assertEqual(xml_action.behaviour(), { self.assertEqual(xml_action.behaviour(), {
'action': xml_action.action, 'action': xml_action.action,
'printer': xml_action.printer_id, 'printer': xml_action.printer_id,
'tray': False,
}) })
xml_action = self.new_record({'printer_id': self.new_printer().id}) xml_action = self.new_record({'printer_id': self.new_printer().id})
self.assertEqual(xml_action.behaviour(), { self.assertEqual(xml_action.behaviour(), {
'action': xml_action.action, 'action': xml_action.action,
'printer': xml_action.printer_id, 'printer': xml_action.printer_id,
'tray': False,
}) })
self.assertEqual(self.Model.behaviour(), {}) self.assertEqual(self.Model.behaviour(), {})

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# Copyright 2017 Tecnativa - Jairo Llopis # Copyright 2017 Tecnativa - Jairo Llopis
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright 2016 LasLabs Inc. # Copyright 2016 LasLabs Inc.
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html). # License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).

View File

@@ -1,24 +1,24 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<odoo> <odoo>
<record model="ir.ui.view" id="act_report_xml_view"> <record model="ir.ui.view" id="act_report_xml_view">
<field name="name">ir.actions.report.printing</field> <field name="name">ir.actions.report.form (in base_report_to_printer)</field>
<field name="model">ir.actions.report</field> <field name="model">ir.actions.report</field>
<field name="inherit_id" ref="base.act_report_xml_view" /> <field name="inherit_id" ref="base.act_report_xml_view"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//page[@name='security']" position="before" > <xpath expr="//page[@name='security']" position="before">
<page string="Print" name="print" > <page string="Print" name="print">
<group> <group>
<field name="property_printing_action_id"/> <field name="property_printing_action_id"/>
<field name="printing_printer_id"/> <field name="printing_printer_id"/>
<field name="printer_tray_id"/> <field name="printer_tray_id"/>
</group> </group>
<separator string="Specific actions per user"/> <separator string="Specific actions per user"/>
<field name="printing_action_ids"/> <field name="printing_action_ids"/>
</page> </page>
</xpath> </xpath>
</field> </field>
</record> </record>
</odoo> </odoo>

View File

@@ -2,7 +2,7 @@
<odoo> <odoo>
<record model="ir.ui.view" id="printing_job_view_form"> <record model="ir.ui.view" id="printing_job_view_form">
<field name="name">printing.job.form</field> <field name="name">printing.job.form (in base_report_to_printer)</field>
<field name="model">printing.job</field> <field name="model">printing.job</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Job"> <form string="Job">
@@ -30,7 +30,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_job_view_tree"> <record model="ir.ui.view" id="printing_job_view_tree">
<field name="name">printing.job.tree</field> <field name="name">printing.job.tree (in base_report_to_printer)</field>
<field name="model">printing.job</field> <field name="model">printing.job</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Job"> <tree string="Job">

View File

@@ -8,7 +8,7 @@
/> />
<record model="ir.ui.view" id="printing_printer_view_form"> <record model="ir.ui.view" id="printing_printer_view_form">
<field name="name">printing.printer.form</field> <field name="name">printing.printer.form (in base_report_to_printer)</field>
<field name="model">printing.printer</field> <field name="model">printing.printer</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Printers"> <form string="Printers">
@@ -58,7 +58,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_printer_view_tree"> <record model="ir.ui.view" id="printing_printer_view_tree">
<field name="name">printing.printer.tree</field> <field name="name">printing.printer.tree (in base_report_to_printer)</field>
<field name="model">printing.printer</field> <field name="model">printing.printer</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Printers" colors="green:status=='available'; orange:status=='printing'; red:1;"> <tree string="Printers" colors="green:status=='available'; orange:status=='printing'; red:1;">
@@ -71,7 +71,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_printer_view_search"> <record model="ir.ui.view" id="printing_printer_view_search">
<field name="name">printing.printer.search</field> <field name="name">printing.printer.search (in base_report_to_printer)</field>
<field name="model">printing.printer</field> <field name="model">printing.printer</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Printers"> <search string="Printers">

View File

@@ -2,7 +2,7 @@
<odoo> <odoo>
<record model="ir.ui.view" id="printing_report_xml_action_view_form"> <record model="ir.ui.view" id="printing_report_xml_action_view_form">
<field name="name">printing.report.xml.action.form</field> <field name="name">printing.report.xml.action.form (in base_report_to_printer)</field>
<field name="model">printing.report.xml.action</field> <field name="model">printing.report.xml.action</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Report Printing Actions"> <form string="Report Printing Actions">
@@ -17,7 +17,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_report_xml_action_view_tree"> <record model="ir.ui.view" id="printing_report_xml_action_view_tree">
<field name="name">printing.report.xml.action.tree</field> <field name="name">printing.report.xml.action.tree (in base_report_to_printer)</field>
<field name="model">printing.report.xml.action</field> <field name="model">printing.report.xml.action</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Report Printing Actions"> <tree string="Report Printing Actions">

View File

@@ -2,7 +2,7 @@
<odoo> <odoo>
<record model="ir.ui.view" id="printing_server_view_form"> <record model="ir.ui.view" id="printing_server_view_form">
<field name="name">printing.server.form</field> <field name="name">printing.server.form (in base_report_to_printer)</field>
<field name="model">printing.server</field> <field name="model">printing.server</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Servers"> <form string="Servers">
@@ -30,7 +30,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_server_view_tree"> <record model="ir.ui.view" id="printing_server_view_tree">
<field name="name">printing.server.tree</field> <field name="name">printing.server.tree (in base_report_to_printer)</field>
<field name="model">printing.server</field> <field name="model">printing.server</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<tree string="Servers"> <tree string="Servers">
@@ -42,7 +42,7 @@
</record> </record>
<record model="ir.ui.view" id="printing_server_view_search"> <record model="ir.ui.view" id="printing_server_view_search">
<field name="name">printing.server.search</field> <field name="name">printing.server.search (in base_report_to_printer)</field>
<field name="model">printing.server</field> <field name="model">printing.server</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<search string="Servers"> <search string="Servers">

View File

@@ -1,32 +1,32 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<odoo> <odoo>
<record model="ir.ui.view" id="view_users_form"> <record model="ir.ui.view" id="view_users_form">
<field name="name">res.users.form.printing.preferences</field> <field name="name">res.users.form (in base_report_to_printer)</field>
<field name="model">res.users</field> <field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form" /> <field name="inherit_id" ref="base.view_users_form"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<xpath expr="//group[@name='preferences']/ancestor::page" position="inside"> <xpath expr="//group[@name='preferences']/ancestor::page" position="inside">
<group string="Printing" name="printing"> <group string="Printing" name="printing">
<field name="printing_action"/> <field name="printing_action"/>
<field name="printing_printer_id" options="{'no_create': True}"/> <field name="printing_printer_id" options="{'no_create': True}"/>
</group> </group>
</xpath> </xpath>
</field> </field>
</record> </record>
<record model="ir.ui.view" id="view_users_form_simple_modif"> <record model="ir.ui.view" id="view_users_form_simple_modif">
<field name="name">res.users.form.printing</field> <field name="name">res.users.form.simple (in base_report_to_printer)</field>
<field name="model">res.users</field> <field name="model">res.users</field>
<field name="inherit_id" ref="base.view_users_form_simple_modif" /> <field name="inherit_id" ref="base.view_users_form_simple_modif"/>
<field name="arch" type="xml"> <field name="arch" type="xml">
<footer position="before"> <footer position="before">
<group string="Printing" name="printing"> <group string="Printing" name="printing">
<field name="printing_action" readonly="0"/> <field name="printing_action" readonly="0"/>
<field name="printing_printer_id" readonly="0" options="{'no_create': True}"/> <field name="printing_printer_id" readonly="0" options="{'no_create': True}"/>
</group> </group>
</footer> </footer>
</field> </field>
</record> </record>
</odoo> </odoo>

View File

@@ -1,3 +1,2 @@
# -*- coding: utf-8 -*-
from . import printing_printer_update_wizard from . import printing_printer_update_wizard

View File

@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
# Copyright (c) 2009 Albert Cervera i Areny <albert@nan-tic.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 Agile Business Group sagl (<http://www.agilebg.com>)
# Copyright (C) 2011 Domsense srl (<http://www.domsense.com>) # Copyright (C) 2011 Domsense srl (<http://www.domsense.com>)

View File

@@ -5,7 +5,7 @@
<field name="model">printing.printer.update.wizard</field> <field name="model">printing.printer.update.wizard</field>
<field name="arch" type="xml"> <field name="arch" type="xml">
<form string="Update Printers from CUPS"> <form string="Update Printers from CUPS">
<label string="This process will create all missing printers from the current CUPS server." colspan="2"/> <label string="This process will create all missing printers from the current CUPS server." colspan="2" for=""/>
<footer> <footer>
<button name="action_ok" string="Ok" type="object" class="oe_highlight"/> <button name="action_ok" string="Ok" type="object" class="oe_highlight"/>
or or