Odoo中文社区可以通过以下三个域名访问:shine-it.net , odoocn.org,odoo.net.cn

原论坛用户的基本信息和发帖这里都予以保留,请注意:原论坛用户无需重新注册新用户,但是您的密码需要重置

开发人员可以登录gitter讨论组: http://gitter.im/odoo-china/Talk, 需要github账号

如果您登录系统碰到问题,请在微信公众号留言:

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



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



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



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



  • &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还不知道如何使用。