Commit Graph

274 Commits

Author SHA1 Message Date
Sylvain GARANCHER
d594b24cb4 [FIX] base_report_to_printer: A button method should be @api.multi 2017-10-03 18:25:41 +02:00
@
a38e6117f2 Update README.rst 2017-10-03 18:13:22 +02:00
BLUTEC™ Solutions
36476e1176 Update README.rst
Provided steps to installing PyCups
2017-10-03 18:13:21 +02:00
Angel Moya - PESOL
382ed6148f [10] FIX format parameter (#84)
* FIX format parameter

To be able to print files in raw format it's needed to set this parameter.

Previous code was not able to print raw files, but it didn't get error because 'format' used on line 107 is assumed as a format funtion, because format parameter was not on this scope.

* FIX pep8
2017-10-03 18:13:21 +02:00
Sylvain Garancher
020d89b496 [10.0][MIG] base_report_to_printer (#68)
* Set api.multi for action called as `object` on view

* Merge syleam printers module into base_report_to_printer (#60)

* [IMP] Updated unit tests

* [FIX] Fixed renamed attributes

* [FIX] Remove deleted fields

* [IMP] Add printing.server and printing.job models

* [IMP] Allow to cancel all jobs, enable, and disable printers

* [IMP] Split the cups part of print_document into a new print_file method

* [IMP] Updated cron job to run the action_update_jobs method

* [ADD] Add a migration script to create a printing server from configuration

* [MIG] Migrate base_report_to_printer to v10.0

Removed deprecated methods on printing.printer (replaced by methods on
        printing.server)

* [IMP] Add wkhtmltopdf in travis configuration file

* [FIX] base_report_to_printer: Fix Update Job Cron
* Fix API issue with Update Job Cron
** Forward Port from 9.0

* [FIX] Fixed the res.users view

The string attribute should not be used as a selector, because it is
translatable.

* [FIX] Fixed the print_document method of report

The new API migration was made to @api.multi because of the "cr, uid,
ids" signature, but "ids" was the ids of the records to print here, not
the report's ids.
Also, the new API version of "get_pdf" get directly the ids of the
records to print in the standard module, not a recordset.

* [FIX] UI is now (un)blocked only when using qweb-pdf reports in standard addons
2017-10-03 18:13:20 +02:00
Pedro M. Baeza
cab8d0c3b8 [MIG] Rename manifest files 2017-10-03 18:13:20 +02:00
Pedro M. Baeza
f30d68a390 [MIG] Make modules uninstallable 2017-10-03 18:13:20 +02:00
yvaucher
18d0b7661a Fix placeholder for repo in readme.rst 2017-10-03 18:13:19 +02:00
Dave Lasley
d533a2e3e1 [FIX] base_report_to_printer: Switch error type
* Prefer UserError to Warning
2017-10-03 18:13:19 +02:00
Dave Lasley
7281badd52 [FIX] base_report_to_printer: Remove execute bit 2017-10-03 18:13:18 +02:00
Dave Lasley
b655dd1ef6 [FIX] base_report_to_printer: Unify logger import 2017-10-03 18:13:18 +02:00
Dave Lasley
bd6f63e969 [FIX] base_report_to_printer: Minor fixes
* Migrate print_document method to v8 api exclusively
* Use api.multi on _can_print_report
* Simplify printing_printer description
* Simplify noupdate declaration
2017-10-03 18:13:17 +02:00
Dave Lasley
3dae8510f3 [IMP] base_report_to_printer: Add test coverage
* Add test coverage
* Minor touch ups in wizard
* Prefer UserError to Warning
2017-10-03 18:13:17 +02:00
Dave Lasley
9b3eddd88d [MIG] base_report_to_printer: Upgrade to v9 2017-10-03 18:13:17 +02:00
Roel Adriaans
2eac4d40ce [IMP] Soft fail on missing cups import
cups is an external dependency, if it is not installed Odoo will not start.
OCA guidelines specify guidelines for External dependencies, code is from there.
2017-10-03 18:13:16 +02:00
Yannick Vaucher
70d61f7ab0 Merge branch '8.0' of https://github.com/intero-chz/report-print-send into 8.0 2017-10-03 18:13:16 +02:00
Alexis de Lattre
9b5db105fc Add support for multiple copies 2017-10-03 18:13:15 +02:00
czoellner
3ae8fb2dc3 pass context to printer to use it for example in print_options()
* context was lost while getting report
* now it will be passed using with_context
* could be used for print_options (example: pass copies amount for
productlabals)
2017-10-03 18:13:15 +02:00
Pedro M. Baeza
1580da488e [MIG] Make modules uninstallable 2017-10-03 18:13:14 +02:00
Stéphane Bidoul
c03f3c0252 [UPD] prefix versions with 8.0 2017-10-03 18:13:14 +02:00
Yannick Vaucher
bb3e8569bd [PEP8] 2017-10-03 18:13:14 +02:00
vrenaville
3bda06635e [FIX] test if the module is installed before monkey patching 2017-10-03 18:13:13 +02:00
Anthony Muschang
fb0bc40a77 [FIX] base_report_to_printer: make print_document callable from 8.0 api 2017-10-03 18:13:13 +02:00
Anthony Muschang
3fe4f72dfb [FIX] base_report_to_printer: make get_pdf callable from 8.0 api 2017-10-03 18:13:12 +02:00
Nicolas Bessi
67ec48b4c3 Improve bloated condition test 2017-10-03 18:13:12 +02:00
Guewen Baconnier
679f21b39c dict.copy() is more efficient than calling dict 2017-10-03 18:13:11 +02:00
Guewen Baconnier
e991d88ba3 Vague method name, put the predicate method closer to its caller 2017-10-03 18:13:11 +02:00
Guewen Baconnier
55ed4e3206 Past tense is confusing 2017-10-03 18:13:11 +02:00
Guewen Baconnier
e6a846341b The alteration of the context has no effect 2017-10-03 18:13:10 +02:00
Nicolas Bessi
5095569ba5 Fix set the skip directive in context
instead of a faulty return
2017-10-03 18:13:10 +02:00
Nicolas Bessi
2a1e3dabe1 Compatibility fix for report with custom parser
By calling `super.get_pdf` in print_document we can encounter trouble with MRO resolution
that prevent custom report parser (e.g. override of `get_pdf`) to be called.

The fix consist of not calling `super` and prevent multiple call to 'printer.print_document'
2017-10-03 18:13:09 +02:00
Alexandre Fayolle
0863057526 Add OCA as author of OCA addons
In order to get visibility on https://www.odoo.com/apps the OCA board has
decided to add the OCA as author of all the addons maintained as part of the
association.
2017-10-03 18:13:09 +02:00
Guewen Baconnier
e8058b21a2 When get_pdf has no printer, just create the pdf file
And do not print anything, instead of raising an error.
2017-10-03 18:13:08 +02:00
Guewen Baconnier
c27499cf3e Add a limitation in the readme
Corrected some typos at the same time
2017-10-03 18:13:08 +02:00
Guewen Baconnier
d814ab0f41 Updated translations 2017-10-03 18:13:07 +02:00
Guewen Baconnier
fe9c7a54d3 Raise an error if no printer is configured 2017-10-03 18:13:07 +02:00
Guewen Baconnier
83170107a8 Do no longer returns a PDF when a report is printed
Instead, a notification is displayed to the user.
When report.get_pdf() is called on a report that must be printer,
it will print the report *and* returns the pdf, thus code that
calls directly report.get_pdf() will print the pdf on the printer
as expected.

Fixes #16
2017-10-03 18:13:07 +02:00
Alexis de Lattre
77d817af25 Add CUPS_HOST in more debug logs 2017-10-03 18:13:06 +02:00
Alexis de Lattre
35dff1b11c base_report_to_printer: add support for remote CUPS server (not just localhost)
More logging and better error handling
2017-10-03 18:13:06 +02:00
Alexis de Lattre
656939d38e [Usability] Auto-add Administrator user to the Print group
Make XML code more readable
2017-10-03 18:13:05 +02:00
Alexis de Lattre
421bcda960 [FIX] Bug #19 avoid crash when using 'raw' option 2017-10-03 18:13:05 +02:00
Guewen Baconnier
354bade837 Give access to models to all users for reading
So they are able to print
2017-10-03 18:13:04 +02:00
Guewen Baconnier
9dc3dd7ce0 Clean the XML file (remove eval, reindent) 2017-10-03 18:13:04 +02:00
Guewen Baconnier
b4e9161dcc Do not write the printer status if it has not changed
Avoid unnecessary UPDATE every minute
2017-10-03 18:13:04 +02:00
Guewen Baconnier
254495f994 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 #14
2017-10-03 18:13:03 +02:00
Guewen Baconnier
b015085e63 Invalidate the cache when the table is created so the table_exists()
method returns a fresh value after creation of the table
2017-10-03 18:13:03 +02:00
Guewen Baconnier
262a5db1e8 Error on installation of the module 2017-10-03 18:13:02 +02:00
Guewen Baconnier
916d974add Extract a method so it will be easier to override in printer_tray 2017-10-03 18:13:02 +02:00
Guewen Baconnier
9df607093d Refresh the list of printers every 15 seconds instead of 10 2017-10-03 18:13:01 +02:00
Guewen Baconnier
ebe52ef481 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.
2017-10-03 18:13:01 +02:00