Community mailing list archives

community@mail.odoo.com

How to modify snippet?

by
hans.yonathan
- 02/09/2015 03:12:19

Hi Odoo Community,

 

I want to modify the existing snippet in Odoo,

For example in carousel snippet, the interval is 5000,

I want to change it to 1000.

How can I do that without directly modify the code in the openerp website module?

 

I tried to developed a custom module for that, but it still not work.

 

I realized in website.snippet.options.slider, there’s a function called “start”, and in this function set the interval to False, the default of the carousel is 5000, so if I override this function I think it will work.

 

But when I done something like this:

 

openerp.website.snippet.options.slider.include({

Start: function() {

                this._super();

                this.&target.carousel({interval: 1});

},

})

 

Its not work.

The console say: “cannot read property ‘slider’ of underfined”

 

But when I console.log openerp.website.snippet

 

There’s a property options in snippet, and there’s a slider too.

 

Can anybody help me?

 

Thank You.

 

Best Regards,

Hans Yonathan

Odoo Support

FALINWA Limited

Expert in Finance, Information System & Business Intelligence

Odoo Silver Partner

Website: www.falinwa.com

Tel. 13670137019 (China - Shenzhen)