Merge lp://staging/~kangol/openobject-server/6.0-context-report into lp://staging/openobject-server/6.0

Proposed by Christophe Simonis (OpenERP)
Status: Needs review
Proposed branch: lp://staging/~kangol/openobject-server/6.0-context-report
Merge into: lp://staging/openobject-server/6.0
Diff against target: 75 lines (+7/-7)
5 files modified
bin/report/custom.py (+2/-2)
bin/report/interface.py (+1/-1)
bin/report/printscreen/ps_form.py (+1/-1)
bin/report/printscreen/ps_list.py (+1/-1)
bin/report/render/rml2pdf/trml2pdf.py (+2/-2)
To merge this branch: bzr merge lp://staging/~kangol/openobject-server/6.0-context-report
Reviewer Review Type Date Requested Status
Naresh(OpenERP) (community) Needs Fixing
Review via email: mp+61936@code.staging.launchpad.net
To post a comment you must log in.
Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Christophe,

if we talk about passing the missing context the merge proposal seems Good ! :)

But at the end you removed the 'internal_header' from the localcontext, doing so will not print the page number formatting on right top corner (page 1 out of 10) which is supposed to be printed when internal header is selected. The condition is needed here

if self.localcontext and not self.localcontext.get('internal_header',False):
    self.localcontext.pop('internal_header', None)

Thanks,

review: Needs Fixing
Revision history for this message
Vo Minh Thu (thu) wrote :

Naresh,

If there is *no* internal_header in the dict, remove it from the dict? This doesn't make any sense.

So we need to know when the internal_header is present and what is the complete behavior. The previous code never entered the if body (or it would have broke), so it seems the internal_header was always present in the dict with a non-False value. We need to know if we can assume the internal_header is always there.

Revision history for this message
Naresh(OpenERP) (nch-openerp) wrote :

Hello Thu,

Yes, the localcontext dict will always have the key 'internal_header' present with value True / False
depending on the report's parser 'header' argument. if you specify header = 'internal' or 'internal landscape' the key will have value as True else False. If its true You will see a different header format on the final output.
for eg:
report_sxw.report_sxw('report.account.aged_trial_balance', 'res.partner',
        'addons/account/report/account_aged_partner_balance.rml',parser=aged_trial_report, header="internal landscape")

The previous code do enters *IF* body if you print something there you will see the output(but only when you shut your server down dont know why:(

Thanks

Unmerged revisions

3433. By Christophe Simonis (OpenERP)

[FIX] report: correct context cleaning when render RML

3432. By Christophe Simonis (OpenERP)

[FIX] report: pass context when render RML

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.