[FIX] Handle the case where website is installed but the pdf generation is not called in a website request context
bzr revid: sle@openerp.com-20140324174630-43wi6nlh6bigaq7g
This commit is contained in:
parent
abce91a8c1
commit
b6f6f8614a
|
@ -215,7 +215,8 @@ class Report(osv.Model):
|
||||||
'get_digits': self._get_digits,
|
'get_digits': self._get_digits,
|
||||||
'render_doc': render_doc,
|
'render_doc': render_doc,
|
||||||
'editable': True, # Will active inherit_branding
|
'editable': True, # Will active inherit_branding
|
||||||
'res_company': self.pool['res.users'].browse(cr, uid, uid).company_id
|
'res_company': self.pool['res.users'].browse(cr, uid, uid).company_id,
|
||||||
|
'website': False, # Will be overidden by ir.ui.view if the request has website enabled
|
||||||
})
|
})
|
||||||
|
|
||||||
return view_obj.render(cr, uid, template, values, context=context)
|
return view_obj.render(cr, uid, template, values, context=context)
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<data>
|
<data>
|
||||||
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
|
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
|
||||||
<xpath expr="//html" position="attributes">
|
<xpath expr="//html" position="attributes">
|
||||||
<attribute name="t-att-data-website-id">website.id if editable else None</attribute>
|
<attribute name="t-att-data-website-id">website.id if editable and website else None</attribute>
|
||||||
<attribute name="t-att-data-translatable">'1' if translatable else None</attribute>
|
<attribute name="t-att-data-translatable">'1' if translatable else None</attribute>
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
|
@ -72,7 +72,7 @@
|
||||||
</xpath>
|
</xpath>
|
||||||
|
|
||||||
<xpath expr='//body[@class="container"]/div[@id="wrapwrap"]' position="before">
|
<xpath expr='//body[@class="container"]/div[@id="wrapwrap"]' position="before">
|
||||||
<t t-set="languages" t-value="website.get_languages()"/>
|
<t t-set="languages" t-value="website.get_languages() if website else list()"/>
|
||||||
<ul class="list-inline js_language_selector mt16" t-if="(len(languages) > 1 or editable)">
|
<ul class="list-inline js_language_selector mt16" t-if="(len(languages) > 1 or editable)">
|
||||||
<li t-foreach="languages" t-as="lg">
|
<li t-foreach="languages" t-as="lg">
|
||||||
<a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"
|
<a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"
|
||||||
|
|
Loading…
Reference in New Issue