Commit Graph

255 Commits

Author SHA1 Message Date
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
Guewen Baconnier
7ac2564668 Move the 'skip_update' right in the browse, it prevents a loop
See https://github.com/odoo/odoo/issues/3644

Also, it helps to have the value set/read in context close to each
other.
2017-10-03 18:13:01 +02:00
Guewen Baconnier
39bd5e94e4 We need the report in print_document and print options (needed in
printer_tray)
2017-10-03 18:13:00 +02:00
Guewen Baconnier
ad5e8b6e46 missing api decorator 2017-10-03 18:13:00 +02:00
Guewen Baconnier
975afd7c72 Update translations, add a string to URI so it is uppercased 2017-10-03 18:12:59 +02:00
Guewen Baconnier
aecc0a5114 Improve form view, add search view for printers 2017-10-03 18:12:59 +02:00
Guewen Baconnier
e15d2672fe Update copyrights 2017-10-03 18:12:58 +02:00
Guewen Baconnier
3d89e22aeb Restore the print capability on deprecated reports 2017-10-03 18:12:58 +02:00
Guewen Baconnier
9c4ea8c10c Implements the print on the new 'report' model 2017-10-03 18:12:58 +02:00
Guewen Baconnier
87ae352f5a browse is called often enough to call the update routine (even too much) 2017-10-03 18:12:57 +02:00
Guewen Baconnier
8a80de3ced 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.
2017-10-03 18:12:57 +02:00
Guewen Baconnier
fbe8630323 Recursion when calling a method with old-style api signature from browse 2017-10-03 18:12:56 +02:00
Guewen Baconnier
242146bcc2 Better view for wizard 2017-10-03 18:12:56 +02:00
Guewen Baconnier
05982df305 Migrate wizard/update_printers.py to new API 2017-10-03 18:12:55 +02:00
Guewen Baconnier
fe3ab51f5a Migrate report_xml_action.py to new API 2017-10-03 18:12:55 +02:00
Guewen Baconnier
200527387c Migrate res_users.py to new API 2017-10-03 18:12:55 +02:00
Guewen Baconnier
ce0876ef9f Migrate printing.py to new API 2017-10-03 18:12:54 +02:00
Guewen Baconnier
f46ad66960 Migrate ir_report.py to new API 2017-10-03 18:12:54 +02:00
Guewen Baconnier
d02f5e616c base_calendar passed away 2017-10-03 18:12:53 +02:00
Guewen Baconnier
3f8838ccda Extract description of the module in README.RST 2017-10-03 18:12:53 +02:00