Merge lp:~grupocitec/ocb-addons/report_webkit_custom_paper_size into lp:ocb-addons

Proposed by GrupoCITEC
Status: Rejected
Rejected by: Holger Brunn (Therp)
Proposed branch: lp:~grupocitec/ocb-addons/report_webkit_custom_paper_size
Merge into: lp:ocb-addons
Diff against target: 62 lines (+12/-3)
4 files modified
report_webkit/__openerp__.py (+1/-1)
report_webkit/header.py (+4/-1)
report_webkit/header_view.xml (+2/-0)
report_webkit/webkit_report.py (+5/-1)
To merge this branch: bzr merge lp:~grupocitec/ocb-addons/report_webkit_custom_paper_size
Reviewer Review Type Date Requested Status
Holger Brunn (Therp) Disapprove
Review via email: mp+195418@code.launchpad.net

Description of the change

New option for defininf custom paper size in report_webkit headers

To post a comment you must log in.
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Can't this be done in a feature module? OCB is meant to provide bug fixes, not new features.

review: Needs Information
Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

any input from the webkit people?

Revision history for this message
bruno bottacini (bruno-bottacini) wrote :

i made a module using the GrupoCITEC patch:

lp:~bruno-bottacini/+junk/7.0-report_webkit_custom_paper_size

Revision history for this message
Holger Brunn (Therp) (hbrunn) wrote :

Bruno,

I can't access your branch, did you change anything here?

But if we can do the same thing with a module I'd rather not add a new feature in ocb, so I'll disapprove.

review: Disapprove
Revision history for this message
GrupoCITEC (grupocitec) wrote :

That was my branch, not Bruno's.

That was my first try to collaborate on OCB branch after all the motivational things about the quick feedback I listened on last year's OpenDays in Brussels. But I was waiting for months for a review of it with no response so I deleted it. Sorry.

I added just 4 or 6 lines of code to WebKit report module in order to enable the options to set custom paper size.

If someone is still interested I can get the code and do a MP again.

"Holger Brunn (Therp)" <email address hidden> wrote:
>Review: Disapprove
>
>Bruno,
>
>I can't access your branch, did you change anything here?
>
>But if we can do the same thing with a module I'd rather not add a new
>feature in ocb, so I'll disapprove.
>--
>https://code.launchpad.net/~grupocitec/ocb-addons/report_webkit_custom_paper_size/+merge/195418
>You are the owner of
>lp:~grupocitec/ocb-addons/report_webkit_custom_paper_size.

--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Revision history for this message
Lionel Sausin - Initiatives/Numérigraphe (ls-initiatives) wrote :

FYI I'm trying to push this feature into v8 on github - https://github.com/odoo/odoo/pull/1084

Unmerged revisions

9660. By <email address hidden>

report_webkit: Add custom paper size option

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'report_webkit/__openerp__.py'
2--- report_webkit/__openerp__.py 2013-08-15 07:54:23 +0000
3+++ report_webkit/__openerp__.py 2013-11-15 16:21:03 +0000
4@@ -48,7 +48,7 @@
5 - Raw HTML debugger
6 - Book printing capabilities
7 - Margins definition
8- - Paper size definition
9+ - Paper size definition (event custom paper size)
10
11 Multiple headers and logos can be defined per company. CSS style, header and
12 footer body are defined per company.
13
14=== modified file 'report_webkit/header.py'
15--- report_webkit/header.py 2012-10-23 16:05:04 +0000
16+++ report_webkit/header.py 2013-11-15 16:21:03 +0000
17@@ -81,11 +81,14 @@
18 ('Legal', 'Legal 3 8.5 x 14 inches, 215.9 x 355.6 mm'),
19 ('Letter','Letter 2 8.5 x 11 inches, 215.9 x 279.4 mm'),
20 ('Tabloid', 'Tabloid 29 279.4 x 431.8 mm'),
21+ ('custom', 'Custom Paper Size'),
22 ],
23 'Paper size',
24 required=True,
25 help="Select Proper Paper size"
26- )
27+ ),
28+ 'paper_width': fields.integer('Paper Width (mm)'),
29+ 'paper_height': fields.integer('Paper Height (mm)'),
30 }
31 HeaderHTML()
32
33
34=== modified file 'report_webkit/header_view.xml'
35--- report_webkit/header_view.xml 2012-10-23 16:05:04 +0000
36+++ report_webkit/header_view.xml 2013-11-15 16:21:03 +0000
37@@ -26,6 +26,8 @@
38 <field name='company_id'/>
39 <field name="orientation"/>
40 <field name="format"/>
41+ <field name="paper_width" attrs="{'invisible': [('format', '!=', 'custom')], 'required': [('format', '=', 'custom')]}" />
42+ <field name="paper_height" attrs="{'invisible': [('format', '!=', 'custom')], 'required': [('format', '=', 'custom')]}" />
43 </group><group>
44 <field name="margin_top"/>
45 <field name="margin_bottom"/>
46
47=== modified file 'report_webkit/webkit_report.py'
48--- report_webkit/webkit_report.py 2012-10-23 16:05:04 +0000
49+++ report_webkit/webkit_report.py 2013-11-15 16:21:03 +0000
50@@ -149,7 +149,11 @@
51 if webkit_header.orientation :
52 command.extend(['--orientation', str(webkit_header.orientation).replace(',', '.')])
53 if webkit_header.format :
54- command.extend(['--page-size', str(webkit_header.format).replace(',', '.')])
55+ if webkit_header.format=='custom':
56+ command.extend(['--page-width', str(webkit_header.paper_width).replace(',', '.')])
57+ command.extend(['--page-height', str(webkit_header.paper_height).replace(',', '.')])
58+ else:
59+ command.extend(['--page-size', str(webkit_header.format).replace(',', '.')])
60 count = 0
61 for html in html_list :
62 html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w')