bzr revid: nch@tinyerp.com-20090629061710-ab6oydkwswc6d8mh
This commit is contained in:
Naresh Choksy
2009-06-29 11:47:10 +05:30
5 changed files with 23 additions and 4 deletions
+15 -3
View File
@@ -653,9 +653,21 @@ class orm_template(object):
if warning:
cr.rollback()
return (-1, res, warning, '')
id = self.pool.get('ir.model.data')._update(cr, uid, self._name,
current_module, res, xml_id=data_id, mode=mode,
noupdate=noupdate)
try:
id = self.pool.get('ir.model.data')._update(cr, uid, self._name,
current_module, res, xml_id=data_id, mode=mode,
noupdate=noupdate)
except Exception, e:
import psycopg2
if isinstance(e,psycopg2.IntegrityError):
msg= 'Insertion Failed!'
for key in self.pool._sql_error.keys():
if key in e[0]:
msg = self.pool._sql_error[key]
break
return (-1, res,msg,'' )
for lang in translate:
context2 = context.copy()
context2['lang'] = lang
+1
View File
@@ -554,6 +554,7 @@ class report_custom(report_int):
abscissa.update(fields_bar[idx])
idx0 += 1
abscissa = map(lambda x : [x, None], abscissa)
abscissa.sort()
ar.x_coord = category_coord.T(abscissa,0)
ar.draw(can)
+3
View File
@@ -236,16 +236,19 @@ class _rml_canvas(object):
def _drawString(self, node):
v = utils.attr_get(node, ['x','y'])
text=self._textual(node, **v)
text = utils.xml2str(text)
self.canvas.drawString(text=text, **v)
def _drawCenteredString(self, node):
v = utils.attr_get(node, ['x','y'])
text=self._textual(node, **v)
text = utils.xml2str(text)
self.canvas.drawCentredString(text=text, **v)
def _drawRightString(self, node):
v = utils.attr_get(node, ['x','y'])
text=self._textual(node, **v)
text = utils.xml2str(text)
self.canvas.drawRightString(text=text, **v)
def _rect(self, node):
+3
View File
@@ -47,6 +47,9 @@ _regex = re.compile('\[\[(.+?)\]\]')
def str2xml(s):
return s.replace('&', '&amp;').replace('<', '&lt;').replace('>', '&gt;')
def xml2str(s):
return s.replace('&amp;','&').replace('&lt;','<').replace('&gt;','>')
def _child_get(node, self=None, tagname=None):
for n in node:
if self and self.localcontext and n.get('rml_loop', False):
+1 -1
View File
@@ -305,7 +305,7 @@ class rml_parse(object):
head_dom = etree.XML(rml_head)
for tag in head_dom.getchildren():
found = rml_dom.find('.//'+tag.tag)
if found:
if len(found):
if tag.get('position'):
found.append(tag)
else :