[MERGE] merged the apa server branch

bzr revid: qdp-launchpad@tinyerp.com-20101125101335-2f5gyrmaxmowicw0
This commit is contained in:
qdp-launchpad@tinyerp.com
2010-11-25 11:13:35 +01:00
3 changed files with 16 additions and 7 deletions
+6 -6
View File
@@ -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>"""
+1 -1
View File
@@ -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),
+9
View File
@@ -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()