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
=== modified file 'report_webkit/__openerp__.py'
--- report_webkit/__openerp__.py 2013-08-15 07:54:23 +0000
+++ report_webkit/__openerp__.py 2013-11-15 16:21:03 +0000
@@ -48,7 +48,7 @@
48 - Raw HTML debugger48 - Raw HTML debugger
49 - Book printing capabilities49 - Book printing capabilities
50 - Margins definition50 - Margins definition
51 - Paper size definition51 - Paper size definition (event custom paper size)
5252
53Multiple headers and logos can be defined per company. CSS style, header and53Multiple headers and logos can be defined per company. CSS style, header and
54footer body are defined per company.54footer body are defined per company.
5555
=== modified file 'report_webkit/header.py'
--- report_webkit/header.py 2012-10-23 16:05:04 +0000
+++ report_webkit/header.py 2013-11-15 16:21:03 +0000
@@ -81,11 +81,14 @@
81 ('Legal', 'Legal 3 8.5 x 14 inches, 215.9 x 355.6 mm'),81 ('Legal', 'Legal 3 8.5 x 14 inches, 215.9 x 355.6 mm'),
82 ('Letter','Letter 2 8.5 x 11 inches, 215.9 x 279.4 mm'),82 ('Letter','Letter 2 8.5 x 11 inches, 215.9 x 279.4 mm'),
83 ('Tabloid', 'Tabloid 29 279.4 x 431.8 mm'),83 ('Tabloid', 'Tabloid 29 279.4 x 431.8 mm'),
84 ('custom', 'Custom Paper Size'),
84 ],85 ],
85 'Paper size',86 'Paper size',
86 required=True,87 required=True,
87 help="Select Proper Paper size"88 help="Select Proper Paper size"
88 )89 ),
90 'paper_width': fields.integer('Paper Width (mm)'),
91 'paper_height': fields.integer('Paper Height (mm)'),
89 }92 }
90HeaderHTML()93HeaderHTML()
9194
9295
=== modified file 'report_webkit/header_view.xml'
--- report_webkit/header_view.xml 2012-10-23 16:05:04 +0000
+++ report_webkit/header_view.xml 2013-11-15 16:21:03 +0000
@@ -26,6 +26,8 @@
26 <field name='company_id'/>26 <field name='company_id'/>
27 <field name="orientation"/>27 <field name="orientation"/>
28 <field name="format"/>28 <field name="format"/>
29 <field name="paper_width" attrs="{'invisible': [('format', '!=', 'custom')], 'required': [('format', '=', 'custom')]}" />
30 <field name="paper_height" attrs="{'invisible': [('format', '!=', 'custom')], 'required': [('format', '=', 'custom')]}" />
29 </group><group>31 </group><group>
30 <field name="margin_top"/>32 <field name="margin_top"/>
31 <field name="margin_bottom"/>33 <field name="margin_bottom"/>
3234
=== modified file 'report_webkit/webkit_report.py'
--- report_webkit/webkit_report.py 2012-10-23 16:05:04 +0000
+++ report_webkit/webkit_report.py 2013-11-15 16:21:03 +0000
@@ -149,7 +149,11 @@
149 if webkit_header.orientation :149 if webkit_header.orientation :
150 command.extend(['--orientation', str(webkit_header.orientation).replace(',', '.')])150 command.extend(['--orientation', str(webkit_header.orientation).replace(',', '.')])
151 if webkit_header.format :151 if webkit_header.format :
152 command.extend(['--page-size', str(webkit_header.format).replace(',', '.')])152 if webkit_header.format=='custom':
153 command.extend(['--page-width', str(webkit_header.paper_width).replace(',', '.')])
154 command.extend(['--page-height', str(webkit_header.paper_height).replace(',', '.')])
155 else:
156 command.extend(['--page-size', str(webkit_header.format).replace(',', '.')])
153 count = 0157 count = 0
154 for html in html_list :158 for html in html_list :
155 html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w')159 html_file = file(os.path.join(tmp_dir, str(time.time()) + str(count) +'.body.html'), 'w')