Navigation

    Odoo 中文社区

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • Popular
    • Users
    • Groups

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

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

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

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

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

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

    Odoo 新手求助
    2
    6
    3128
    Loading More Posts
    • 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.
    • J
      jundi1000 last edited by

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

      1 Reply Last reply Reply Quote 0
      • Joshua
        Joshua 管理员 last edited by

        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)]] ```
        1 Reply Last reply Reply Quote 0
        • J
          jundi1000 last edited by

          [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 Reply Last reply Reply Quote 0
          • Joshua
            Joshua 管理员 last edited by

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

            [[formatLang(time.strftime(&#039;%Y-%m-%d %H:%M:%S&#039;), date_time=True)]]
            
            1 Reply Last reply Reply Quote 0
            • J
              jundi1000 last edited by

              [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 Reply Last reply Reply Quote 0
              • First post
                Last post