Skip to content
  • Categories
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • 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

  • Default (Flatly)
  • No Skin
Collapse

Odoo 中文社区

  1. Home
  2. Categories
  3. Odoo 开发与实施交流
  4. Relatorio openoffice 如何显示图片?

Relatorio openoffice 如何显示图片?

Scheduled Pinned Locked Moved Odoo 开发与实施交流
5 Posts 2 Posters 6.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • L Offline
    L Offline
    linyaohui
    wrote on last edited by
    #1

    按照文档的里的方法http://relatorio.openhex.org/wiki/IndepthIntroduction
    通过frame 添加数据库图片字段后,点击报表按钮会提示出错
    "str can not use seek()

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrshelly
      wrote on last edited by
      #2

      注意用二进制方式 打开文件. 'rb'

      1 Reply Last reply
      0
      • L Offline
        L Offline
        linyaohui
        wrote on last edited by
        #3

        望谢兄详细指导一下,要用二进制打开那个文件呢?
        附件是本人的一个简单demo,想要显示产品的图片(product.picture)

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mrshelly
          wrote on last edited by
          #4

          product.picture  是以 base64 编码的一个字串.  而 relatorio report 期望 的是 一个二进制字节流..

          看你模块里面没有关于 product.picture 的转换处理.
          所以, 你只需要在 .py 文件中, 加入对 product.picture 字段 的一个 base64 --> binary bytes stream就OK了.

          具体的你搜索一下 BBS 里, 有关于在报表中使用图片的例子... 而且官方addons 里也有相关的代码. 

          1 Reply Last reply
          0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Tags
          • Popular
          • Users
          • Groups