# HG changeset patch
# User Miguel de Juana <miguel.dejuana@openbravo.com>
# Date 1489145789 -3600
#      Fri Mar 10 12:36:29 2017 +0100
# Node ID 7f6cde244b1499668c2018dc3f30fc07c72326f5
# Parent  7bc504b2c2db7e60da023c7f26d79227a538318e
Fixed issue 0035443: OBPOS_PreDeleteLine Hook cannot be cancelled

- Add the posibility of cancel the execution

diff --git a/web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js b/web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
--- a/web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
+++ b/web/org.openbravo.retail.posterminal/js/pointofsale/view/pointofsale.js
@@ -916,7 +916,10 @@
       OB.UTIL.HookManager.executeHooks('OBPOS_PreDeleteLine', {
         order: receipt,
         selectedLines: selectedModels
-      }, function () {
+      }, function (args) {
+        if (args && args.cancelOperation && args.cancelOperation === true) {
+          return;
+        }
         enyo.$.scrim.show();
         receipt.get('lines').forEach(function (line, idx) {
           line.set('undoPosition', idx);
