Siirry sisältöön
Menu
Sinun on rekisteröidyttävä, jotta voit olla vuorovaikutuksessa yhteisön kanssa.
Tämä kysymys on merkitty
1 Vastaa
10527 Näkymät

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
Hylkää
Paras vastaus

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
Hylkää
Aiheeseen liittyviä artikkeleita Vastaukset Näkymät Toimenpide
0
lokak. 18
4300
0
lokak. 16
2961
1
maalisk. 19
5420
4
elok. 18
4526
0
tammik. 17
4503