[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:
Simon Lejeune 2014-03-24 18:46:30 +01:00
parent abce91a8c1
commit b6f6f8614a
2 changed files with 4 additions and 3 deletions

View File

@ -215,7 +215,8 @@ class Report(osv.Model):
'get_digits': self._get_digits,
'render_doc': render_doc,
'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)

View File

@ -3,7 +3,7 @@
<data>
<template id="editor_head" inherit_id="report.html_container" name="Editor" groups="base.group_website_publisher">
<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>
</xpath>
@ -72,7 +72,7 @@
</xpath>
<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) &gt; 1 or editable)">
<li t-foreach="languages" t-as="lg">
<a t-att-href="url_for('', lang=lg[0]) + '?' + keep_query()"