在openerp撰写消息中增加图片
openerp的撰写消息中, 在文本输入框中, 具有设置文本字体,设置对齐方式 等多种功能, 就像像写这篇新浪blog一样, 可以输入富文本信息。 美中不足的是, 它不能插入图片。
我们如何才能让openerp在撰写消息时插入图片呢?方法很简单。 因为openerp使用的富文本编辑器是cleditor。 cleditor的工具条已经具备了插入图片的功能, 只要在初始化时设置上就行。
在openerp中, 初始化cleditor的代码在 addonswebstaticsrcjsview_form.js 文件中, 大约在2700行附近:
initialize_content: function() {
......
this.$textarea.cleditor({
width: width, // width not including margins, borders or padding
height: height, // height not including margins, borders or padding
controls: // controls to add to the toolbar
"bold italic underline strikethrough " +
"| removeformat | bullets numbering | outdent " +
"indent | link unlink | source",
我们只需在source前面加上 image 就行了。如下所示:
initialize_content: function() {
......
this.$textarea.cleditor({
width: width, // width not including margins, borders or padding
height: height, // height not including margins, borders or padding
controls: // controls to add to the toolbar
"bold italic underline strikethrough " +
"| removeformat | bullets numbering | outdent " +
"indent | link unlink | image source",
如下这个例子在文本编辑器的工具栏上 显示了更多的按钮:
controls: // controls to add to the toolbar
"bold italic underline strikethrough subscript superscript | font size " +
"style | color highlight removeformat | bullets numbering | outdent " +
"indent | alignleft center alignright justify | undo redo | " +
"rule image link unlink | cut copy paste pastetext | print source",
在openerp撰写消息中增加图片的更多相关文章
- OpenERP在product中增加外部网络链接图片
最近的一个项目要求在Product_Template中增加类似与HTML中<img src=”" />的形式的图片 product_img_extra.py from osv i ...
- 给DEDECMS广告管理中增加图片上传功能
dedecms的广告管理功能稍微有点次,本文就是在dedecms广告管理原有的基础上增加广告图片上传功能. 安装方法,对应自己的dedecms版本下载对应的编码然后解压把里面的文件放在后台目录覆盖即可 ...
- 【使用Itext处理PDF文档(新建PDF文件、修改PDF文件、PDF中插入图片、将PDF文件转换为图片)】
iText简介 iText是著名的开放源码的站点sourceforge一个项目,是用于生成PDF文档的一个java类库.通过iText不仅可以生成PDF或rtf的文档,而且可以将XML.Html文件转 ...
- TImage 显示 资源中 的图片、TResourceStream、资源文件
unit Unit5; interface uses Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System ...
- iOS开发小技巧--即时通讯项目:使用富文本在UILabel中显示图片和文字;使用富文本占位显示图片
Label借助富文本显示图片 1.即时通讯项目中语音消息UI的实现,样式如图: 借助富文本在UILabel中显示图片和文字 // 1.创建一个可变的富文本 NSMutableAttributedStr ...
- javascrit2.0完全参考手册(第二版) 第1章第1节 在XHTML文档中增加javascript
通常,向文档中增加script脚本使用<script>元素,在HTML中增加脚本的方式有4中: (1)放到<script></script>块中: (2)<s ...
- Android:WebView中对图片注册上下文菜单
前言 今天一朋友问我一个问题,就是如何在WebView控件中的图片增加上下文菜单,以便增加保存图片等功能.今天就给他简单做了一个演示Demo,现写下来,给有相同问题的朋友提供些许思路吧. 概要实现 其 ...
- Android EditText中插入图片并响应点击事件
EditText中插入图片基本就是两种方法: ,通过Html.fromHtml(..)来实现 [mw_shl_code=java,true]eText.append(Html.fromHtml(&qu ...
- asp.net gridview中增加单击单元格事件
实现功能:单击表格中某个单元格(不是第一列.最后一列.最后一行,不为0)根据行第一个单元格内容及列名来查询详细内容,在消息框中查看显示. 在代码中增加 protected override void ...
随机推荐
- mongodb 脚本操作
MO='mongo'$MO << EOFuse testdbdb.dropDatabase()show dbsexit;EOF
- js如何判断用户是在pc端和还是移动端访问
js如何判断用户是在pc端和还是移动端访问 来源:A5技术交流 作者:wofa 时间:2014-04-25收藏本页 最近一直在忙我们团队的项目“咖啡之翼”,在这个项目中,我们为移动平台提供了一个优秀的 ...
- [转]Hive安装及使用攻略
转 : http://blog.fens.me/hadoop-hive-intro/
- 在Visual Studio 2013里使用 Microsoft SQL Server Compact Edition
(1)下载SQLCE组件 https://www.microsoft.com/en-us/download/details.aspx?id=17876 (2)下载VS2013工具设计器 https:/ ...
- 【转】qt ,使用tcp/ip协议网络传输数据时,字节序转换方法
网络传输数据是需要保证字节序的正确,才能保证传输数据的准确,网络字节序一般是大端字节序.qt提供了以下两种方法来将本地字节序转换为网络字节序: 方法一,使用qt提供的字节序转换函数 T qFromBi ...
- vRealize Automation部署虚机如果出错怎么办?
以下地方的日志可以查看: 1. Requests –> Choose my request -> View Detail –> Execution Information. 2. I ...
- 命令行修改mysql密码和远程访问
http://jingyan.baidu.com/article/a3a3f8118cea488da2eb8a0a.html
- javascript——获取列表选择行的列值
表格布局 方法 代码 $("#send").click(function(){ //获取选择的行号 n= $('input:radio[name="radio" ...
- Eclipse QuickSear的插件的说明
https://spring.io/blog/2013/07/11/eclipse-quick-search Eclipse QuickSear的插件的说明
- String escape/unescape into XML
Is there any C# function which could be used to escape and un-escape a string, which could be used t ...