[英]how to implement third party JS library in Odoo
嗨,我想在 odoo pos 中实现这个二维码生成器,但我不知道怎么做,即使在odoo 12 中的 Javascript 参考中我也看不到任何教程
我想生成一个带有收据参考(this.uid)的二维码作为输出(扫描时)并将其显示在 PosTicket
我尝试在我的 static/src/js 文件夹中添加 qrcode.min.js 和 qrcode.js 并添加
<script src="/tw_pos_inherit/static/src/js/qrcode.min.js" type="text/javascript"></script>
<script src="/tw_pos_inherit/static/src/js/qrcode.js" type="text/javascript"></script>
在我看来并尝试了上述示例,但它总是给我一个错误
任何知道如何在odoo12中使用第三方javascript库的人请给我一个例子
谢谢你
好的,所以我只需要在我的 static/src/js 文件夹中移动 js 和 min.js 文件并添加代码
<script src="/tw_pos_inherit/static/src/js/qrcode.js" type="text/javascript"></script>
<script src="/tw_pos_inherit/static/src/js/qrcode.min.js" type="text/javascript"></script>
到我的资产文件和
我再次尝试了这些例子
this.qrcode = new QRCode('qrcode');
this.qrcode.makeCode(this.pos.get_order().uid);
到我initialized
的 function 并且它工作正常
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.