跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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 中文社区

  1. 主页
  2. 版块
  3. Odoo 开发与实施交流
  4. 请教,t-foreach 遍历{'name':'lilei','name':'hanmeimei'}如何实现?

请教,t-foreach 遍历{'name':'lilei','name':'hanmeimei'}如何实现?

已定时 已固定 已锁定 已移动 Odoo 开发与实施交流
5 帖子 3 发布者 2.0k 浏览
  • 从旧到新
  • 从新到旧
  • 最多赞同
登录后回复
此主题已被删除。只有拥有主题管理权限的用户可以查看。
  • L 离线
    L 离线
    lipeng260
    写于 最后由 编辑
    #1

    如题,向模板中传递的是一个字典,请教如何实现?

    1 条回复 最后回复
    0
    • KevinKongK 离线
      KevinKongK 离线
      KevinKong
      写于 最后由 编辑
      #2

      字典怎么遍历?你为啥不传list?

      1 条回复 最后回复
      0
      • wjfonhandW 离线
        wjfonhandW 离线
        wjfonhand
        写于 最后由 编辑
        #3

        {'name':'lilei','name':'hanmeimei'}.keys()

        GoodERP -- Odoo China fork

        1 条回复 最后回复
        0
        • L 离线
          L 离线
          lipeng260
          写于 最后由 编辑
          #4
          &lt;t t-foreach=&quot;get_bid_line()&quot; t-as=&quot;line_id&quot;&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;div&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;t t-esc=&quot;get_bid_line_obj(line_id).name&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;t t-esc=&quot;get_bid_line_obj(line_id).num&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;t t-esc=&quot;get_bid_line_obj(line_id).take_date&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;t t-esc=&quot;get_bid_line_obj(line_id).unit&quot;/&gt;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;/div&gt;
          


          改成这样实现了,官网上的$as_index,$as_size,$as_first还不知道如何使用。

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

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