Odoo Help


error: Some modules could not be started

on 8/24/16, 10:56 AM 460 views

trying to add my custom markdown editor in odoo9 for text area.

Below is the code for widget_text_markdown.js::

odoo.define('web_widget_text_markdown',function (require) {

var core = require('web.core');

var formats = require('web.formats');

var common = require('web.form_common');

var _lt = oe.web._lt;

//oe.web.form.widgets.add('bootstrap_markdown', 'openerp.web_widget_text_markdown.FieldTextMarkDown');

var FieldTextMarkDown = common.AbstractField.extend(common.ReinitializeFieldMixin, {

template: "FieldMarkDown",

display_name: _lt('MarkDown'),

internal_format: 'field_text',

widget_class: 'oe_form_field_bootstrap_markdown',

events: {

'change input': 'store_dom_value' ,


init: function (field_manager, node) {

this._super(field_manager, node);

this.$txt = false;



parse_value: function(val, def) {

return formats.parse_value(val, {"widget": this.internal_format}, def);


initialize_content: function () {

// Gets called at each redraw of widget

// - switching between read-only mode and edit mode

// - BUT NOT when switching to next object.

if(!this.get("effective_readonly")) {





store_dom_value: function () {

if (!this.get('effective_readonly')) {






commit_value: function () {


return this._super();


_get_raw_value: function() {

if (this.$txt === false)

return '';

return this.$txt.val();


render_value: function () {

// Gets called at each redraw/save of widget

// - switching between read-only mode and edit mode

// - when switching to next object.

var show_value = this.format_value(this.get('value'), '');

if (!this.get("effective_readonly")) {

this.$input = this.$el.find('input');


} else {

// avoids loading markitup...


highlight: function (code) {

return hljs.highlightAuto(code).value;






format_value: function (val, def) {

return formats.format_value(val, {"widget": this.internal_format}, def);



core.form_widget_registry.add('bootstrap_markdown', FieldTextMarkDown);

return {

FieldTextMarkDown: FieldTextMarkDown,



After adding this widget to my field it is showing js error that module failed loading 

Geetha, try to debug it from console using "Inspect Element" of your browser and check for the error, that would help you to find out the exact error in your js code..

on 8/25/16, 4:33 AM

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This platform is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.


Odoo Training Center

Access to our E-learning platform and experience all Odoo Apps through learning videos, exercises and Quizz.

Test it now

Question tools

3 follower(s)


Asked: 8/24/16, 10:56 AM
Seen: 460 times
Last updated: 8/24/16, 12:42 PM