Commit Graph

49 Commits

Author SHA1 Message Date
Denis Ledoux c5775e56d3 [MERGE] forward port of branch 7.0 up to 25f5329 2015-01-22 14:43:06 +01:00
Denis Ledoux 25f5329deb [FIX] report: break lines and splitted words with reportlab > 3.0
From reportlab 3.0, empty plaintext paragraphs do not lead to a break line anymore.
Before release 3.0, paragraphs having tags but no plaintext leaded to a break line.
This patch aims to recover the behavior of reportlab releases < 3.0, as
<para><font color="white"> </font></para> is used in allmost all rml reports
The current patch is not considered as clean, but we did not find any better solution.
If someone find a parameter to pass to reportlab in order to bring back the old behavior of reportlab
he is welcome to provide the better patch.

Besides, in reportlab 3.0, splitlongwords has been introduced as parameter,
to allow to break long words. The default value is True.
This parameter seems to break the columns headers
(it splits the text within the column header)
We therefore take the choice to not activate it, as it was not present anyway in reportlab < 3.0

To test the good behavior of this patch:
While having reportlab < 3.0 (2.5 for instance), print a draft invoice
Then, upgrade to reportlab > 3.0 (3.1.8 for instance), print the same draft invoice.
The generated pdf must be (allmost) identical, in particular concerning spaces.
Specifically, the space between the partner address and his phone.
2015-01-22 14:23:38 +01:00
Denis Ledoux 0e4216361b [MERGE] forward port of branch 7.0 up to 3a0af6a 2014-10-22 19:26:27 +02:00
Martin Trigaux 354b82bee0 [FIX] report: page numbering rml reports
Save the NumberedCanvas state before doing a page reset.
The order of execution when rendering an rml report is the following:
1. init canevas (_pageNumber = 1)
2. render the page element
3. if still pages to render, afterPage method
4. if still pages to render, showPage method (_pageNumber += 1)
5. back to step 2 for each page
6. draw the ResetPage element (setting flag _doPageReset=True)
7. end the document build with afterPage & showPage method

The PageReset element should be executed at the end of the rendering of a story (subdocument) to reinitialize the page numbers to 0 (for new story) and insert the pageCount element for that story with the total number of pages (needed if want to use tag <pageCount/> in rml).

In case of NumberedCanvas (e.g. used in Trial Balance report), the numbering is generated at the end of the build using the _saved_page_states dict in the canevas.
To have an accurate _saved_page_states content, it needs to be saved before the pageReset.

Fixes #2225
2014-10-21 15:36:01 +02:00
Olivier Dony f3880a8a09 [MERGE] Forward-port of 7.0 up to 64ac1b0 2014-07-04 17:07:53 +02:00
Richard Mathot 04eff4fe3d [TYPO] Stupid typo... 2014-07-03 09:36:46 +02:00
Richard Mathot fbbc3a54e9 [FIX] RML reporting: understandable crash message
When tag <drawString> is misused in an RML report, logs a more explicit
error
2014-07-02 17:30:32 +02:00
Olivier Dony 5b83e88c25 [MERGE] Fwd-port of 7.0 up to 3d31341 2014-07-01 12:28:55 +02:00
Martin Trigaux f825b6043b [FIX] rml: avoid reports ending by zero (opw 608073)
Commit b6a7402 (reverted at f8671cb) was almost correct, the PageReset should be added at the end of each stories but only if we have one more stories.
The PageReset will force the page count to be reseted at zero which means that last page of report would have been at zero.
2014-07-01 11:29:22 +02:00
Olivier Dony 2af03e1b6e [MERGE] Forward-port latest 7.0 bugfixes, up to f8671cb 2014-05-22 16:44:33 +02:00
Denis Ledoux f8671cb48a [REVERT] b6a7402fdb, pagereset seems to be useful in some cases. Need to check deeper 2014-05-22 16:17:04 +02:00
Denis Ledoux 2cc28ce65b [MERGE] Forward-port of latest 7.0 bugfixes, up to rev. b6a7402fdb 2014-05-21 13:46:10 +02:00
Denis Ledoux b6a7402fdb [FIX] report: correct page numbering 2014-05-21 11:20:37 +02:00
Kersten Jeremy c65ae9f055 [FIX] rml2pdf : fix loading of font where mode are not strict. Now we compare always a lower and with serveral mode similar. That fix the usage of some font in report where accent and bold was ignored
bzr revid: jke@openerp.com-20140401094556-h1ybpqf989qt5h60
2014-04-01 11:45:56 +02:00
Denis Ledoux b9d9e781d5 [MERGE] Forward-port of latest saas-2 bugfixes, up to rev. 4955.1.67 revid:dle@openerp.com-20140326092548-bu4bqinhvco8j5wj
bzr revid: dle@openerp.com-20140326093011-pwhsfeippg4cgodj
2014-03-26 10:30:11 +01:00
Denis Ledoux c0103c387d [MERGE][FIX] OPW 591344 : internal reports don't show images
Cleaner method, and shows images.

