Merge with trunk_old
bzr revid: ced-cc5076e909312caad8a03e83c0ebf2579af4e3b3
This commit is contained in:
parent
dd65cc47de
commit
e5de2aa0d5
|
@ -639,6 +639,7 @@ class orm(object):
|
||||||
try:
|
try:
|
||||||
self.create(cr, uid, res, context)
|
self.create(cr, uid, res, context)
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
|
print e
|
||||||
cr.rollback()
|
cr.rollback()
|
||||||
return (-1, res, e[0], warning)
|
return (-1, res, e[0], warning)
|
||||||
done += 1
|
done += 1
|
||||||
|
|
|
@ -254,12 +254,17 @@ class rml_parse(object):
|
||||||
def _add_header(self, node):
|
def _add_header(self, node):
|
||||||
rml_head = tools.file_open('custom/corporate_rml_header.rml').read()
|
rml_head = tools.file_open('custom/corporate_rml_header.rml').read()
|
||||||
head_dom = xml.dom.minidom.parseString(rml_head)
|
head_dom = xml.dom.minidom.parseString(rml_head)
|
||||||
|
for frame in head_dom.getElementsByTagName('frame'):
|
||||||
|
frame.parentNode.removeChild(frame)
|
||||||
node2 = head_dom.documentElement
|
node2 = head_dom.documentElement
|
||||||
for tag in node2.childNodes:
|
for tag in node2.childNodes:
|
||||||
if tag.nodeType==tag.ELEMENT_NODE:
|
if tag.nodeType==tag.ELEMENT_NODE:
|
||||||
found = self._find_node(node, tag.localName)
|
found = self._find_node(node, tag.localName)
|
||||||
|
rml_frames = found.getElementsByTagName('frame')
|
||||||
if found:
|
if found:
|
||||||
found.parentNode.replaceChild(tag, found)
|
found.parentNode.replaceChild(tag, found)
|
||||||
|
for frame in rml_frames:
|
||||||
|
tag.appendChild(frame)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
def preprocess(self, objects, data, ids):
|
def preprocess(self, objects, data, ids):
|
||||||
|
@ -298,9 +303,9 @@ class report_sxw(report_rml):
|
||||||
rml_dom = xml.dom.minidom.parseString(rml)
|
rml_dom = xml.dom.minidom.parseString(rml)
|
||||||
|
|
||||||
rml2 = rml_parser._parse(rml_dom, objs, data)
|
rml2 = rml_parser._parse(rml_dom, objs, data)
|
||||||
#f = file("/tmp/debug.rml", "w")
|
f = file("/tmp/debug.rml", "w")
|
||||||
#f.write(rml2)
|
f.write(rml2)
|
||||||
#f.close()
|
f.close()
|
||||||
report_type= data.get('report_type','pdf')
|
report_type= data.get('report_type','pdf')
|
||||||
create_doc = self.generators[report_type]
|
create_doc = self.generators[report_type]
|
||||||
pdf = create_doc(rml2)
|
pdf = create_doc(rml2)
|
||||||
|
|
|
@ -478,7 +478,7 @@ class BaseDocTemplate:
|
||||||
else:
|
else:
|
||||||
raise TypeError, "argument fx should be string or integer"
|
raise TypeError, "argument fx should be string or integer"
|
||||||
|
|
||||||
def handle_currentFrame(self,fx):
|
def handle_currentFrame(self, fx, resume=0):
|
||||||
'''chenge to the frame with name or index fx'''
|
'''chenge to the frame with name or index fx'''
|
||||||
if type(fx) is StringType:
|
if type(fx) is StringType:
|
||||||
for f in self.pageTemplate.frames:
|
for f in self.pageTemplate.frames:
|
||||||
|
|
Loading…
Reference in New Issue