This question has been flagged
3 Replies
3718 Views

I want to add functions and define init but I don't know what is ahead of js.


with the others inheritances, I used for this inheritance :


odoo.define('pos_modification.DB', function (require) { 
"use strict";
var DB = require('point_of_sale.DB');
 DB= DB.extend({

and I tested :


odoo.define('pos_modification.DB', function (require) {
 "use strict"; var DB = require('point_of_sale.DB');
 DB.PosDB=DB.PosDB.extend({

if I change the module point of sale by adding the changes (in init etc.) it works


edit :

I declared my function and added news variables (init) in this code  
 init: function (options) { 
 this._super(options);
; this.myvar = [];}
Myfunction: function(options){
...
}...
});
return DB;
});
but I had :
self.bd.myfunction is not a function




Avatar
Discard

but then what it's your issue?

Author

thanks you for your comment, I had informations

Best Answer

odoo.define('pos_modification.DB', function (require) {

    "use strict";

     var DB = require("point_of_sale.DB");

     DB.include({

        Myfunction: function(options){... } 

     });

     return DB;

});

   

Avatar
Discard