Elico Corp
  • 中文
  • English
  • Home
  • About Us
    • About Us
    • Our competencies
    • Customer References
    • Our staff
  • Our Services
    • OpenTrading Package
    • OpenERP Project
    • OpenERP Support
    • OpenERP Hosting
    • OpenERP Training
  • OpenERP
    • Discover OpenERP
    • OpenERP Features
    • Official Documentation
    • Chinese Documentation
    • Beginner’s Help
    • Download OpenERP
    • FAQ
  • SaaS
    • SaaS eBoutique
    • SaaS Pricelist
    • FAQ about SaaS
    • SaaS Terms of Services
  • Training
    • Functional training
    • Technical training
    • Certification
    • Course Schedule and prices
    • Tailor-made training
    • Quality of service
  • Blog
  • Contact Us

 New WYSIWYG modules in OpenERP 6.1

Elico Corp has developed 2 new modules for OpenERP 6.1 that allows you to include WYSIWYG capabilities in all your forms.

This new functionality is based on 2 separate modules:
- web_display: This module provides a new widget to display HTML tags in the forms.
You need to add in your view’s field widget=”text_WYSIWYG” to see the result as HTML instead of text.

- web_html_wysiwyg: This module provides a WYSIWYG editor (based on CKeditor) that can be switched on any time in any OpenERP forms.
You need to add the following code in the views for which you want to turn the classic textareas into powerful WYSIWYG editors.

<a onclick=”javascript:toggle_ckeditor();” class=”wysiwyg_button wysiwyg_button_off oe_button”>WYSIWYG on</a>

Using both modules in combination in your views allows you to enable or disable the WYSIWYG editors anytime.

The first application where this feature could be used is in the wiki or the email modules in order to enhance the end-user experience.

You can grab the code at our launchpad address: https://code.launchpad.net/~openerp-community/openobject-addons/elico-6.1
and at http://apps.openerp.com

result
wysiwyg_off
wysiwyg_on

Enjoy!

