Odoo 中文社区

    • 注册
    • 登录
    • 搜索
    • 版块
    • 标签
    • 热门
    • 用户
    • 群组

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

    由于系统升迁的原因,本论坛部分较早期的内容存在格式和链接损坏失效的问题,并非本论坛系统本身的缺陷,望谅解

    本社区没有维护任何QQ群讨论组,任何与本社区同名的QQ群讨论组的言论与本社区无关!

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

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

    Rml报表打印出来的时间慢了8小时

    Odoo 新手求助
    2
    6
    3386
    正在加载更多帖子
    • 从旧到新
    • 从新到旧
    • 最多赞同
    回复
    • 在新帖中回复
    登录后回复
    此主题已被删除。只有拥有主题管理权限的用户可以查看。
    • J
      jundi1000 最后由 编辑

      rml里[[time.strftime('%d-%m-%Y %H:%M:%S')]]
      显示的时间慢了8个小时,有什么方法可以解决这个问题呢?
      openerp是装在CentOS上的。

      1 条回复 最后回复 回复 引用 0
      • Joshua
        Joshua 管理员 最后由 编辑

        odoo已经帮我们想好办法了:
        report_sxw.py

        &nbsp; &nbsp; <br />def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Assuming &#039;Account&#039; decimal.precision=3:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value) -&gt; digits=2 (default)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, digits=4) -&gt; digits=4<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, dp=&#039;Account&#039;) -&gt; digits=3<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, digits=5, dp=&#039;Account&#039;) -&gt; digits=5<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />
        

        ``` [[formatLang(time.strftime('%d-%m-%Y %H:%M:%S'), date_time=True)]] ```

        【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

        1 条回复 最后回复 回复 引用 0
        • J
          jundi1000 最后由 编辑

          [quote author=Joshua link=topic=16398.msg28054#msg28054 date=1400664076]
          odoo已经帮我们想好办法了:
          report_sxw.py

          &nbsp; &nbsp; <br />def formatLang(self, value, digits=None, date=False, date_time=False, grouping=True, monetary=False, dp=False, currency_obj=False):<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; Assuming &#039;Account&#039; decimal.precision=3:<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value) -&gt; digits=2 (default)<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, digits=4) -&gt; digits=4<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, dp=&#039;Account&#039;) -&gt; digits=3<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; formatLang(value, digits=5, dp=&#039;Account&#039;) -&gt; digits=5<br />&nbsp; &nbsp; &nbsp; &nbsp; &quot;&quot;&quot;<br />
          

          ``` [[formatLang(time.strftime('%d-%m-%Y %H:%M:%S'), date_time=True)]] ```
          [/quote]

          我在把[[formatLang(time.strftime('%d-%m-%Y %H:%M:%S'), date_time=True)]]放在rml里怎么显示不出时间呢?
          1 条回复 最后回复 回复 引用 0
          • Joshua
            Joshua 管理员 最后由 编辑

            谢谢提醒,开始没有看清楚,formatLang只接受默认的日期时间格式 '%Y-%m-%d %H:%M:%S',然后再根据你的语言来输出对应的日期格式,所以应该是:

            [[formatLang(time.strftime(&#039;%Y-%m-%d %H:%M:%S&#039;), date_time=True)]]
            

            【上海先安科技】(joshua AT openerp.cn),欢迎关注公众号:openerp_cn

            1 条回复 最后回复 回复 引用 0
            • J
              jundi1000 最后由 编辑

              [quote author=Joshua link=topic=16398.msg28072#msg28072 date=1401086770]
              谢谢提醒,开始没有看清楚,formatLang只接受默认的日期时间格式 '%Y-%m-%d %H:%M:%S',然后再根据你的语言来输出对应的日期格式,所以应该是:

              [[formatLang(time.strftime(&#039;%Y-%m-%d %H:%M:%S&#039;), date_time=True)]]
              


              [/quote]

              好的,原来是格式的问题啊,现在问题解决了,谢谢啦。

              1 条回复 最后回复 回复 引用 0
              • First post
                Last post