I am trying to inherit and modify the existing js function of point_of_sale
module. Here is the function i need to inherit,
models.js
exports.Orderline = Backbone.Model.extend({
set_quantity: function(quantity){
console.log('quantity',quantity);
this.order.assert_editable();
if(quantity === 'remove'){
this.order.remove_orderline(this);
return;
}else{
var quant = parseFloat(quantity) || 0;
var unit = this.get_unit();
if(unit){
if (unit.rounding) {
this.quantity = round_pr(quant, unit.rounding);
var decimals = this.pos.dp['Product Unit of Measure'];
this.quantityStr = formats.format_value(round_di(this.quantity, decimals), { type: 'float', digits: [69, decimals]});
} else {
this.quantity = round_pr(quant, 1);
this.quantityStr = this.quantity.toFixed(0);
}
}else{
this.quantity = quant;
this.quantityStr = '' + this.quantity;
}
}
this.trigger('change',this);
},
});
Here is my code,
pos_models.js
odoo.define('point_of_sale.models_inherit', function (require) {
"use strict";
var module = require('point_of_sale.models');
module.include({
set_quantity: function(quantity){
console.log('initialize');
}
});
});
Now i am getting an error in console like,
`module.include is not a function`
How can i inherit this?