bzr revid: dle@openerp.com-20140326091529-g7rlqc8tfxlk5u3b
2014-03-26 10:15:29 +01:00
Martin Trigaux f3e7afaaca [MERGE] [FIX] res_font: make it works in multiworker environment
res_font model gains family, path and mode field
Basic fonts embedded in pdf (Helvetica, Times and Courier) are data
Fix reports using font names to be valid (eg: DejaVu Sans Bold -> DejaVuSans-Bold)
default_get of res_company does not scan the filesystem anymore
family field is new name_get font for res_font (more user friendly)
Domain on displayed font to only 'normal ones' (not bold or italic)
Handle fonts in 'book' mode as normal in setTTFontMapping
Relax constraint on res_font to unique family and name ('name' was actually family before)
font_scan is called on 'reload fonts' action button and for each report rendering
font_scan is lazy when loaded from report and scanning the filesystem only if no font recorded in filesystem
'/dev/null' in font path is used to add fonts in the list but not loaded by reportlab
Scanning the filesystem triggers clear_caches
clear_cache resets the list of found fonts to empty list to make font_scan call to reload the full list (when redering a report on any worker, will always get the updated font list after a scan)
Add access rights for fonts (read everybody, create admin, call font_scan as superuser in report rendering)
Remove font hack with BaseCustomTTFonts, rely fully on the system fonts
Use glob instead of listdir (needed for path like '/usr/share/fonts/TTF/*')
Make warning message from reportlab more self-explaining.

Also make the runbot green (which is nice)

bzr revid: mat@openerp.com-20131209171338-o796pldia9da3kt2
2013-12-09 18:13:38 +01:00
Martin Trigaux aac5c9d6eb [IMP] font: better handeling of multiworker environement
bzr revid: mat@openerp.com-20131209151454-5rylu5alldd3ixmh
2013-12-09 16:14:54 +01:00
Christophe Simonis cd810ea7bd merge upstream
bzr revid: chs@openerp.com-20131119185353-qfhaice61xg7qfhn
2013-11-19 19:53:53 +01:00
Denis Ledoux 6792d85b44 [FIX]report: rml2pdf raise exception if cell is too long to be printed (instead of infinite loop). Workaround for reportlab issue #15: https://bitbucket.org/rptlab/reportlab/issue/15/infinite-pages-produced-when-splitting
bzr revid: dle@openerp.com-20131112130412-mbdonb9g7n63w84r
2013-11-12 14:04:12 +01:00
Christophe Simonis aeaed95e81 [IMP] trml2pdf: like css, invalid style name is not a warning.
bzr revid: chs@openerp.com-20131108212709-4dmdbxxh2w1jd51p
2013-11-08 22:27:09 +01:00
Quentin (OpenERP) 232e24b7a4 [FIX] trml2pdf: reportlab 2.4.4 doesn't support the previous syntax (sname in self.default_style)
bzr revid: qdp-launchpad@openerp.com-20130603093048-4iwgnb4hxhsxrazc
2013-06-03 11:30:48 +02:00
Quentin (OpenERP) 03d39c5429 [IMP/FIX] report, trml2pdf: added the support of registerFontFamily tag to allow the mapping of different fonts for bold, italic or boldItalic
bzr revid: qdp-launchpad@openerp.com-20130531114612-ofcn1swt5o5cc7oc
2013-05-31 13:46:12 +02:00
Quentin (OpenERP) 968aa44bdf [FIX] report, rlm2pdf: added support of Sun-ExtA font and the possibility to define a default value for font parameters in parastyles. We can now use <paraStyle name='Normal fontName='xxxx'/> in company header, for example, if we want to define font xxxx to be used by default in each rml reports (if not overwritten in a further paraStyle)
bzr revid: qdp-launchpad@openerp.com-20130527162051-3e7ztox54vyc8xxc
2013-05-27 18:20:51 +02:00
Anael Closson 66cadcdb18 [FIX] OPW 591344 : internal reports don't show images
Cleaner method, and shows images.

