Odoo Help

Welcome!

This community 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.

0

Catch any anchor click event in sales order form in openerp (odoo) 8

By
manuthalasseril
on 6/7/15, 7:07 AM 677 views

I want to get the anchor click event in sales order form in openerp I tried these


   

openerp.website_sale_extended = function(instance){

console.log('My module has been initialized'); //worked

var module = instance.website_sale_extended || {};

//-not working module.CustomWidget = instance.web.form.FieldChar.extend({

//-not working module.CustomWidget = instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin, {

module.CustomWidget = instance.web.Widget.extend({ //not working

events: {

'click a': 'rename_file',

'change input': function (e) {

console.log('changed');

}

},

rename_file : function () {

console.log('clicked');

/*var $anchor = $(this);

var data-field = $anchor.parent().attr('data-field');

console.log(data-field);

if(data-field == 'attachment'){

var html = $anchor.parent().parent().find(':td[data-field="answer_id"]').html();

console.log(html);

$anchor.attr('download',html);

}

*/

},

});

};


Not working with

instance.web.form.FieldChar.extend(

instance.web.form.FormWidget.extend(instance.web.form.ReinitializeWidgetMixin, {

instance.web.Widget.extend(

So how can we bind a anchor click event in openerp (odoo ) 8 via javascript.

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 community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 6/7/15, 7:07 AM
Seen: 677 times
Last updated: 6/7/15, 7:07 AM