[FIX] Report: insert formatLang in the rendering environment if not present; Sale_layout: use formatLang on the subtotal

bzr revid: sle@openerp.com-20140404121128-puvr1zs244lit5m2
This commit is contained in:
Simon Lejeune 2014-04-04 14:11:28 +02:00
parent dc8246eb03
commit 91a78667ba
2 changed files with 14 additions and 3 deletions

View File

@ -23,6 +23,7 @@ from openerp.osv import osv
from openerp.tools import config
from openerp.tools.translate import _
from openerp.addons.web.http import request
from openerp.report.formatter import Formatter
import os
import time
@ -137,6 +138,16 @@ class Report(osv.Model):
website = None
if request and hasattr(request, 'website'):
website = request.website
# formatLang method
if not values.get('formatLang'):
formatter = Formatter(cr, uid, self.pool, lang=user.lang)
values.update({
'formatLang': formatter.formatLang,
'digits_fmt': formatter.digits_fmt,
'get_digits': formatter.get_digits,
})
values.update({
'time': time,
'render_doc': render_doc,

View File

@ -5,7 +5,7 @@
<!-- Category name -->
<t t-if="p['category']">
<tr>
<td colspan="100" class="active" style="font-weight: bold; padding-left: 10px; border-bottom: 1px solid black;">
<td colspan="100" class="active" style="font-weight: bold; border-bottom: 1px solid black;">&gt;
<t t-if="p['category'].name">
<t t-esc="p['category'].name"></t>
</t>
@ -22,7 +22,7 @@
<tr class="text-right">
<td colspan="100">
<strong>Subtotal: </strong>
<t t-esc="p['subtotal']"></t>
<t t-esc="formatLang(p['subtotal'], digits=get_digits(dp='Account'), currency_obj=res_company.currency_id)"></t>
</td>
</tr>
</t>
@ -31,7 +31,7 @@
<!-- Separator -->
<t t-if="'separator' in p['category'] and p['category'].separator is True">
<tr class="text-center">
<td colspan="100" class="active">
<td colspan="100">
***
</td>
</tr>