跳转至内容
  • 版块
  • 标签
  • 热门
  • 用户
  • 群组
皮肤
  • 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. 关于 statusbar_colors 的问题

关于 statusbar_colors 的问题

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

    现在,在windows的绿色版,以及linux的git安装版中 statusbar_colors这个属性是否已经失效了?
    以下代码已经在view中设置了statusbar_colors属性,但是结果在浏览器中并不生效

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

      浏览了一下 代码

      8。0 里面 确实 没有了对 statusbar_colors 属性的处理

      7.0 的代码:

      &nbsp; &nbsp; render_value: function() {<br />&nbsp; &nbsp; &nbsp; &nbsp; var self = this;<br />&nbsp; &nbsp; &nbsp; &nbsp; var content = QWeb.render(&quot;FieldStatus.content&quot;, {widget: self});<br />&nbsp; &nbsp; &nbsp; &nbsp; self.$el.html(content);<br />&nbsp; &nbsp; &nbsp; &nbsp; var colors = JSON.parse((self.node.attrs || {}).statusbar_colors || &quot;{}&quot;);<br />&nbsp; &nbsp; &nbsp; &nbsp; var color = colors[self.get(&#039;value&#039;)];<br />&nbsp; &nbsp; &nbsp; &nbsp; if (color) {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; self.$(&quot;oe_active&quot;).css(&quot;color&quot;, color);<br />&nbsp; &nbsp; &nbsp; &nbsp; }<br />&nbsp; &nbsp; },<br />&nbsp; &nbsp; 
      


         
         
         
      8.0 的对应代码
         

      &nbsp; &nbsp; render_value: function() {<br />&nbsp; &nbsp; &nbsp; &nbsp; var self = this;<br />&nbsp; &nbsp; &nbsp; &nbsp; var content = QWeb.render(&quot;FieldStatus.content&quot;, {<br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;widget&#039;: self, <br />&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#039;value_folded&#039;: _.find(self.selection.folded, function(i){return i[0] === self.get(&#039;value&#039;);})<br />&nbsp; &nbsp; &nbsp; &nbsp; });<br />&nbsp; &nbsp; &nbsp; &nbsp; self.$el.html(content);<br />&nbsp; &nbsp; },&nbsp; &nbsp; 
      
      1 条回复 最后回复
      0
      • D 离线
        D 离线
        dwz35296
        写于 最后由 编辑
        #3

        难怪我搞了半天,都不显示颜色啦。 😢
        不知道能不能重新打开这个功能?
        把7.0的代码拷贝到8.0会出现错误

        1 条回复 最后回复
        0
        • C 离线
          C 离线
          ccdos
          写于 最后由 编辑
          #4

          我尝试了, 没出错, 但是 也没效果。

          估计 还要修改一下 css

          1 条回复 最后回复
          0

          • 登录

          • 没有帐号? 注册

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