跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • 默认(Flatly)
  • 不使用皮肤
折叠

Odoo 中文社区

J

joe_shenzhen

@joe_shenzhen
关于
帖子
1
主题
0
群组
0
粉丝
0
关注
0

帖子

最新 最佳 有争议的

  • 基于Lodop的报表打印模块
    J joe_shenzhen

    首先,非常感谢 LZ 的 分享大作。 刚好在弄打印这块,而且还真的是要用lodop来做这个。 所以受益匪浅。
    然后,这里有个问题,想跟LZ请教下,

    在使用以下我的sample.mako模板代码时,发现maktohtml2html.py文件中的 方法 format_body中,有一个问题。

    body[:-1]得到是一个空的list, 因为 body = html.findall("body"), 对于一个Html文件来说, <body>标签只有1个。 所以这个我觉得是个问题,不知道LZ是什么解决的? 我一个小打算,是直接提bug,修改openerp的源码来搞定这件事情。 不知道还有其他的方法没有?

    openerp 的源码部分:

        def format_body(self, html):
            body = html.findall('body')
            body_list = []
            footer =  self.format_footer(body[-1].getchildren())
            for b in body[:-1]:
                body_list.append(etree.tostring(b).replace('\t', '').replace('\n',''))


    mako文件的代码。(文件名不是html,在openerp报告中没有问题。)
    <html>
    <head>
    <title>test mako template</title>
    </head>
    <body>

    <table>
    order_number: 12345
    </table>

    <footer>
    </footer>
    </body>
    </html>

  • 登录

  • 没有帐号? 注册

  • 登录或注册以进行搜索。
  • 第一个帖子
    最后一个帖子
0
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组