+15
-3
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
|
||||
@@ -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):
|
||||
|
||||
@@ -47,6 +47,9 @@ _regex = re.compile('\[\[(.+?)\]\]')
|
||||
def str2xml(s):
|
||||
return s.replace('&', '&').replace('<', '<').replace('>', '>')
|
||||
|
||||
def xml2str(s):
|
||||
return s.replace('&','&').replace('<','<').replace('>','>')
|
||||
|
||||
def _child_get(node, self=None, tagname=None):
|
||||
for n in node:
|
||||
if self and self.localcontext and n.get('rml_loop', False):
|
||||
|
||||
@@ -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 :
|
||||
|
||||
Reference in New Issue
Block a user