We would like to avoid creating a new POS Order after payment if there is already another one open.
We already found the related part into the point of sale app.
addons/point_of_sale/static/src/js/models.js
exports.PosModel = Backbone.Model.extend({
...
on_removed_order: function(removed_order,index,reason){
...
else{
// when the order was automatically removed after completion,
// or when we intentionally delete the only concurrent order
// ----------- start replaced code
// this.add_new_order();
// ----------- end replaced code
// ----------- start new code
// select first order after we finish unless there are none left
if (order_list.length > 0)
{ this.set_order(order_list[index] || order_list[order_list.length -1]);
}
else{
this.add_new_order();
}
// ----------- end new code
Now we would like to create an odoo module (V13) which replaces the related part of models.js file of the point_of_sale app.
We already managed to create small modules addings additional attributes and views. But how can we replace js code from another App?