bzr revid: acl@openerp.com-20130510151934-e2kvwiexdzp3zc12
2013-05-10 17:19:34 +02:00
Quentin (OpenERP) 631759a2a9 [FIX] report, trml2pdf: allow to use <pageNumber/> tag under a flowable area (<place>...<place/>).
bzr revid: qdp-launchpad@openerp.com-20130408132510-7pq0ityec9sl702f
2013-04-08 15:25:10 +02:00
Vo Minh Thu bfc911e737 [FIX] report: fallback on default font when a specified font does not exist.
bzr revid: vmt@openerp.com-20130311155147-pl3pi072wr819z0z
2013-03-11 16:51:47 +01:00
Tejas Tank ffae4652de [FIX] All OpenERP RML Reports are enabled with transparent Image support.
bzr revid: tta@openerp.com-20121218115043-1yx5b2q7eqcf8xbx
2012-12-18 17:20:43 +05:30
Xavier Morel d02fc09bb9 [IMP] more augmented assignments
bzr revid: xmo@openerp.com-20121214134455-c1o7ehlot6vdwioe
2012-12-14 14:44:55 +01:00
Xavier Morel c6079dd6bb [REM] unnecessary parens
bzr revid: xmo@openerp.com-20121214123803-6xu2s1ndnoyj4i3e
2012-12-14 13:38:03 +01:00
Olivier Dony 7f5ad72429 [MERGE] Forward-port 6.1 bugfixes up to rev. 4307
rev.4307 = rev-id launchpad_translations_on_behalf_of_openerp-20121125065030-g5if5pybr61la4yj

bzr revid: odo@openerp.com-20121126160320-t2suuik6lhk6wl0x
bzr revid: odo@openerp.com-20121126161836-mv8yymzgbnmif4ve
bzr revid: odo@openerp.com-20121126162023-ejvsapwouyudw6c6
bzr revid: odo@openerp.com-20121126181527-d4yx15372bis77qj
2012-11-26 19:15:27 +01:00
Xavier ALT d0125d893d [MERGE] OPW 51167: report: fix header pageCount always zero + add automatic per-story pageCount (v6.0 forward-port)
bzr revid: xal@openerp.com-20120716075217-kpwcotmrhpl4pj60
2012-07-16 09:52:17 +02:00
skh dbec5e9ae6 [FIX]trml2pdf.py : translation issue for the Page x of y on report which is hard coded changed it to x/y
bzr revid: skh@tinyerp.com-20120424061009-hlg4hq8srmjxgteo
2012-04-24 11:40:09 +05:30
Florent Xicluna 7675d45c2c [REF] openerp.report: fix weird indentation, not multiple of four.
bzr revid: florent.xicluna@gmail.com-20120208170456-ak1ykpy6yel71ylc
2012-02-08 18:04:56 +01:00
Florent Xicluna b5fa51f4a6 [REF] openerp.report: use the recommended syntax to raise error and never use empty except:.
bzr revid: florent.xicluna@gmail.com-20120208170217-xsa5odzlhite0nda
2012-02-08 18:02:17 +01:00
Antony Lesuisse 108e53b253 [FIX] use _logger instead of stderr in trml2pdf
lp bug: https://launchpad.net/bugs/906377 fixed

