Commit Graph

148 Commits

Author SHA1 Message Date
Denis Ledoux 453b373a68 [FIX] report: datetime already imported, differently
This rev. is related to 439cdb6871.

The module datetime was already available in the reports,
and it was the entire datetime module that was imported,
not just the class.

This rev. is not recompatible with 439cdb6871,
but there is no other choice, since other existing
reports might already expected the datetime module
and not the class

opw-640299
2015-05-20 12:19:29 +02:00
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
Martin Trigaux cff65f57eb [IMP] report: use unminifed version reset.css
Source from https://code.google.com/p/reset5/
Used same file to be able to merge in stable but should be moved to separate
file in lib folder in master.
Fixes #6376
2015-04-30 15:31:48 +02:00
Olivier Dony 622e00baa5 [I18N] Sync 8.0 translations from Launchpad 2015-04-28 09:45:53 +02:00
Denis Ledoux 3c61ee5c68 [FIX] report: random disappearance of headers/footers
This issue is related to the wkhtmltopdf issue
https://github.com/wkhtmltopdf/wkhtmltopdf/issues/2083

It seems there is a race condition in the Javascript file
loading in wkhtmltopdf 0.12.x.

The subst.js file put in the header/footer of reports
was not always loaded when the page was being rendered,
leading to the crash of the onload="subst()" attr in
the body node, leading to the non-rendering
of the header/footer.

Replacing the script file by its content solves
the issue.

Increasing the --javascript-delay of the wkhtmltopdf
executable (e.g. 1000 ms instead of 200 ms,
the default value) seems to solve the problem
as well, but will lead to obvious performance issues.

We therefore choose to put the javascript code inline,
as a workaround,
the time the issue is solved in wkhtmltopdf, at least.

closes #3047,#5548,#6207
opw-633161
2015-04-24 15:55:35 +02:00
Denis Ledoux 19aa7b732b [FIX] report: overflow of long content in reports colums
When having a long, non-breakable, content
within a report column,
e.g. an invoice with a very long, pipe-separated, origin,
the content overflowed on other columns.

Set word-wrap: break-word; prevent this behavior,
and is not considered dangerous regarding the possible
side-effects on the design in the reports layouts.

In fact, we should even consider applying this change
on the webclient itself. A similar issue happens in the form view
when having a field with a long non-breakable content,
e.g. a long, pipe-separated orign in an invoice. Nevertheless,
we should avoid taking risks in stable releases,
and this change in the webclient should therefore be done
carefully in master release.

opw-629352
2015-03-03 12:35:25 +01:00
Denis Ledoux 22606c8905 [FIX] report: abstract reports default lang
In ir_ui_view.py, in method render (line 132 atm),
the values passed to the rendering engine is a merge of the context
and the values.

Therefore, if at this place, the language is rightly set in the context,
the report lang will be as well in the values.

In abstract_report.py, the values passed to the render method is the
wrapped report localcontext in which are added some key/values
(docs, doc_ids, doc_model).
By default, the lang in the localcontext is False
See __init__ method of rml_parse class in report_sxw.py.
If setLang method is not called, the lang in the localcontext remains False.

In this rev., we avoid to overwrite the lang from the context by the lang
of the localcontext if this one is False, so the lang of the report is set
with the current context lang.

Forcing the lang of the report to False had as side-effect to prevent the
editing of report using the website editor(e.g. playslip_report)

opw-628720
2015-02-24 17:42:25 +01: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
Olivier Dony 91d4b947f6 [I18N] Update translations from Launchpad 8.0 branches 2015-02-18 11:51:07 +01:00
Olivier Dony 8e03852fd4 [I18N] Update translations from Launchpad 8.0 branches 2015-01-26 16:36:51 +01:00
Olivier Dony 495ec92251 [I18N] Update translations from Launchpad 8.0 branches 2015-01-21 15:36:54 +01:00
Olivier Dony 39f00b3637 [I18N] Update translation templates with latest terms
Total new terms: 270
Total deleted terms: 82
Total identical terms: 19653
Old total number of terms: 19735
New total number of terms: 19923
2015-01-21 15:31:22 +01:00
Denis Ledoux b5e62214fa [FIX] report: reload record after report printed 2015-01-16 14:55:17 +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
kevin wang 7566b9d425 [FIX] report barcode cast humanreadable 2014-12-23 00:10:57 +01:00
Franck Bret e0d482968d [FIX] report add the humanreadable option to barcode image generator
Closes #4334
2014-12-19 05:09:31 +01:00
Simon Lejeune 08604812d8 [FIX] Report: html escape the error json string
session.get_file appends the json to the body of the generated iframe and
then tries to json.parse it by reading contentNode on the body.
Exceptions from `report_download` method may contain `<` and `>`, so when
json.parse tries to json.parse the contentNode, it reads only a part of
the original json string. htmlescaping the json string solves the issue
by preventing the content of the json string to be interpreted as html.
2014-12-12 16:04:31 +01:00
Simon Lejeune 80bb4422be [FIX] Report: don't shallow exceptions in report_download 2014-12-12 16:04:31 +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
Olivier Dony a6d24db305 [I18N] Update translations from Launchpad 8.0 branches 2014-11-19 17:49: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
David Monjoie d492a4d64a [FIX] report: fix report HTML editor scrollbar in Firefox 2014-10-30 12:25:13 +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
Olivier Dony 7439421ad2 [I18N] Update translations from Launchpad 8.0 branches 2014-10-08 17:52:25 +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
Olivier Dony b74d830eb2 [I18N] Update translation templates with latest term changes 2014-09-23 19:13:50 +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
Olivier Dony 1c5b5e4290 [I18N] Update translations from Launchpad 8.0 branches
server: rev. 26 rev-id launchpad_translations_on_behalf_of_openerp-20140923072744-tkfs0yinu8msjh09
addons: rev. 39 rev-id launchpad_translations_on_behalf_of_openerp-20140923072715-5j7qvnuvmmb1zzy1
web: rev. 23 rev-id launchpad_translations_on_behalf_of_openerp-20140923072757-jvh9l6r2x0vfcyhb
2014-09-23 13:42:05 +02:00
Olivier Dony 53aa92d3c9 [I18N] Update translations from Launchpad branches 2014-09-18 11:47:16 +02:00
Simon Lejeune ce0dcac161 [FIX] report: /report/download route should not be website enabled
There's a little magic inside the website enabled route modifying the
context's lang, thus breaking the logic to print the report in the
current user's lang. The direct route to display the report should
stay in website_enabled mode, as it allows to switch lang, use the
website translator and so on.
2014-09-12 12:29:29 +02:00
Simon Lejeune 4b82cf666f [FIX] Report: search associated qweb views: do not forward context
The context may be inconsistent (for instance, containing a group_by associated to another
model). The client will take care of keeping it consistent. Fixes issue #1768
2014-09-09 14:36:00 +02:00
Olivier Dony fac96241df [I18N] Update 8.0 translations with latest changes from Launchpad 2014-09-08 19:04:25 +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
Olivier Dony 50ef63881a [I18N] Update 8.0 translation with latest source code 2014-08-14 17:01:54 +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 f24fe427fa [FIX] remove useless view inheritance correction 2014-06-27 12:04:52 +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
Fabien Meghazi faa09da325 Removed version="7.0" from form views 2014-06-12 09:09:59 +02:00
Olivier Dony 04211015fc [MERGE] Forward-port of latest saas-4 fixes, up to 0452851 2014-05-27 20:49:49 +02:00
Richard Mathot e28c810123 [FIX] website: convert non-standard HTML metatag to data attribute 2014-05-26 08:51:38 +02:00