Add a picture to the OpenERP compose message

Source: Internet
Author: User

Write to:

CONTROLS:   // controls to add to the toolbar                            "" +                            "  " +                            "" +                            "| AlignLeft Center AlignRight Justify | Undo Redo",

OpenERP's compose message, in the text input box, has set the text font, sets the alignment and so on many functions, like writes this Sina blog, can enter the rich text information. The drawback is that it cannot insert pictures.

How can we get openerp to insert a picture when composing a message? The method is simple. Because the rich text editor used by OpenERP is cleditor. The Cleditor toolbar already has the ability to insert images, as long as they are set on initialization.

In OpenERP, the code for initializing the Cleditor is in the Addonswebstaticsrcjsview_form.js file, around 2739 lines:

initialize_content:function () {... $textarea. cleditor ({width:width,Width notincluding margins, bordersorpadding Height:height,Height notincluding margins, bordersorpadding Controls://controls to add to the toolbar"Bold Italic underline strikethrough"+"| removeformat | bullets Numbering | outdent"+"Indent | link Unlink | source",

We just need to add an image to the source before the line. As shown below:

initialize_content:function () {... $textarea. cleditor ({width:width,Width notincluding margins, bordersorpadding Height:height,Height notincluding margins, bordersorpadding Controls://controls to add to the toolbar"Bold Italic underline strikethrough"+"| removeformat | bullets Numbering | outdent"+"Indent | link Unlink | Image source",

The following example shows more buttons on the toolbar of the text editor:

CONTROLS:     // controls to add to the toolbar          "" +          "  " +          "" +          "rule image Link Unlink | Cut Copy Paste Pastetext | Print source",

Add a picture to the OpenERP compose message

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.