转:odoo8.0条形码改为js方式处理

群里网友@上海-gavin 提供的odoo条形码处理,将原来的图片生成方式改为js处理方式。

为了方便各位复制,如下特将图片文字输出一遍。

 

[html] view plain copy
 
 在CODE上查看代码片派生到我的代码片
  1. <div class="row text-center">  
  2.     <div class="col-xs-10 pull-right" style="padding:0px -14px;">  
  3.         <!-- <img t-att-src="'/report/barcode/?type=%s&value=%s&width=%s&height=%s' % ('Code128',o.name,390,60)"/> -->  
  4.         <div t-att-id="'barcode_%s' % (o.id)" style="margin-left:-20px;"></div>  
  5.         <script type="text/javascript">  
  6.             $(function(){  
  7.                 $("#barcode_<t t-esc="o.id"/>").barcode('<t t-esc="o.name"/>',"code128",{barWidth:"2",barHeight:"50",fontSize:"16"});  
  8.             });  
  9.         </script>  
  10.     </div>  
  11.     <!--<div class="col-xs-2 pull-left">  
  12.         <div t-field="o.sequence" style="font-size:35px;padding:5px;border:1px solid #000;width:60px;height:60px;"></div>  
  13.     </div> -->  
  14. </div>  
posted @ 2016-03-10 14:26  老醋蛰头  阅读(100)  评论(0)    收藏  举报