23 Comments

  1. sananaz 347 days ago
    Reply

    Really cool feature. Thannks for contribute.

  2. Timothy 345 days ago
    Reply

    Awesome! thanks for this.

    I’m having some problems tho using it in a wizard. It doesnt seem to initialise. If I refresh the page, the function is called but the div it gets displayed in is hidden.

    Is there a better place to ask this question?

  3. Timothy 341 days ago
    Reply

    the version I downloaded didnt work correctly, but changing the js to:
    openerp.web.form.widgets.add(‘text_WYSIWYG’, ‘openerp.web_display_html.FieldWYSIWYGReadonly’); //instead of ‘openerp.web.form.FieldText’

    which worked – hope it helps someone.

  4. Fred 337 days ago
    Reply

    Hello

    I have a special case (in version 6.1), in which the text won’t be stored in the DB.

    - I open an invoice
    - I open an invoice line of this invoice
    - I switch the WYSIWYG-Editor on
    - I change the text (note)
    - I save the invoice line
    - I save the invoice

    The changed text was not stored. If I try this with keeping the WYSIWYG-Editor off, it works.

    I think the invoice don’t know, that the invoice line has changed (because the save button in the invoice form won’t be red after changing the text in the invoice line).

    Can you help me?

    thx

  5. Yannick Gouin 334 days ago
    Reply

    @Fred : Yeah we fixed this issue by modifying the.js, so you can download the new version in our launchpad. Otherwise you just need to switch the WYSIWYG off before clicking on save & close (or save & new).

    @Timothy : It works fine for several persons, so which version of openERP are you using, and for which views and fields you had to modify the js to fix it ?

  6. Fred 333 days ago
    Reply

    Hi Yannick

    Thanks a lot for your quick reply.

    But it’s still not working for me.

    I use a nightly build of the OpenERP server (openerp-6.1-20120617-233256) and the latest versions of the module web_wysiwyg (your fix is included, I checked it).

    It’s also not working, if I switch the WYSIWYG off before saving the invoice line.

    There is a strange behaviour:
    - I open an invoice
    - I open an invoice line
    - I switch the WYSIWYG on
    - I edit the text
    - I switch the WYSIWYG off (I can see the correct content in the textbox)
    - I click ‘save & close’
    - I think, the save button of the invoice should be red. But it isn’t.
    - If I reopen the invoice line (without saving the invoice before), my changes in the text are lost.

    Do you have an idea whats wrong? Which versions are you using?

    Thx

  7. Yannick 325 days ago
    Reply

    Hi,

    I tried your case on 6.1 and works fine for me. By the way, those buttons are never red.

    So could you check if your file “web_wysiwyg/static/src/js/web_wysiwyg.js” got a line like this =>
    $(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).unbind(‘click’, handler);

    • Fred 325 days ago
      Reply

      Hi,

      Yes this line is existing (Line 27).

      Is this good or bad?

  8. Salvatore Josué Trimarchi Pinto 307 days ago
    Reply

    Excelente!!!

  9. Fernando 260 days ago
    Reply

    Great addon! Thank you very much!

  10. Fred 257 days ago
    Reply

    Hello

    Does anyone have news on my problem?

    I have installed the nightly build openerp-6.1-20120830-233304 of the OpenERP-Server and the revision Rev 5 of the web_wysiwyg and web_display_html.

    I have still the following problem:
    - I change the Text (WYSIWYG is on) in the account.invoice.line, save the line and save the invoice. My changes are missing.

    Also setting the WYSIWYG to off before saving the line and the invoice will ignore my changes.

    Have anyone an idea?
    Or how can we proceed?
    Is there a possibility for debugging?

    Thanks a lot for quick reply.

  11. Loïc 233 days ago
    Reply

    @FRED

    Hello,

    I had the same problem and I resolve it with this change in file web_wysiwyg/static/src/js/web_wysiwyg.js :

    Line 27 :
    //$(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).unbind(‘click’, handler);
    $(‘button.oe_button, button.oe_formopenpopup-form-save’).unbind(‘click’, handler);

    Line 49 :
    //$(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).prependEvent(‘click’, handler);
    $(‘button.oe_button, button.oe_formopenpopup-form-save’).prependEvent(‘click’, handler);

    Line 70 :
    //$(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).unbind(‘click’, handler);
    $(‘button.oe_button, button.oe_formopenpopup-form-save’).unbind(‘click’, handler);

    I hope it can help you ;)

    • Fred 232 days ago
      Reply

      Hello Loïc

      It works also on my system.
      Thanks a lot for posting your bugfix.

      Bye

  12. Gabriel 206 days ago
    Reply

    Pressing the button I get this error:

    toggle_ckeditor is not defined

    Someone happened to him? is as if it were loaded web_wysiwyg.js

    • Yannick 204 days ago
      Reply

      Hi Gabriel,
      toggle_ckeditor() function is defined in ~/static/src/js/web_wysiwyg.js and should be loaded once the addon is installed.

      May be try to clear your web browser Cache (Ctrl+Shift+Del) and refresh the page to force the loading of javascript.

  13. Szolo 149 days ago
    Reply

    Dear Yannick,

    This a nice addon, but I have two problems.
    Both modules installed, button, widget added to the view, I use OpenERP 6.1.1 on Windows.
    1. The wysiwyg editor line not show up when I push the button (the button itself change from wysiwyg on to wysiwyg off)
    2. If I put html code to the product sales description, it works fine on the form page, but the html tags appear on the pdf of the sales orders.

    Any advice would be appreciated…

  14. Szolo 149 days ago
    Reply

    Sorry, in the meantime the wysiwyg started to loading.

    But if you would advice me in the 2. question, that would nice.

    Szolo

  15. Yannick 148 days ago
    Reply

    Hi Szolo,

    Could you pleease tell me which kind of report you use for the Sale order ?
    Webkit, RML, aeroo ?

  16. Szolo 148 days ago
    Reply

    Dear Yannick,

    RML with OpenOffice editing.
    Do you think, the case is different if I use something else?

    To have html formatted product descriptions is very important to us.

    Any suggestion is appreciated!

    • Eric Caudal 147 days ago
      Reply

      html tags will appear as is in RML.
      The Webkit report engine sould be able to interpret them properly.

  17. Etienne 124 days ago
    Reply

    Dear Eric,

    * Do you know how I link a image that was uploaded to the ERP server?

    * Is there any posibility to allow the CKeditor to be enabled for style such as Headings?

    Thanks

    Etienne

  18. Pierre 107 days ago
    Reply

    Nice extension, works great.

    Is it possible to start with wysiwyg_on = true.

    I would like to remove the switching button as my users are scared by the html tags they see when editing a record.

    Can you help me?

    • Pierre 107 days ago
      Reply

      I managed to get it.

      Here is the way I used:
      web_wysiwyg.js is now:

      var wysiwyg_on = false;

      // function which will save the content of the WYSIWYGs into the textareas
      var handler = function(){
      if(wysiwyg_on){
      $(‘textarea’).trigger(‘change’);

      // Here we transform all the WYSIWYG textareas into regular textareas
      $(‘textarea’).each(function(){
      try {
      $(this).ckeditorGet().updateElement();
      }
      catch(e) { }
      });

      // Remove onclick event on save button.
      $(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).unbind(‘click’, handler);

      wysiwyg_on = false;
      }else{
      return true;
      }
      }

      openerp.web_wysiwyg = function(openerp) {
      openerp.web.FormView.include({
      on_record_loaded: function(record) {
      // Here we transform all the regular textareas into WYSIWYG textareas
      $(‘textarea.field_text_WYSIWYG’).ckeditor({ toolbar : ‘Mine’ });

      // Add onclick event on save button.
      $(‘button.oe_form_button_save, button.oe_selectcreatepopup-form-save, button.oe_selectcreatepopup-form-save-new’).prependEvent(‘click’, handler);

      wysiwyg_on = true;
      return this._super(record)
      }
      });
      }

      Also no need to add the html button, of course.

      May be this can interest someone.

      Pierre