bzr revid: al@openerp.com-20120208013617-22wu77ph56nr58us
2012-02-08 02:36:17 +01:00
Vo Minh Thu 15a4d4e19e [IMP] openerp.report: _logger with fully qualified module name.
bzr revid: vmt@openerp.com-20120124125512-2bjh1xpzcgvz1nrp
2012-01-24 13:55:12 +01:00
Rucha (Open ERP) 628e8540a1 [IMP]: Improvements to format report pageSize according to company paper format(US letter/A4)
bzr revid: rpa@tinyerp.com-20111221092446-48bqtxwfvmgpt49l
2011-12-21 14:54:46 +05:30
Numerigraphe - Lionel Sausin a2f4f2669b [IMP] Added missing vim mode lines
lp bug: https://launchpad.net/bugs/524279 fixed

bzr revid: ls@numerigraphe.fr-20111122085848-1atcrcw8e64altcp
2011-11-22 09:58:48 +01:00
Vo Minh Thu 5ef9dd5f3f [MERGE] Cleaning of the empty dict kwargs (replaced by None).
bzr revid: vmt@openerp.com-20111121133346-2yr8ow3zeyqa9ar5
2011-11-21 14:33:46 +01:00
Numerigraphe - Lionel Sausin ae2be16844 [FIX] unmutable defaults in report
bzr revid: ls@numerigraphe.fr-20111107154556-eofj5s55tkqntsty
2011-11-07 16:45:56 +01:00
Quentin (OpenERP) 1097bbeaca [FIX] rml2pdf: _process_text escaping char for xml
lp bug: https://launchpad.net/bugs/885299 fixed

bzr revid: qdp-launchpad@openerp.com-20111104155759-e0tme9o3g1ef00tq
2011-11-04 16:57:59 +01:00
Olivier Dony 54078c6394 [MERGE] trml2pdf: don't reassign a reused node.text value (additional fix)
lp bug: https://launchpad.net/bugs/640677 fixed

bzr revid: odo@openerp.com-20110919233407-gdna8j4gll0lm4um
2011-09-20 01:34:07 +02:00
fp 6758ee6133 [IMP] report engine: added possibility to use styles on TR tag
bzr revid: qdp-launchpad@openerp.com-20110614082711-l5cvbvm405h247ek
2011-06-14 10:27:11 +02:00
Nimesh (Open ERP) fe230bbb6d [fix] improvement in trml2pdf.py for the image
bzr revid: nco@tinyerp.com-20110530090335-7lamm1fbnalkrhlh
2011-05-30 14:33:35 +05:30
Vo Minh Thu 6d0f31fbd1 [MERGE] don't assign a reused node.text value.
lp bug: https://launchpad.net/bugs/640677 fixed

bzr revid: vmt@openerp.com-20110525080921-fyrkdkdm3niupn1f
2011-05-25 10:09:21 +02:00
Nimesh (Open ERP) 97b3cc08e7 [FIX] image display in every row in report.
bzr revid: nco@tinyerp.com-20110519125941-fey0x5edx56mcnvm
2011-05-19 18:29:41 +05:30
Olivier Dony ab212d05eb [MERGE] merged latest fixes from 6.0, up to revision 3420
Rev 3420 = odo@openerp.com-20110506093704-1vwxsqyz63lq40a1

bzr revid: odo@openerp.com-20110506093920-j1uobqryzx5vv6vv
2011-05-06 11:39:20 +02:00
Vo Minh Thu f8572e5c60 [IMP] openerp python module.
- Some logging code moved from netsvc.py to loglevels.py
- Changed imports to use the new openerp module
- config and netsvc initialization calls move to openerp-server.py
- Moved openerp-server.py outside the old bin directory
- Some imports in tools moved inside the methods to break mutual-dependencies

bzr revid: vmt@openerp.com-20110207125723-ooee7d7ng5elmkso
2011-02-07 13:57:23 +01:00