You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
28 lines
1.1 KiB
28 lines
1.1 KiB
/******************************************************************************
|
|
Copyright (C) 2018 - Today: GRAP (http://www.grap.coop)
|
|
@author: Sylvain LE GAL (https://twitter.com/legalsylvain)
|
|
License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
|
|
*****************************************************************************/
|
|
'use strict';
|
|
|
|
odoo.define('pos_timeout.models', function (require) {
|
|
|
|
var models = require('point_of_sale.models');
|
|
|
|
/*************************************************************************
|
|
Extend module.PosModel:
|
|
Overload _save_to_server to alter the timeout
|
|
*/
|
|
var PosModelParent = models.PosModel.prototype;
|
|
models.PosModel = models.PosModel.extend({
|
|
_save_to_server: function (orders, options) {
|
|
// Get PoS Config Settings
|
|
var timeout = this.config.pos_order_timeout;
|
|
if (timeout > 0 && orders && orders.length) {
|
|
arguments[1].timeout = timeout * 1000 * orders.length;
|
|
}
|
|
return PosModelParent._save_to_server.apply(this, arguments);
|
|
},
|
|
});
|
|
|
|
});
|