[FIX] Added the decorator website on the get_file route, correctly pass the context on the mrp bom structure and allow to install report module without pypdf installed
bzr revid: sle@openerp.com-20140321122103-mzp465s8hxckq4ai
This commit is contained in:
parent
6b5986e34d
commit
1128743932
|
@ -34,7 +34,7 @@ class bom_structure(osv.AbstractModel):
|
|||
'docs': docs,
|
||||
'get_children': self.get_children,
|
||||
}
|
||||
return report_obj.render(cr, uid, [], 'mrp.report_mrpbomstructure', docargs)
|
||||
return report_obj.render(cr, uid, [], 'mrp.report_mrpbomstructure', docargs, context=context)
|
||||
|
||||
def get_children(self, object, level=0):
|
||||
result = []
|
||||
|
|
|
@ -89,7 +89,7 @@ class ReportController(Controller):
|
|||
|
||||
return request.make_response(barcode, headers=[('Content-Type', 'image/png')])
|
||||
|
||||
@route(['/report/download'], type='http', auth="user")
|
||||
@route(['/report/download'], type='http', auth="user", website=True)
|
||||
def report_download(self, data, token):
|
||||
"""This function is used by 'qwebactionmanager.js' in order to trigger the download of
|
||||
a pdf report.
|
||||
|
|
|
@ -36,7 +36,10 @@ import cStringIO
|
|||
import subprocess
|
||||
from datetime import datetime
|
||||
from distutils.version import LooseVersion
|
||||
from pyPdf import PdfFileWriter, PdfFileReader
|
||||
try:
|
||||
from pyPdf import PdfFileWriter, PdfFileReader
|
||||
except ImportError:
|
||||
PdfFileWriter = PdfFileReader = None
|
||||
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
|
|
@ -3,7 +3,6 @@
|
|||
<data>
|
||||
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
|
||||
<xpath expr="//html" position="attributes">
|
||||
<attribute name="style">padding-top: 51px;</attribute>
|
||||
<attribute name="t-att-data-website-id">website.id if editable else None</attribute>
|
||||
<attribute name="t-att-data-translatable">'1' if translatable else None</attribute>
|
||||
</xpath>
|
||||
|
|
Loading…
Reference in New Issue