summaryrefslogtreecommitdiff
path: root/addons/point_of_sale/static/src
diff options
context:
space:
mode:
authorAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-02-12 11:11:05 +0000
committerAndrea Grazioso (agr-odoo) <agr@odoo.com>2021-02-19 14:52:36 +0000
commitc3aea6783b8bfb3af383ae881af247fa5507e99f (patch)
tree6e567634e35e676ea1f2c619c9d1dbab9b0a7d8a /addons/point_of_sale/static/src
parent2c0aa825ee54ed674ff9f43722031df8e2f35ca6 (diff)
[FIX] point_of_sale: fix doubleclick of validate button
Open POS, add something to the order, go to checkout, add payment, double click on validate js error will popup opw-2429523 closes odoo/odoo#66046 Signed-off-by: agr-odoo <agr-odoo@users.noreply.github.com>
Diffstat (limited to 'addons/point_of_sale/static/src')
-rw-r--r--addons/point_of_sale/static/src/js/models.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/addons/point_of_sale/static/src/js/models.js b/addons/point_of_sale/static/src/js/models.js
index 0a3def38134..cff97a7d504 100644
--- a/addons/point_of_sale/static/src/js/models.js
+++ b/addons/point_of_sale/static/src/js/models.js
@@ -971,8 +971,12 @@ exports.PosModel = Backbone.Model.extend({
return new Promise(function (resolve, reject) {
self.flush_mutex.exec(function () {
- var flushed = self._flush_orders([self.db.get_order(order_id)], opts);
-
+ var order = self.db.get_order(order_id);
+ if (order){
+ var flushed = self._flush_orders([order], opts);
+ } else {
+ var flushed = Promise.resolve([]);
+ }
flushed.then(resolve, reject);
return flushed;