Commit Graph

66 Commits

Author SHA1 Message Date
Denis Ledoux 439cdb6871 [FIX] report: print time in user timezone
In reports calling the internal headers layout,
e.g. the general ledger,
the print time was displayed in UTC,
while it should be in user tz.

closes #3341
opw-612043
2015-05-18 12:44:36 +02:00
Denis Ledoux 0167acbb52 [FIX] report : translation of report using website editor
In the website editor, the translations are loaded using
the route 'get_view_translations', which returns the translations
of the templates loaded by the website (t-call calls)

The thing is, report templates use the 'translate_doc' method
to actually load the report, translated in the partner language,
and the templates loaded by this method are not seen by the website,
therefore, when calling 'get_view_translations', those report
templates were just ignored, thus their translations are not loaded.

This rev. injects the templates loaded with translate_doc
when rendering the report into the method 'customize_template_get'
(which is used by 'get_view_translations' to retrieve the loaded templates).

The translations of the reports are therefore now loaded corretly when
hitting the "translate" button in the website editor for reports.

Besides, this rev. has as (good) side-effect to add the template,
in the template selection input when editing using the HTML editor.

opw-620713
2015-02-18 16:21:42 +01:00
Martin Trigaux 1d99784a0a [FIX] report: allow margin with size 0
Setting the margins of a paperformat to 0mm was ignored and fallbacked on wkhtml
default margins.
This change is considered as relatively safe as margin-* fields have a default
value and setting 0 is then an explicit choice.
Fixes #3367, opw 620130
2015-01-06 10:56:46 +01:00
Simon Lejeune 467968b79a [FIX] tools: find_in_path: config is not ready at import time
commit f76d4525a was not actually working: extra keys from
config files are not yet into the config options dict at
import time. The fix is to move the logic inside the method,
like in `find_pg_tool` just below.

Also fix the use of `find_in_path` in report.py: the subprocess
may also raise AttributeError exception, so instead of listing
all the possible ones just re-raise the IOError shallowed by
`find_in_path` when the result is None.

Fixes #3809 #3811
2014-11-23 15:22:02 +01:00
Simon Lejeune f76d4525a3 [ADD] tools: handling of bin_path key in find_in_path
The openerp-server.conf now generates the bin_path record, in order
to resolve calls to external binaries served in the thirdparty dir.

Adpated report.py to use find_in_path and not directly which.
2014-11-21 18:08:12 +01:00
Simone Orsi 66969f51fa [FIX] Report: get_pdf: don't miss main elements when parsing html
Main elements can have more than one class, thus can be ignored by the previous
naive xpath. This patch brings a stronger xpath.
2014-11-05 11:49:53 +01:00
Simon Lejeune 440fb712cb [FIX] Report: use ir.config 'report.url' key as base url if it exists
Browse ir.config 'report.url' with superuser as
the user may want to restrict access of this key to the public
2014-10-24 16:37:30 +02:00
Paulius Sladkevičius 83b4742b56 [FIX] Render of report shouldn't update context
With API 8 context is frozendict that don't support update
2014-10-23 17:33:37 +02:00
Christophe Simonis 2b192bef22 [FIX] report: do not fail if PDF cannot be saved as attachment due to AccessError 2014-10-16 15:50:26 +02:00
Simon Lejeune 176404dd14 [FIX] Report: attachment_use need attachment 2014-09-24 17:33:00 +02:00
Simon Lejeune 5936a5c4a6 [FIX] Report: attachment and attachment_use: fix logic
Previously, attachment and attachment_use were only functionnal when used
simultaneously. The code did not consider the fact that the user may want
an historic of all the printed reports. This commit allow the use of
attachment without attachment_use.

It also tell explicitely qweb to generate the branding (used to separate
reports from a unique html when printing multiple reports). Before, it was
functional only when website was installed, because we forced 'editable' that
only has meaning in website.
2014-09-24 16:48:39 +02:00
Simon Lejeune f299b40fe6 [FIX] report: windows: lower level of file opening/closing, which to find wkhtmltpdf
* Use of 'which' to find the wkhtmltopdf binary (allow the win32 service to find it)
* Use of mkstemp and manual close of the file descriptors
2014-09-23 14:07:03 +02:00
DEEP SILVER ACCESSORY e458be4a14 [FIX] Report: compatibility issues on Windows
This commit fixes two different issues specific to Windows:
* NamedTemporaryFile behavior, requiring a file to be closed before being
  accessed a second time
* Wkhtmltopdf crash when the document's dpi is inferor to 96
2014-09-23 14:07:03 +02:00
Xavier Morel 7558e2e786 [IMP] distribute branding on @groups instead of disabling edition
Avoids 2 rendering passes, and allows editing e.g. events detail page, which
couldn't be done (due to groups=public in a mail component)

