Skip to Content
Menu
This question has been flagged
1 Reply
10456 Views

Hi, Everyone

A new javascript module system which inspired from requirejs has been deployed after Odoo version 8 system.

However, the Odoo version 10's developer document of "Building Interface Extensions"(http://www.odoo.com/documentation/10.0/howtos/web.html), which is the tutorial about how to code JavaScript module, still assume us develop a module on Odoo version 8, didn't tell how to code on this requirejs-version Odoo system.

So, are there anyone can give me some references about how to code javascript module on Odoo 10?

I am handling a task that require modify the POS's cashier page and need to learn how to extend exist javascript. unfortunately, I only have basic knowledge of JavaScript. I need some tutorials to learn.

Thanks.

Avatar
Discard
Best Answer

here is an example to extend js files in odoo 10

odoo.define('your_module_name.some_name', function(require) {
"use strict";

var a_variable = require('name_of_file_to_extend_in_odoo.define'); // for this file 'your_module_name.some_name'

a_variable.include({

your_function_name: function(args) {
         // your code
},
});

});

this link may help you odoo js

Avatar
Discard
Related Posts Replies Views Activity
0
Oct 18
4261
0
Oct 16
2924
1
Mar 19
5336
4
Aug 18
4482
0
Jan 17
4423