summaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorqdp-launchpad@tinyerp.com <>2010-11-25 11:13:35 +0100
committerqdp-launchpad@tinyerp.com <>2010-11-25 11:13:35 +0100
commit1965f8ba3ed4c6dcbf2a6fd2c8b2ce0de08c6876 (patch)
treee7c123d2c4e1644164b1d8195412fb263493aa29 /bin
parent219edf4cab34b5be7cf5640ca529062910c677e6 (diff)
parentf1817dae8d101ac907891b5b9f582a686c4179b7 (diff)
[MERGE] merged the apa server branch
bzr revid: qdp-launchpad@tinyerp.com-20101125101335-2f5gyrmaxmowicw0
Diffstat (limited to 'bin')
-rw-r--r--bin/addons/base/res/res_company.py12
-rw-r--r--bin/report/render/rml2pdf/trml2pdf.py2
-rw-r--r--bin/report/report_sxw.py9
3 files changed, 16 insertions, 7 deletions
diff --git a/bin/addons/base/res/res_company.py b/bin/addons/base/res/res_company.py
index 09f448d0e8b..098d8b9b50e 100644
--- a/bin/addons/base/res/res_company.py
+++ b/bin/addons/base/res/res_company.py
@@ -203,7 +203,7 @@ class res_company(osv.osv):
return """
<header>
<pageTemplate>
- <frame id="first" x1="28.0" y1="57.0" width="772" height="481"/>
+ <frame id="first" x1="28.0" y1="28.0" width="786" height="525"/>
<pageGraphics>
<fill color="black"/>
<stroke color="black"/>
@@ -212,7 +212,7 @@ class res_company(osv.osv):
<setFont name="DejaVu Sans Bold" size="10"/>
<drawString x="382" y="555">[[ company.partner_id.name ]]</drawString>
<stroke color="#000000"/>
- <lines>25 550 808 550</lines>
+ <lines>25 550 818 550</lines>
</pageGraphics>
</pageTemplate>
</header>"""
@@ -220,16 +220,16 @@ class res_company(osv.osv):
return """
<header>
<pageTemplate>
- <frame id="first" x1="1.3cm" y1="1.5cm" width="18.4cm" height="26.5cm"/>
+ <frame id="first" x1="28.0" y1="28.0" width="539" height="772"/>
<pageGraphics>
<fill color="black"/>
<stroke color="black"/>
<setFont name="DejaVu Sans" size="8"/>
- <drawString x="1.3cm" y="28.3cm"> [[ formatLang(time.strftime("%Y-%m-%d"), date=True) ]] [[ time.strftime("%H:%M") ]]</drawString>
+ <drawString x="1.0cm" y="28.3cm"> [[ formatLang(time.strftime("%Y-%m-%d"), date=True) ]] [[ time.strftime("%H:%M") ]]</drawString>
<setFont name="DejaVu Sans Bold" size="10"/>
- <drawString x="9.8cm" y="28.3cm">[[ company.partner_id.name ]]</drawString>
+ <drawString x="9.3cm" y="28.3cm">[[ company.partner_id.name ]]</drawString>
<stroke color="#000000"/>
- <lines>1.3cm 28.1cm 20cm 28.1cm</lines>
+ <lines>1.0cm 28.1cm 20.1cm 28.1cm</lines>
</pageGraphics>
</pageTemplate>
</header>"""
diff --git a/bin/report/render/rml2pdf/trml2pdf.py b/bin/report/render/rml2pdf/trml2pdf.py
index e9969fa4e52..d221892ec99 100644
--- a/bin/report/render/rml2pdf/trml2pdf.py
+++ b/bin/report/render/rml2pdf/trml2pdf.py
@@ -68,7 +68,7 @@ class NumberedCanvas(canvas.Canvas):
while not self.pages.get(key,False):
key = key + 1
self.setFont("Helvetica", 8)
- self.drawRightString((self._pagesize[0]-35), (self._pagesize[1]-43),
+ self.drawRightString((self._pagesize[0]-30), (self._pagesize[1]-40),
"Page %(this)i of %(total)i" % {
'this': self._pageNumber+1,
'total': self.pages.get(key,False),
diff --git a/bin/report/report_sxw.py b/bin/report/report_sxw.py
index fe34b67dc4c..b3f5e66e995 100644
--- a/bin/report/report_sxw.py
+++ b/bin/report/report_sxw.py
@@ -164,6 +164,7 @@ class rml_parse(object):
'lang' : user.company_id.partner_id.lang,
'translate' : self._translate,
'setHtmlImage' : self.set_html_image,
+ 'strip_name' : self._strip_name,
'time' : time
}
self.localcontext.update(context)
@@ -184,6 +185,14 @@ class rml_parse(object):
def setTag(self, oldtag, newtag, attrs=None):
return newtag, attrs
+ def _ellipsis(self, char, size=100, truncation_str='...'):
+ if len(char) <= size:
+ return char
+ return char[:size-len(truncation_str)] + truncation_str
+
+ def _strip_name(self, name, maxlen=50):
+ return self._ellipsis(name, maxlen)
+
def format(self, text, oldtag=None):
return text.strip()