fixes #1994
2014-09-08 11:16:06 +02:00
rlu-odoo 8b67a7202d [REF] OpenERP --> Odoo in various UI texts
Rebranding has been done in:
- data/demo files
- html templates
- help notices
- comments
- logger messages
- and other various messages

(Commit taken from odoo-dev:8.0-improve-openerp-odoo-rlu at rev 7deaa08)

Closes #1260
2014-07-18 13:45:41 +02:00
Raphael Collet cbe2dbb672 [MERGE] new v8 api by rco
A squashed merge is required as the conversion of the apiculture branch from
bzr to git was not correctly done. The git history contains irrelevant blobs
and commits. This branch brings a lot of changes and fixes, too many to list
exhaustively.

- New orm api, objects are now used instead of ids
- Environements to encapsulates cr uid context while maintaining backward compatibility
- Field compute attribute is a new object oriented way to define function fields
- Shared browse record cache
- New onchange protocol
- Optional copy flag on fields
- Documentation update
- Dead code cleanup
- Lots of fixes
2014-07-06 17:05:41 +02:00
Simon Lejeune 9cf4c03167 [FIX] display an error message instead of True when a group prevent to edit a report 2014-06-29 17:15:00 +02:00
Simon Lejeune 64fdc4bbcf [REF] no more hardcoded html in report.py 2014-06-29 15:54:18 +02:00
Simon Lejeune 891c890d73 [FIX] handle the case where request is bound, request.website exist but is None 2014-06-27 19:12:44 +02:00
Simon Lejeune fc8592adf2 [FIX] Report: translation fixed, use of 'primary clone' of web.layout and website.layout, minimal template is now a QWeb template 2014-06-27 12:00:49 +02:00
Xavier Morel ba4b203e31 [FIX] report rendering should ignore http.Retry 2014-06-17 15:19:54 +02:00
Olivier Dony 04211015fc [MERGE] Forward-port of latest saas-4 fixes, up to 0452851 2014-05-27 20:49:49 +02:00
Simon Lejeune 1f97c40c9c [FIX] Report: get the wkhtmltopdf version in a cleaner way with a simple regex 2014-05-21 14:05:18 +02:00
Simon Lejeune 58d3a6f3f7 [FIX] Report: inform the user that he may not print a pdf report while his openerp is running with only one worker; adapt method to extract wkhtmltopdf version to also work on mac where the ouput of '--version' is different from gnu/linux binary 2014-05-21 13:06:31 +02:00
Simon Lejeune 654df600c1 [FIX] Report: less verbose error message 2014-05-21 13:02:59 +02:00
Simon Lejeune 226579a80d [FIX] Report: removed psutil/signal/openerp worker crap 2014-05-21 13:01:42 +02:00
Simon Lejeune 4019b2b334 [FIX] Report: do not raise when wkhtmltopdf returns a code 1. In most cases, it is due to some http requests which did not success *but* the pdf is still acceptable. Far from the best commit ever, but it avoids to completely crash when just a link to an image is wrong 2014-05-21 12:56:56 +02:00
Quentin (OpenERP) 70eb74a260 [MERGE] merged with trunk up to revision 9425. Needs to find another icon for Traceability on lot, though
bzr revid: qdp-launchpad@openerp.com-20140507182917-erjammra4okyei1c
2014-05-07 20:29:17 +02:00
Christophe Simonis b8089a1521 [MERGE] forward port of branch saas-4 up to revid 9410 chs@openerp.com-20140507164207-kmme4tsrd4w1m7l1
bzr revid: chs@openerp.com-20140507170112-bjeltv2b0coy60am
2014-05-07 19:01:12 +02:00
Josse Colpaert 8b84615de1 [MERGE] Merge from trunk test
bzr revid: jco@openerp.com-20140502130352-c3h1fk332eqyd78b
2014-05-02 15:03:52 +02:00
Simon Lejeune 7ad6d7a150 [FIX] Report: usage of ids in get_action more consistent: only pass them when they are useful, else pass an empty list
bzr revid: sle@openerp.com-20140502130310-106au0jsza0b3nwe
2014-05-02 15:03:10 +02:00
Simon Lejeune 7e8dcc5600 [IMP] l10n_be and l1n_fr reports converted to QWeb
bzr revid: sle@openerp.com-20140422121105-osvy8ji5v40t70jf
2014-04-22 14:11:05 +02:00
Quentin (OpenERP) 398d96f273 [MERGE] merged trunk up to revision 9327
bzr revid: qdp-launchpad@openerp.com-20140414094743-hv0u7qhigv1to2uc
2014-04-14 11:47:43 +02:00
Simon Lejeune e1bf5bd97c [IMP] Report: renamed 'render_doc' method as 'translate_doc' for better understanding and added it a 'lang_field' attribute to explicitely set the lang. Adapted report_invoice, report_saleorder, report_overdue and report_intrastatinvoice this way.
bzr revid: sle@openerp.com-20140408134953-vql9ft8cosoanixt
2014-04-08 15:49:53 +02:00
Simon Lejeune 9660a92a91 [FIX] regression when fixing specific paperformat argument on a template
bzr revid: sle@openerp.com-20140407151515-dxdxjt60ld7jn2cs
2014-04-07 17:15:15 +02:00
Simon Lejeune d908d26c7c [REV] revert revid9276 (no need to include formatLang as qweb has since introduced t-esc-options)
bzr revid: sle@openerp.com-20140407133313-re7xwd5190hk6zqi
2014-04-07 15:33:13 +02:00
Simon Lejeune 91a78667ba [FIX] Report: insert formatLang in the rendering environment if not present; Sale_layout: use formatLang on the subtotal
bzr revid: sle@openerp.com-20140404121128-puvr1zs244lit5m2
2014-04-04 14:11:28 +02:00
Simon Lejeune 3a917639c8 [FIX] report: there are not always ids in get_pdf...
bzr revid: sle@openerp.com-20140403165051-e6sg419c19xv3w7b
2014-04-03 18:50:51 +02:00
Simon Lejeune ff1e5edcea [FIX] guess the language in which the document must be translated without triggering an orm warning
bzr revid: sle@openerp.com-20140403162138-6yvh3q24n39tdi4r
2014-04-03 18:21:38 +02:00
Simon Lejeune d5c06607b6 [FIX] Report: in the save_in_attachment logic, when a single report is printed, use the id passed in argument to identify it (and not the qweb branding)
bzr revid: sle@openerp.com-20140403160133-4axmxhw7bq2yf94l
2014-04-03 18:01:33 +02:00
Simon Lejeune 4975d2b9dc [FIX] fixed report translation and translate overdue report into partner's lang
bzr revid: sle@openerp.com-20140403143235-mpw30fq4j2nyov6x
2014-04-03 16:32:35 +02:00
Simon Lejeune 2c90fad7ac [REF][IMP] report module: merge the four report's routes into one; extra report arguments are passed json encoded (therefore removed the _eval_params method); added an abstract_report model to wrap old-style report without touching them; Removed formatLang method from report as it is embeded in the old-style report localcontext; moved the save_in_attachment logic in a method for readability; adapted the action manager to encode data and context of action if needed; fixed the post install test to test the generic report
bzr revid: sle@openerp.com-20140402162344-3lrako0jepmhasvl
2014-04-02 18:23:44 +02:00
Quentin (OpenERP) fe7b3c66a3 [FIX] stock_picking_wave: fixed picking wave report
bzr revid: qdp-launchpad@openerp.com-20140328105254-0n0jm309n2v4q160
2014-03-28 11:52:54 +01:00
Simon Lejeune c771903c3b [IMP] account* reports: removed rml, added qweb template, changed the wizard to return qweb actions
bzr revid: sle@openerp.com-20140327182520-uu7ezsqic30x7mqo
2014-03-27 19:25:20 +01:00
Simon Lejeune b6f6f8614a [FIX] Handle the case where website is installed but the pdf generation is not called in a website request context
bzr revid: sle@openerp.com-20140324174630-43wi6nlh6bigaq7g
2014-03-24 18:46:30 +01:00
Simon Lejeune 8581b1847f [IMP] Multiple improvements: eval_param is set on the controller, the subprocess to get the version of wkhtmltopdf is only open at OpenERP start, better exceptions handling (try to avoid exceptions shallowing) and the rpc call from the webclient to know the version of wkhtmltopdf is only done once
bzr revid: sle@openerp.com-20140321164716-uksuu6hsjj7q3698
2014-03-21 17:47:16 +01:00
Simon Lejeune 1128743932 [FIX] Added the decorator website on the get_file route, correctly pass the context on the mrp bom structure and allow to install report module without pypdf installed
bzr revid: sle@openerp.com-20140321122103-mzp465s8hxckq4ai
2014-03-21 13:21:03 +01:00
Simon Lejeune e06cefb4be [FIX] Correctly separate website variable between report and website_report layouts
bzr revid: sle@openerp.com-20140321111742-rzkykk00z6fbum8d
2014-03-21 12:17:42 +01:00
Simon Lejeune 57e6e8fd28 [FIX] Multiples fixes: correct context passing, changed osv.Model to osv.AbstractModel to avoid creating tables in database when the model use for the reports contains only method
bzr revid: sle@openerp.com-20140321105806-0bwo992995la91fe
2014-03-21 11:58:06 +01:00
Simon Lejeune ad50d5fcfe [FIX] Multiple improvements in report including giving formatlang a cursor and a uid via a lambda method, cleaning of some comments and restoring the page numbering
bzr revid: sle@openerp.com-20140320165841-21clvch4ujak1y3m
2014-03-20 17:58:41 +01:00