Leave a Reply

Click here to cancel reply.
  1. 使用新浪微博登陆

Archives

  • May 2013
  • April 2013
  • March 2013
  • February 2013
  • January 2013
  • December 2012
  • November 2012
  • October 2012
  • September 2012
  • August 2012
  • July 2012
  • June 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • December 2011
  • November 2011
  • October 2011
  • September 2011

Recent Posts

  • Webinar – OpenERP / Magento, a seamless integration
  • OpenERP 7.0 Tour – Asia (Hong-Kong)
  • Webinar – Integrate OpenERP with Magento in few clicks
  • OpenERP for the largest hazardous waste treatment plant in China.
  • Elico Corp, first Silver Partner in China and expands business to Hong-Kong

Follow Us!

Follow Us on  TwitterFollow Us on  LinkedInFollow Us on  SkypeFollow Us on  WeiboFollow Us on  RSSFollow Us on  E-mail

  • Download OpenERP
  • Official Documentation
  • Beginner’s Help
  • Course Schedule and prices
  • SaaS Terms of Services
  • FAQ about SaaS
  • FAQ about OpenERP
  • SaaS Pricelist

About this site

This website is a corporate website dedicated to Elico Corporation, OpenERP specialists in Opensource business application implementations, located in Shanghai, China.

Follow Us!

Follow Us on  TwitterFollow Us on  LinkedInFollow Us on  SkypeFollow Us on  WeiboFollow Us on  RSSFollow Us on  E-mail

Tags

6.1 accounting administrator agile methodoly Application Service Provider Business Business-to-Business Cloud computing community days CRM currency danone Data center Demonstration developer download E-Commerce English language Enterprise resource planning ERP excel faq features Functional implementation invoice job job offer Linux logo mako module move nightly build Office Automation openerp OpenSource payment PostgreSQL project manager Python Q&A release release notes saas sap SITA small and mid-sized business SMB Software as a service start-up System administrator themis trunk Tutorial waste plant web client 教程 职位 项目经理

    沪ICP备12005091号. 2048 Bit SSL Certificate

© All Right Reserved. 2010-Today. Elico Corporation. OpenERP Consuting Solutions.
  • Terms of Service
  • Privacy Policy